From: Eric Niebler (eric_at_[hidden])
Date: 2008-04-02 13:16:45
Giovanni Piero Deretta wrote:
> Anyways, I see that you take great care to guarantee static
> initialization of stateful function objects. Do you really think this
> is a case that is worth supporting? What are the use cases? (for
> example, did you use this functionality when implementing oven?).
> It seems to me that it complicates a lot the interface of the library
> (with tons of ugly macros). I understand that this functionality is
> opt-in (i.e. it is there only if you want it), but I feel
> unconfortable. May be I'm worring too much, but I think that it really
> makes the docs hard to follow.
The ability to statically initialize global objects is pretty important.
In the early days of xpressive, I got a bug report about a crash which
was due to construction order of its global objects, which let to
Proto's expressions-are-aggregates design. If an object must be a
namespace scope -- and function objects must if they are to truly behave
as regular functions -- I won't use them if they need dynamic
-- Eric Niebler Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk