
Roland Schwarz wrote:
Does this mean you have solved the initialization problem for local statics? i.e. you made this thread-safe for every compiler?
(I remeber a very nasty bug in spirit because of the cited pattern.)
This was fixed in Spirit by solving the said problem. You can find the solution here: <boost/spirit/home/classic/core/non_terminal/impl/static.hpp> http://tinyurl.com/byve27 with usage illustrated here, around line 238 (look for get_definition_static_data_tag): <boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp> http://tinyurl.com/cbnuca Admittedly it can be cumbersome, but it works. A performance hit has been reported for repeatedly callling call_once, that can be solved with double-checked locking. This is not implemented in the repository version. Cheers, João