|
Boost : |
From: Niels Dekker - mail address until 2008-12-31 (nd_mail_address_valid_until_2008-12-31_at_[hidden])
Date: 2007-08-28 13:29:38
The data of the wrapper class boost::value_initialized<T> may not be
initialized properly, when using Microsoft Visual C++. The problem is
caused by two different compiler issues regarding value initialization.
For details, please read the ticket that I submitted yesterday evening
(#1217): http://svn.boost.org/trac/boost/ticket/1217
Fernando Cacciola and I developed a new version of value_init.hpp,
offering a workaround. The file is attached to the ticket:
http://svn.boost.org/trac/boost/attachment/ticket/1217/value_init_MSVC_workaround.hpp
The workaround version stores the bytes of the T object that is wrapped
by value_initialized<T> as an instance of aligned_storage::type. During
the construction of value_initialized<T>, it clears the bytes of T
(using memset), just before constructing T itself, by placement new:
std::memset(&x, 0, sizeof(x)); new (&x) T();
The workaround is enabled by defining a macro,
BOOST_UTILITY_VALUE_INIT_WORKAROUND.
As I never contributed to a Boost library before, what should I do in
order to get this workaround reviewed, and hopefully get it into the
library?
Kind regards,
-- Niels Dekker http://www.xs4all.nl/~nd/dekkerware Scientific programmer at LKEB, Leiden University Medical Center
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk