|
Boost Users : |
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-03-28 11:50:44
AMDG
Daniel Lidström wrote:
> Ovanes wrote:
>
>
> Yes, well boost::noncopyable also prohibits something :-) The whole
> intent of nondynamic is to prohibit (or make difficult) dynamic
> allocation/pointer usage.
> Do you think boost::noncopyable has a valid purpose, but nondynamic is less
> useful?
>
Yes. Copying objects is part of the interface of T. There are some
classes for which copying does not make sense. Where T's are created
is the business of users. The only even conceivable use case I see is RAII
wrappers. I still don't think that it's very useful to prohibit
creation on the
heap, because unlike copies, C++ doesn't automatically call new for you, on
the drop of a hat. In addition, trying to allocate an RAII object on
the heap
will not generally cause a program to go down in flames the way copying a
noncopyable object can.
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