]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/bimap/include/boost/bimap/tags/support/apply_to_value_type.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / bimap / include / boost / bimap / tags / support / apply_to_value_type.hpp
CommitLineData
7c673cae
FG
1// Boost.Bimap
2//
3// Copyright (c) 2006-2007 Matias Capeletto
4//
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)
8
9/// \file tags/support/apply_to_value_type.hpp
10/// \brief Similar to mpl::apply but for tagged types.
11
12#ifndef BOOST_BIMAP_TAGS_SUPPORT_APPLY_TO_VALUE_TYPE_HPP
13#define BOOST_BIMAP_TAGS_SUPPORT_APPLY_TO_VALUE_TYPE_HPP
14
15#if defined(_MSC_VER)
16#pragma once
17#endif
18
19#include <boost/config.hpp>
20
21#include <boost/bimap/tags/tagged.hpp>
22#include <boost/mpl/apply.hpp>
23
24/** \struct boost::bimaps::tags::support::apply_to_value_type
25\brief Higger order metafunction similar to mpl::apply but for tagged types.
26
27\code
28template< class Metafunction, class TaggedType >
29struct apply_to_value_type
30{
31 typedef tagged
32 <
33 Metafuntion< value_type_of< TaggedType >::type >::type,
34 tag_of< TaggedType >::type
35
36 > type;
37};
38\endcode
39
40This higher order metafunctions is very useful, and it can be used with lambda
41expresions.
42
43See also tagged.
44 **/
45
46#ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
47
48namespace boost {
49namespace bimaps {
50namespace tags {
51namespace support {
52
53template < class F, class TaggedType >
54struct apply_to_value_type;
55
56template < class F, class ValueType, class Tag >
57struct apply_to_value_type<F, tagged<ValueType,Tag> >
58{
59 typedef BOOST_DEDUCED_TYPENAME mpl::apply< F, ValueType >::type new_value_type;
60 typedef tagged< new_value_type, Tag > type;
61};
62
63} // namespace support
64} // namespace tags
65} // namespace bimaps
66} // namespace boost
67
68#endif // BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
69
70#endif // BOOST_BIMAP_TAGS_SUPPORT_APPLY_TO_VALUE_TYPE_HPP