From 99bd35b735fbf70eea6b4e5576fc5c3e7a26edbe Mon Sep 17 00:00:00 2001 From: Peder Holt Date: Tue, 11 Jan 2005 21:22:36 +0000 Subject: [PATCH] Use the same error message when reporting missing typeof registrations in vintage implementation as in compliant implementation [SVN r2441] --- include/boost/typeof/vintage/modifiers.hpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/include/boost/typeof/vintage/modifiers.hpp b/include/boost/typeof/vintage/modifiers.hpp index 7247bb9..423ee3c 100644 --- a/include/boost/typeof/vintage/modifiers.hpp +++ b/include/boost/typeof/vintage/modifiers.hpp @@ -15,7 +15,7 @@ sizer<0xffff> encode(...); template struct validate_type { template - struct use_BOOST_TYPEOF_REGISTER_TYPE { + struct Type_Not_Registered_With_Typeof_System { typedef int type; }; }; @@ -23,7 +23,7 @@ struct validate_type { template<> struct validate_type<0xffff> { template - struct use_BOOST_TYPEOF_REGISTER_TYPE { + struct Type_Not_Registered_With_Typeof_System { }; }; @@ -34,8 +34,13 @@ struct encode_impl struct encoder { typedef T const& (*function_ptr)(V,Types); BOOST_STATIC_CONSTANT(unsigned,value=sizeof(encode(function_ptr(NULL)))); - //If T is a template type, use BOOST_TYPEOF_REGISTER_TEMPLATE. - typedef validate_type::use_BOOST_TYPEOF_REGISTER_TYPE::type type_validation; + /* + If T is a simple type, use BOOST_TYPEOF_REGISTER_TYPE + if T is a simple template type (containing only typenames) use BOOST_TYPEOF_REGISTER_TEMPLATE + If T is a complex template type (containing integral constants) use BOOST_TYPEOF_REGISTER_TEMPLATE_X + If T is a nested class, you need to use BOOST_TYPEOF_REGISTER_TYPE for every concrete instantiation of that class. + */ + typedef validate_type::Type_Not_Registered_With_Typeof_System::type type_validation; }; };