Hello,
Given something like:
boost::shared_p tr<T> t( new T() );
What is the best (correct?) way to dereference the pointer? The following
two methods work. Is there a difference?
T &rt1 = *t.get();
T &rt2 = *t;
And what about getting at the raw pointers:
T *pt1 = t.get();
T *pt2 = &*t;
Is there an advantage to one or the other?
Thanks,
- Dennis
Given something like:
boost::shared_p tr<T> t( new T() );
What is the best (correct?) way to dereference the pointer? The following
two methods work. Is there a difference?
T &rt1 = *t.get();
T &rt2 = *t;
And what about getting at the raw pointers:
T *pt1 = t.get();
T *pt2 = &*t;
Is there an advantage to one or the other?
Thanks,
- Dennis
Comment