Opened 13 years ago

Last modified 13 years ago

#3112 new Bugs

Tag object initialization not guaranteed legal

Reported by: Dave Abrahams Owned by: Daniel Wallin
Milestone: Boost 1.40.0 Component: parameter
Version: Boost 1.38.0 Severity: Problem
Keywords: Cc:

Description

We should be using this technique: http://tinyurl.com/threadsafe-static-globals

Change History (1)

comment:1 by Daniel Wallin, 13 years ago

Isn't that exactly what we are already doing?

template <class tag>
struct keyword
{
    ...
    static keyword<Tag> const instance;
};

template <class Tag>
keyword<Tag> const keyword<Tag>::instance = {};

...

    namespace                                                       \
    {                                                               \
       ::boost::parameter::keyword<tag_namespace::name> const& name \
       = ::boost::parameter::keyword<tag_namespace::name>::instance;\
    }
Note: See TracTickets for help on using tickets.