let's say I have a class:
is there a way to make sure that the conversion operator returns a reference to the private data member? I have googled this subject and nobody even talks about this aspect of conversion operators. Is the default return type a copy or a reference?Code:template<class T> class Container { public: Container(const T& t) : m_T(t) { } Container<T>& operator = (const T& t) { m_T = t; return *this; } operator T () { return m_T; } private: T m_T; };