Boost logo

Boost Users :

Subject: Re: [Boost-users] noncopyable
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-12-04 11:50:39


AMDG

Hicham Mouline wrote:
> Like this?
>
> class C : public boost::noncopyable {
> public:
> ... clone() const
> {
> ...
> }
> private:
> C( const C& rhs )
> {
> ....
> }
> };
>
> ... instance c1 of C exists here ....
>
> What possible return types of clone() const are possible?
> .A native reference
> .An auto_ptr
>

auto_ptr makes more sense than a reference because the copy
needs to be allocated on the heap.

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net