//Purpose: // Try to infer what collect_concepts does // by printing typeinfo for various parts of // the calculation of collect_concepts. // #include #include #include #include #include #include #include namespace mpl = boost::mpl; using namespace boost::type_erasure; template < typename Concept > void collect_concepts_trace(Concept*) { typedef Concept concept0_t ; std::cout<<":concept0_t="<<::utility::demangled_type_name()<<"\n"; typedef typename ::boost::type_erasure::detail:: normalize_concept_impl < concept0_t >::type norm_t ; std::cout<<":norm_t="<<::utility::demangled_type_name()<<"\n"; typedef typename ::boost::type_erasure::detail::create_placeholder_map < typename norm_t::second >::type map0_t ; typedef ::boost::mpl::set0<> out0_t ; std::cout<<":map0_t="<<::utility::demangled_type_name()<<"\n"; typedef ::boost::type_erasure::detail::substitution_map sb_map_t ; std::cout<<":sb_map_t="<<::utility::demangled_type_name()<<"\n"; typedef ::boost::type_erasure::detail::rebind_placeholders < concept0_t , sb_map_t > trans_t ; std::cout<<":trans_t="<<::utility::demangled_type_name()<<"\n"; typedef typename ::boost::mpl::eval_if < ::boost::is_same , ::boost::mpl::identity , ::boost::mpl::insert < out0_t , trans_t > >::type out1_t ; std::cout<<":out1_t="<<::utility::demangled_type_name()<<"\n"; typedef ::boost::mpl::is_sequence is_seq_t ; if(is_seq_t::value) { typedef typename ::boost::mpl::fold < concept0_t , out1_t , detail::collect_concepts < ::boost::mpl::_2 , map0_t , ::boost::mpl::_1 > >::type result_t; std::cout<<":result_t="<<::utility::demangled_type_name()<<"\n"; } } int main() { typedef mpl::vector < copy_constructible<> , ostreamable<> > concept_t ; typedef any < concept_t > any_t ; any_t x(10) ; std::cout<<":x="<(0)); typedef detail::collect_concepts < concept_t >::type collect_t ; std::cout<<":collect_t="<<::utility::demangled_type_name()<<"\n"; return 0; }