Check for multiple values when using comparison operators
问题 I've always been under the impression that for any comparison statement, i.e. X == Y or X != Y is the format, and you chain statements together with && or || . Is there not some way to write X == (Y || Z) instead of X == Y || X == Z ? Edit : Since it has been established that this is not possible to do cleanly, how else could it be done? 回答1: #include <algorithm> #include <array> #include <string> #include <iostream> #include <initializer_list> template<class Type, class Next> bool is_one_of