Let\'s say I have a bunch of well-known values, like this (but const char * is just an example, it could be more complicated):
const char *
const char *A = \"A\"
You could factor your current best solution into a template:
template inline bool is_in(const A &a, B (&bs)[n]) { return std::find(bs, bs + n, a) != bs + n; }
which you can use like
X items[] = { A, C, E, G }; if (is_in(some_complicated_expression_with_ugly_return_type, items)) …