lundi 1 août 2016

Pretty way to say "foo not in {bar, baz}" in C++11/14

I'm writing C++ and missing the clarity of Python. But I know that C++ has been evolving and wondering if there's a nicer way to do something like this:

if (foo != bar && foo != baz)

In Python I would do this:

if foo not in {bar, baz}:

Is there a fancy feature in C++11 or C++14 that allows me to do something similarly readable?

Aucun commentaire:

Enregistrer un commentaire