3 // Copyright (c) 2006-2007 Matias Capeletto
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 /// \file tags/support/apply_to_value_type.hpp
10 /// \brief Similar to mpl::apply but for tagged types.
12 #ifndef BOOST_BIMAP_TAGS_SUPPORT_APPLY_TO_VALUE_TYPE_HPP
13 #define BOOST_BIMAP_TAGS_SUPPORT_APPLY_TO_VALUE_TYPE_HPP
15 #if defined(_MSC_VER) && (_MSC_VER>=1200)
19 #include <boost/config.hpp>
21 #include <boost/bimap/tags/tagged.hpp>
22 #include <boost/mpl/apply.hpp>
24 /** \struct boost::bimaps::tags::support::apply_to_value_type
25 \brief Higger order metafunction similar to mpl::apply but for tagged types.
28 template< class Metafunction, class TaggedType >
29 struct apply_to_value_type
33 Metafuntion< value_type_of< TaggedType >::type >::type,
34 tag_of< TaggedType >::type
40 This higher order metafunctions is very useful, and it can be used with lambda
46 #ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
53 template < class F, class TaggedType >
54 struct apply_to_value_type;
56 template < class F, class ValueType, class Tag >
57 struct apply_to_value_type<F, tagged<ValueType,Tag> >
59 typedef BOOST_DEDUCED_TYPENAME mpl::apply< F, ValueType >::type new_value_type;
60 typedef tagged< new_value_type, Tag > type;
63 } // namespace support
68 #endif // BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
70 #endif // BOOST_BIMAP_TAGS_SUPPORT_APPLY_TO_VALUE_TYPE_HPP