Boost logo

Boost :

From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2005-06-14 02:29:33


Hello,

attached patch solves a problem with the singleton implementation in the
test library surfacing on Tru64/CXX. On this compiler, we need an explicit
instantiation of the singleton template, otherwise multiple copies of the
singleton are created.

Ok to apply?

Markus

Index: utils/trivial_singleton.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/test/utils/trivial_singleton.hpp,v
retrieving revision 1.1
diff -u -r1.1 trivial_singleton.hpp
--- utils/trivial_singleton.hpp 20 Feb 2005 08:27:08 -0000 1.1
+++ utils/trivial_singleton.hpp 14 Jun 2005 07:26:59 -0000
@@ -45,9 +45,19 @@
 type() {} \
 /**/
 
+#if BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042))
+
+#define BOOST_TEST_SINGLETON_INST( inst ) \
+template class unit_test::singleton< BOOST_JOIN( inst, _t ) > ; \
+namespace { BOOST_JOIN( inst, _t)& inst = BOOST_JOIN( inst, _t)::instance(); }
+
+#else
+
 #define BOOST_TEST_SINGLETON_INST( inst ) \
 namespace { BOOST_JOIN( inst, _t)& inst = BOOST_JOIN( inst, _t)::instance(); }
 
+#endif
+
 } // namespace boost
 
 //____________________________________________________________________________//


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk