Consider I have some simple class:
template<typename T>
class Vector {
public:
T first() const { return this->m_first; }
T second() const { return this->m_second; }
private:
T m_first;
T m_second;
}
Now I want to create some meaning behind some of that:
typedef Vector<int> Position;
typedef Vector<unsigned int> Dimension;
Can I also create an alias to the methods of the new types Position and Dimension so that for Position, x() references frist(), y() references second() while for Dimension width() references first(), height() references second().
Or even more "speedy": Having first and second public, create aliases to the member variables? Real use case is more complex, but this should display what I want: Two things that are very similar in memory, but called completly different depending on the context.