Boost logo

Boost-Commit :

From: nielsdekker_at_[hidden]
Date: 2007-10-16 13:00:28


Author: niels_dekker
Date: 2007-10-16 13:00:28 EDT (Tue, 16 Oct 2007)
New Revision: 40088
URL: http://svn.boost.org/trac/boost/changeset/40088

Log:
Disabled MSVC warning C4345, in response to Gennadiy Rozental, Boost Developer mailing list, "[utility] value_init warning", October 14, 2007. Push'n'pop reminder from Paul A Bristow taken into account.
Text files modified:
   trunk/boost/utility/value_init.hpp | 15 +++++++++++++++
   1 files changed, 15 insertions(+), 0 deletions(-)

Modified: trunk/boost/utility/value_init.hpp
==============================================================================
--- trunk/boost/utility/value_init.hpp (original)
+++ trunk/boost/utility/value_init.hpp 2007-10-16 13:00:28 EDT (Tue, 16 Oct 2007)
@@ -31,6 +31,16 @@
 #include <cstring>
 #include <new>
 
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#if _MSC_VER >= 1310
+// When using MSVC 7.1 or higher, placement new, "new (&x) T()", may trigger warning C4345:
+// "behavior change: an object of POD type constructed with an initializer of the form ()
+// will be default-initialized". There is no need to worry about this, though.
+#pragma warning(disable: 4345)
+#endif
+#endif
+
 namespace boost {
 
 namespace vinit_detail {
@@ -89,6 +99,11 @@
     mutable typename ::boost::aligned_storage<sizeof(T), ::boost::alignment_of<T>::value>::type x;
 } ;
 
+#ifdef BOOST_MSVC
+// Restores the state of warning C4345.
+#pragma warning(pop)
+#endif
+
 #else
 
 namespace boost {


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk