David Abrahams wrote:
If that sounds like a reasonable compromise - in particular, to Nikolay - please feel free to implement it.
I did you one better. Now it just works with no BOOST_MPL_AUX_HAS_XXX_MSVC_NO_IS_INCOMPLETE switches required from the user:
--- has_xxx.hpp 8 Jul 2003 05:10:02 -0000 1.16 +++ has_xxx.hpp 2 Aug 2003 15:58:44 -0000 1.17 @@ -3,8 +3,8 @@ // See http://www.boost.org for updates, documentation, and revision history.
//-------------------------------------------------------------------------- ---
// -// Copyright (c) 2002 -// Aleksey Gurtovoy +// Copyright (c) 2002-2003 +// Aleksey Gurtovoy and David Abrahams // // Permission to use, copy, modify, distribute and sell this software // and its documentation for any purpose is hereby granted without fee, @@ -73,10 +73,14 @@ template< typename T > struct msvc_is_incomplete { - struct incomplete_; - BOOST_STATIC_CONSTANT(bool, value = - sizeof(void (T::*)()) == sizeof(void (incomplete_::*)()) - ); + // MSVC is capable of some kinds of SFINAE. If U is an incomplete + // type, it won't pick the second overload + static char tester(...); + template <class U> + static char(& tester(type_wrapper<U>) )[sizeof(U) + 1]; + + BOOST_STATIC_CONSTANT( + bool, value = sizeof(tester(type_wrapper<T>())) == 1); };
Clever! Some kinds of SFINAE make MSVC much more ICE-prone, though. I guess the regressions will show us if that's the case or not. Thanks for taking care of it! Aleksey