Easy in ruby as well:
Set[1, 2, 4, 8].include? x
And C++:
static const std::unordered_set<int> membership = {1, 2, 4, 8};
if (membership.count(x)) {
Really, any language with some sort of set membership check. C# has HashSet, so you could use that, though it might be slower. I'm not sure how easy C# makes static const variables, so you might incur extra overhead having to construct a set every time if not, or stick the variable into a higher scope.