
________________________________________ De: boost-users-bounces@lists.boost.org [boost-users-bounces@lists.boost.org] En nombre de Dominique Devienne [ddevienne@gmail.com] Enviado el: martes, 14 de julio de 2009 23:18 Para: boost-users Asunto: [Boost-users] [Multi-Index] has_index<BMI,TAG> meta-function
I'd like to use enable_if/disable_if with a meta-function that determines whether a given multi-index container has a given tagged index.
But I'm not having success writing has_index<BMI,TAG>, even looking at BMI's own index<Tag> meta-function :(
You can use this: template<typename Index> struct tag_list { typedef typename Index::tag_list type; }; template<typename MultiIndexContainer,typename Tag> struct has_index: boost::mpl::contains< boost::mpl::transform_view< typename MultiIndexContainer::index_type_list, boost::mpl::contains<tag_list<boost::mpl::_>,Tag> >, boost::mpl::true_
{}; which BTW relies on the mistakenly undocumented nested type tag_list that all indices are equipped with. I'll update the docs when I find some time. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo