Consider the following class :
template<bool Condition> class MyClass
{
protected:
/* SOMETHING */ _var;
};
With a std::conditional<Condition, const int, int>::type _var; I can choose if _var is a const or a non-const through the template parameter.
How to do the equivalent for static/non static ?
(I ask for an equivalent though whatever metaprogramming technique you want)
You probably have to do it using a helper struct, since static is not part of the type but a storage specifier. For example:
That being said, easy switching between static and non-static is probably a bad idea..