|
Boost : |
Subject: Re: [boost] [ptr_container] clone_ptr library
From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2010-05-25 09:24:22
RafaÅ Moniuszko skrev:
> 2010/5/19 Thorsten Ottosen <nesotto_at_[hidden]>:
>
>>> T* operator -> () const throw() { return ptr_; }
>> Please overload on const for a deep-copied object, same for operator()*
>>
>
> I don't think I understand. Could you make it more clear for me?
>
Implement the operators like this:
T* operator->() { return ptr_; }
const T* operatot->() const { return ptr_; }
T& operator*() { BOOST_ASSERT( ptr ); return *ptr_; }
const T& operator*() const { BOOST_ASSERT( ptr_ ); return *ptr_; }
-Thorsten
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk