Index: boost/utility/value_init.hpp =================================================================== --- boost/utility/value_init.hpp (revision 62030) +++ boost/utility/value_init.hpp (working copy) @@ -10,6 +10,7 @@ // 21 Ago 2008 (Added swap) Niels Dekker, Fernando Cacciola // 20 Feb 2009 (Fixed logical const-ness issues) Niels Dekker, Fernando Cacciola // 03 Apr 2010 (Added initialized, suggested by Jeffrey Hellrung, fixing #3472) Niels Dekker +// 16 May 2010 (Made memset call conditional, fixing #3869) Niels Dekker // #ifndef BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP #define BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP @@ -21,6 +22,7 @@ // contains. More details on these issues are at libs/utility/value_init.htm #include +#include // For BOOST_NO_COMPLETE_VALUE_INITIALIZATION. #include #include #include @@ -41,6 +43,14 @@ #endif #endif +#ifndef BOOST_DETAIL_VALUE_INIT_WORKAROUND + #ifdef BOOST_NO_COMPLETE_VALUE_INITIALIZATION + #define BOOST_DETAIL_VALUE_INIT_WORKAROUND 1 + #else + #define BOOST_DETAIL_VALUE_INIT_WORKAROUND 0 + #endif +#endif + namespace boost { template @@ -82,10 +92,9 @@ initialized() { - // Note: the following memset call will become conditional when ticket #3869 is fixed: - // https://svn.boost.org/trac/boost/ticket/3869 reported by Aleksey Gurtovoy. +#if BOOST_DETAIL_VALUE_INIT_WORKAROUND std::memset(&x, 0, sizeof(x)); - +#endif new (wrapper_address()) wrapper(); }