
Ovanes wrote: [snip]
What do you think how this allocator will allocate the number of these element? Actually in any possible way. It can use new[] or new char[sizeof(T)*NumElems] or use an own mem-manager. And the worse thing you can't make allocator friend of your class, since users of containers can pass their own allocators. And despite all enumerated facts you will fail to compile, since the function address will fail to return the pointer to x, because it is prohibited in your case.
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? -- Daniel