
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