
on Fri Sep 04 2009, "Aleksey Gurtovoy" <agurtovoy-AT-meta-comm.com> wrote:
Hi Peter,
what is the use of value_initialized in boost::mpl::for_each? It should be sufficient if the value is initialized by the constructor.
In theory, yes. In practice, at the time when the code was authored, it wasn't -- see http://www.boost.org/doc/libs/1_40_0/libs/utility/value_init.htm
value_initialized() calls memset() in before calling the constructor.
Apparently this change was introduced in 1.35 release:
"New versions of value_initialized (Boost release version 1.35 or higher) offer a workaround to these issues: value_initialized will now clear its internal data, prior to constructing the object that it contains."
The fact that it's done unconditionally (as opposite only for compilers with the discussed issues) is IMHO a bug.
Agreed. Is this being fixed? -- Dave Abrahams BoostPro Computing http://www.boostpro.com