[type_traits] is_base_and_derived warning in MSVC 8.0

The recently included lines 136-137 of boost/type_traits/ is_base_and_derived.hpp: BOOST_STATIC_ASSERT(sizeof(B)); BOOST_STATIC_ASSERT(sizeof(D)); make MSVC 8.0 emit the following warning: c:\...\boost\type_traits\is_base_and_derived.hpp(137) : warning C4800: 'size_t' : forcing value to bool 'true' or 'false' (performance warning) [same for line 138] Changing the assert conditions to BOOST_STATIC_ASSERT(sizeof(B)!=0); BOOST_STATIC_ASSERT(sizeof(D)!=0); shuts the compiler up. HTH, Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

"JOAQUIN LOPEZ MU?Z" wrote:
The recently included lines 136-137 of boost/type_traits/ is_base_and_derived.hpp:
BOOST_STATIC_ASSERT(sizeof(B)); BOOST_STATIC_ASSERT(sizeof(D));
make MSVC 8.0 emit the following warning: c:\...\boost\type_traits\is_base_and_derived.hpp(137) : warning C4800: 'size_t' : forcing value to bool 'true' or 'false' (performance warning) [same for line 138]
Changing the assert conditions to
BOOST_STATIC_ASSERT(sizeof(B)!=0); BOOST_STATIC_ASSERT(sizeof(D)!=0);
shuts the compiler up. HTH,
Thanks, fixed in SVN, John.
participants (2)
-
"JOAQUIN LOPEZ MU?Z"
-
John Maddock