In a template class, how to define a property alias conditionally to the 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 declaration possible? if yes, how?