I am looking at the .h file of a Wrapper class. And the class contains one private member:
T* dataPtr;
(where T
is as in template < class T >
defined at the top of the .h file)
The class provides two "* overloading operator" methods:
T& operator*()
{
return *dataPtr;
}
const T& operator*() const
{
return *dataPtr;
}
Both simply return *dataPtr
, but what does the notation "*dataPtr
" actually return, in plain English? And how does it fit with the return type "T&
"?