// Copyright (C) 2006 Peder Holt // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) #include #include #include #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() void do_int(int) {} struct { template T operator[](const T& n) {return n;} } int_p; template struct wrap { BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested,int_p[& do_int]) typedef typename nested::type type; }; BOOST_TYPEOF_REGISTER_TEMPLATE(wrap,1) template struct parser { struct __rule { static T & a_placeholder; BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested,int_p[a_placeholder]) typedef typename nested::type type; }; }; BOOST_STATIC_ASSERT((boost::is_same::type,void(*)(int)>::value)); BOOST_STATIC_ASSERT((boost::is_same >::__rule::type,wrap >::value));