Boost logo

Boost :

From: Niels Dekker - mail address until 2008-12-31 (nd_mail_address_valid_until_2008-12-31_at_[hidden])
Date: 2007-10-15 12:50:31


>> #pragma warning(disable: 4345)?

Paul A Bristow wrote:
> Don't forget to push'n'pop the warning level -
> in case any user finds this warning informative.

Thanks! BTW, this warning is only issued by MSVC 7.1 (_MSC_VER 1310), and
higher. So I think it should have an extra check, #if _MSC_VER >= 1310.

Still there's another warning that might pop up when using value_init, at
least on MSVC 8.0: "warning C4351: new behavior: elements of array 'T' will
be default initialized." So I guess both warnings should be disabled,
within value_init.hpp:

#ifdef BOOST_MSVC
#pragma warning(push)
#if _MSC_VER >= 1310 // MSVC 7.1 or higher.
// behavior change: an object of POD type [...] will be default-initialized.
#pragma warning(disable: 4345)
#endif
#if _MSC_VER >= 1400 // MSVC 8.0 or higher.
// new behavior: elements of array 'T' will be default initialized.
#pragma warning(disable: 4351)
#endif
#endif
...

#ifdef BOOST_MSVC
#pragma warning(pop)
#endif

Right? I wouldn't mind doing the commit :-) But I'll also contact
Fernando Cacciola, the creator and owner of value_init.

Kind regards,

  Niels


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