From: Ian McCulloch (ianmcc_at_[hidden])
Date: 2002-04-18 06:21:26
You beat me to it - so I'll reply to this rather than the previous
On 18 Apr 2002, David White wrote:
> There are two seperate issues that we shouldn't get confused.
> One is the issue of implementing it in a threadsafe way. This is
> relatively simple - just place it in thread-specific storage.
> The second issue is the issue of only creating the objects on the stack.
> This issue can be only marginally abated by declaring operator new
> private. The issue of using the object as a member and then allocating
> on the heap cannot be stopped by the compiler. Thus, the documentation
> would have to clearly state the way in which vlarrays should be used. I
> don't see this as too much of a problem - many types of objects have to
> have care taken with their use. Also, it should be fairly easy to make
> the debug version of the allocator complain very loudly and very quickly
> if someone tries to store vlarray objects in a prohibited fashion.
Even further, it is probably bad style to put a vlarray inside a structure
at all, even if it is not allocated on the heap. I know of no way of
prohibiting this though. It would require some mechanism to disable using
a vlarray in a constructor initialization list, but allowing an
auto vlarray object. Just for peace of mind, can someone say conclusively
that this is impossible ?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk