
"David Abrahams" <dave@boost-consulting.com> wrote in message news:u1x6xgong.fsf@boost-consulting.com...
I just tried to compile something with the test library and two translation units. Boom! It was this definition, which appears in boost/test/impl/execution_monitor.ipp.
I wonder which Boost.Test componenent were you using?
signal_handler* signal_handler::s_active_handler = NULL; //!! need to be placed in thread specific storage
I would prefer to fix this post release.
have this problem. The answer is to initialize a *reference* in the unnamed namespace to a single, common object:
namespace whatever { class foo {};
template <class T, int = 0> struct unique_instance { T& get() { static T x; return x; }; };
namespace { foo& bar = unique_instance<foo>::get(); } }
This is an idiom I am using in Boost.Test's trivial_singleton.hpp. Here is a solution for the issue above: ===================================== struct active_signal_handler_t : public singleton<active_signal_handler_t> { signal_handler* _; private: BOOST_TEST_SINGLETON_CONS( active_signal_handler_t ); }; BOOST_TEST_SINGLETON_INST( active_signal_handler ) ===================================== active_signal_handler._ is s_active_handler above. Gennadiy