Subject: Re: [boost] [any] new version
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2011-09-05 07:18:26
On 02/09/2011 20:58, Martin Bidlingmaier wrote:
> So there are actually two main issues that need to be taken care of:
> - 1. dlls
> I think a good solution would be to add a new class, e.g. as
> Andrey Semashev proposed 'local_any', that derives from the current
> version of any.
> The normal version could be used for inter dll passing, the new version
> when the user can assure that a local_any instance won't be passed between
> Conversion could be provided from local_any to any.
I don't think Boost libraries should be designed for a single platform.
> - 2. thread safety
> In c++03, variables defined at namespace scope are not necessarily
> initialized before main()
Yes they are.
> , so there could be data races for the
> previous_id in next_id() in multi threaded applications.
That's not namespace scope, that's function scope.
The C++11 standard (the only one aware of multithreading) mandates that
initialization of static variables at function scope is thread-safe.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk