From 8faf831bd179d7e47eced117f746e5616c8ce85a Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 25 May 2020 23:50:35 +0300 Subject: [PATCH] memset data_ instead of *this --- include/boost/utility/value_init.hpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/boost/utility/value_init.hpp b/include/boost/utility/value_init.hpp index 2490b48..418a214 100644 --- a/include/boost/utility/value_init.hpp +++ b/include/boost/utility/value_init.hpp @@ -35,8 +35,6 @@ // It is safe to ignore the following MSVC warning, which may pop up when T is // a const type: "warning C4512: assignment operator could not be generated". #pragma warning(disable: 4512) -// C4355: 'this' : used in base member initializer list -#pragma warning(disable: 4355) #endif #ifdef BOOST_NO_COMPLETE_VALUE_INITIALIZATION @@ -89,7 +87,7 @@ class initialized BOOST_GPU_ENABLED initialized(): #if BOOST_DETAIL_VALUE_INIT_WORKAROUND - zero_init( this, sizeof(*this) ), + zero_init( &const_cast< char& >( reinterpret_cast( data_ ) ), sizeof( data_ ) ), #endif data_() {