Chris@16
|
1 // Boost.Bimap
|
Chris@16
|
2 //
|
Chris@16
|
3 // Copyright (c) 2006-2007 Matias Capeletto
|
Chris@16
|
4 //
|
Chris@16
|
5 // Distributed under the Boost Software License, Version 1.0.
|
Chris@16
|
6 // (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
7 // http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
8
|
Chris@16
|
9 /// \file detail/manage_bimap_key.hpp
|
Chris@16
|
10 /// \brief Utility class to manage the set types of a bimap.
|
Chris@16
|
11
|
Chris@16
|
12 #ifndef BOOST_BIMAP_DETAIL_MANAGE_BIMAP_KEY_HPP
|
Chris@16
|
13 #define BOOST_BIMAP_DETAIL_MANAGE_BIMAP_KEY_HPP
|
Chris@16
|
14
|
Chris@101
|
15 #if defined(_MSC_VER)
|
Chris@16
|
16 #pragma once
|
Chris@16
|
17 #endif
|
Chris@16
|
18
|
Chris@16
|
19 #include <boost/config.hpp>
|
Chris@16
|
20
|
Chris@16
|
21 #include <boost/mpl/eval_if.hpp>
|
Chris@16
|
22 #include <boost/mpl/identity.hpp>
|
Chris@16
|
23
|
Chris@16
|
24 #include <boost/bimap/detail/is_set_type_of.hpp>
|
Chris@16
|
25
|
Chris@16
|
26 #include <boost/bimap/set_of.hpp>
|
Chris@16
|
27
|
Chris@16
|
28 namespace boost {
|
Chris@16
|
29 namespace bimaps {
|
Chris@16
|
30 namespace detail {
|
Chris@16
|
31
|
Chris@16
|
32 /** \struct boost::bimaps::detail::manage_bimap_key
|
Chris@16
|
33 \brief Metafunction to manage the set types of a bimap.
|
Chris@16
|
34
|
Chris@16
|
35 \code
|
Chris@16
|
36 template< class Type >
|
Chris@16
|
37 struct manage_bimap_key
|
Chris@16
|
38 {
|
Chris@16
|
39 typedef -SetType- type;
|
Chris@16
|
40 }
|
Chris@16
|
41 \endcode
|
Chris@16
|
42
|
Chris@16
|
43 See also bimap, bimap_core.
|
Chris@16
|
44 **/
|
Chris@16
|
45
|
Chris@16
|
46 #ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
|
Chris@16
|
47
|
Chris@16
|
48 template< class Type >
|
Chris@16
|
49 struct manage_bimap_key
|
Chris@16
|
50 {
|
Chris@16
|
51
|
Chris@16
|
52 typedef BOOST_DEDUCED_TYPENAME
|
Chris@16
|
53
|
Chris@16
|
54 mpl::eval_if< BOOST_DEDUCED_TYPENAME is_set_type_of< Type >::type,
|
Chris@16
|
55 // {
|
Chris@16
|
56 mpl::identity< Type >,
|
Chris@16
|
57 // }
|
Chris@16
|
58 // else
|
Chris@16
|
59 // {
|
Chris@16
|
60 // Default it to a set
|
Chris@16
|
61 mpl::identity< set_of< Type > >
|
Chris@16
|
62 // }
|
Chris@16
|
63
|
Chris@16
|
64 >::type set_type;
|
Chris@16
|
65
|
Chris@16
|
66 // Returns set_type and evaluate the concept_checked_type
|
Chris@16
|
67
|
Chris@16
|
68 typedef BOOST_DEDUCED_TYPENAME mpl::if_c< true, set_type,
|
Chris@16
|
69 BOOST_DEDUCED_TYPENAME set_type::lazy_concept_checked::type
|
Chris@16
|
70 >::type type;
|
Chris@16
|
71 };
|
Chris@16
|
72
|
Chris@16
|
73
|
Chris@16
|
74
|
Chris@16
|
75 #endif // BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
|
Chris@16
|
76
|
Chris@16
|
77 } // namespace detail
|
Chris@16
|
78 } // namespace bimaps
|
Chris@16
|
79 } // namespace boost
|
Chris@16
|
80
|
Chris@16
|
81
|
Chris@16
|
82 #endif // BOOST_BIMAP_DETAIL_MANAGE_BIMAP_KEY_HPP
|
Chris@16
|
83
|
Chris@16
|
84
|