mardi 23 mai 2017

is it possible to emulate constexpr if on c++11

C++17 adds constexpr if ( conditional if the argument can be deduced during compilation ) http://ift.tt/2q9fVSt

Is there a trick to emulate a limited form of this construct in C++11 ?

If would need the following construct in a macro:

#define ALLOCATE(x) if ({x is a constant}) allocate<x>() else allocate(x)

Aucun commentaire:

Enregistrer un commentaire