Subject: [Boost-bugs] [Boost C++ Libraries] #1732: Require clarification on boost::serialization::singleton
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-03-30 00:34:04
#1732: Require clarification on boost::serialization::singleton
-------------------------------------------------------+--------------------
Reporter: Sohail Somani <boost-trac_at_[hidden]> | Owner: ramey
Type: Support Requests | Status: new
Milestone: To Be Determined | Component: serialization
Version: Boost Development Trunk | Severity: Not Applicable
Keywords: |
-------------------------------------------------------+--------------------
Hi,
I would appreciate some reference to the standards in
boost/serialization/singleton.hpp. Specifically why this is supposed to
work on "working compilers":
BOOST_DLLEXPORT static T & instance;
// include this to provoke instantiation at pre-execution time
static void use(T const &) {}
static T & get_instance(){
static T t;
// refer to instance, causing it to be instantiated (and
// initialized at startup on working compilers)
use(instance);
return t;
}
Thanks!
--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1732>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:57 UTC