From 7dc55473ad96069eed8e8185dc6f88a446cbbd09 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 29 Nov 2004 16:49:48 +0000 Subject: [PATCH] Added fix for abstract template types (the fix forces instantiation of the template, and corrects problems with gcc-3.4 and VC7.1). [SVN r26356] --- include/boost/type_traits/is_abstract.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/boost/type_traits/is_abstract.hpp b/include/boost/type_traits/is_abstract.hpp index 48d98e5..5f6e38f 100755 --- a/include/boost/type_traits/is_abstract.hpp +++ b/include/boost/type_traits/is_abstract.hpp @@ -41,8 +41,12 @@ // (starting with submission #10). // - Jan 2004: GCC 3.4 fixed to suport DR337 (Giovanni Bajo). // - Jan 2004: modified to be part of Boost.TypeTraits (Pavel Vozenilek). +// - Nov 2004: Christoph Ludwig found that the implementation did not work with +// template types and gcc-3.4 or VC7.1, fix due to Christoph Ludwig +// and John Maddock. // +#include #include #include #include "boost/type_traits/detail/ice_and.hpp" @@ -64,6 +68,11 @@ struct is_abstract_imp static type_traits::no_type check_sig(U (*)[1]); template static type_traits::yes_type check_sig(...); + // + // T must be a complete type, further if T is a template then + // it must be instantiated in order for us to get the right answer: + // + BOOST_STATIC_ASSERT(sizeof(T)); // GCC2 won't even parse this template if we embed the computation // of s1 in the computation of value.