diff --git a/doc/typeof.qbk b/doc/typeof.qbk index 548c505..31be5e7 100644 --- a/doc/typeof.qbk +++ b/doc/typeof.qbk @@ -644,12 +644,14 @@ that allows a nested class of base to be defined in a class derived from base: //Use the base class to access the type. typedef typeof_access::id2type::type type; -This method has also been adapted to VC7.0, where the nested class +Peder Holt adapted this method to VC7.0, where the nested class is a template class that is specialized in the derived class. -The loopholes have been fixed in VC8.0 though, so on this compiler -this method doesn't work. + +In VC8.0, it seemed that all the bug-featire had been fixed, but +Steven Watanabe managed to implement a more rigorous version of the VC7.0 fix that +enables 'typeof' to be supported 'natively' here as well. -For this and many other compilers neither native `typeof` support +For many other compilers neither native `typeof` support nor the trick described above is an option. For such compilers the emulation method is the only way of implementing `typeof`. diff --git a/test/modifiers.cpp b/test/modifiers.cpp index 8c44233..41a9da9 100755 --- a/test/modifiers.cpp +++ b/test/modifiers.cpp @@ -14,3 +14,6 @@ BOOST_STATIC_ASSERT(boost::type_of::test::value); BOOST_STATIC_ASSERT(boost::type_of::test::value); BOOST_STATIC_ASSERT(boost::type_of::test::value); BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); + diff --git a/test/test.hpp b/test/test.hpp index f0cb166..cd694c0 100755 --- a/test/test.hpp +++ b/test/test.hpp @@ -8,23 +8,24 @@ #include #include #include +#include namespace boost { namespace type_of { - template + template struct test_wrapper{}; - template + template T test_make(T*); - template + template struct test { - enum {value = boost::is_same< + BOOST_STATIC_CONSTANT(std::size_t,value = (boost::is_same< BOOST_TYPEOF_TPL(test_make((test_wrapper*)0)), test_wrapper - >::value - }; + >::value) + ); }; }}