In a template class, how to conditionally define a property template for a template?
Example:
template<class Type, unsigned int Dimensions> class SpaceVector { public: std::array<Type, Dimensions> value; Type &x = value[0]; // only if Dimensions >0 Type &y = value[1]; // only if Dimensions >1 Type &z = value[2]; // only if Dimensions >2 };
Is this conditional ad possible? if so, how?
c ++ alias c ++ 11 templates
Adrian maire
source share