26 Jul
2009
26 Jul
'09
3:57 p.m.
Emil Dotchevski wrote:
On Fri, Jul 24, 2009 at 8:06 PM, Robert Ramey
wrote: Emil Dotchevski wrote:
On Fri, Jul 24, 2009 at 4:40 PM, Robert Ramey
wrote: would be equivalent to ar >> *m_x in which case the "const" would be violated. At the time the object needs to be instantiated and read, instead of dealing with a T const * p as:
p=new T; ar >> *p;
what's wrong with:
T * tmp=new T; ar >> * tmp; p=tmp;
This reminded me of the same issue with shared_ptr<const T> https://svn.boost.org/trac/boost/ticket/3123 I'm not sure Robert is applying const correctness correctly here. There is no "const violation" here. If there was, you'd see a const_cast in the patch somewhere. -- Sohail Somani http://uint32t.blogspot.com