]>
Commit | Line | Data |
---|---|---|
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 | ||
10 | /// \file relation/detail/static_access_builder.hpp | |
11 | /// \brief Define macros to help building metafunctions | |
12 | ||
13 | #ifndef BOOST_BIMAP_RELATION_DETAIL_STATIC_ACCESS_BUILDER_HPP | |
14 | #define BOOST_BIMAP_RELATION_DETAIL_STATIC_ACCESS_BUILDER_HPP | |
15 | ||
16 | #if defined(_MSC_VER) | |
17 | #pragma once | |
18 | #endif | |
19 | ||
20 | #include <boost/config.hpp> | |
21 | ||
22 | #include <boost/bimap/relation/support/is_tag_of_member_at.hpp> | |
23 | #include <boost/bimap/detail/debug/static_error.hpp> | |
24 | #include <boost/utility/enable_if.hpp> | |
25 | #include <boost/preprocessor/cat.hpp> | |
26 | ||
27 | ||
28 | ||
29 | /****************************************************************************** | |
30 | BIMAP SYMMETRIC STATIC ACCESS INTERFACE | |
31 | ******************************************************************************* | |
32 | ||
33 | template< class Tag, class SYMETRIC_TYPE > | |
34 | struct NAME | |
35 | { | |
36 | -UNDEFINED BODY-; | |
37 | }; | |
38 | ||
39 | ******************************************************************************/ | |
40 | ||
41 | ||
42 | /*===========================================================================*/ | |
43 | #define BOOST_BIMAP_SYMMETRIC_STATIC_ACCESS_BUILDER( \ | |
44 | \ | |
45 | NAME, \ | |
46 | SYMMETRIC_TYPE, \ | |
47 | LEFT_BODY, \ | |
48 | RIGHT_BODY \ | |
49 | ) \ | |
50 | \ | |
51 | template \ | |
52 | < \ | |
53 | class Tag, \ | |
54 | class SYMMETRIC_TYPE, \ | |
55 | class Enable = void \ | |
56 | > \ | |
57 | struct NAME \ | |
58 | { \ | |
59 | BOOST_BIMAP_STATIC_ERROR( \ | |
60 | BOOST_PP_CAT(NAME,_FAILURE), \ | |
61 | (SYMMETRIC_TYPE,Tag) \ | |
62 | ); \ | |
63 | }; \ | |
64 | \ | |
65 | template< class Tag, class SYMMETRIC_TYPE > \ | |
66 | struct NAME \ | |
67 | < \ | |
68 | Tag, SYMMETRIC_TYPE, \ | |
69 | BOOST_DEDUCED_TYPENAME enable_if \ | |
70 | < \ | |
71 | ::boost::bimaps::relation::support::is_tag_of_member_at_left \ | |
72 | < \ | |
73 | Tag, \ | |
74 | SYMMETRIC_TYPE \ | |
75 | > \ | |
76 | \ | |
77 | >::type \ | |
78 | > \ | |
79 | { \ | |
80 | LEFT_BODY; \ | |
81 | }; \ | |
82 | \ | |
83 | template< class Tag, class SYMMETRIC_TYPE > \ | |
84 | struct NAME \ | |
85 | < \ | |
86 | Tag, SYMMETRIC_TYPE, \ | |
87 | BOOST_DEDUCED_TYPENAME enable_if \ | |
88 | < \ | |
89 | ::boost::bimaps::relation::support::is_tag_of_member_at_right \ | |
90 | < \ | |
91 | Tag, \ | |
92 | SYMMETRIC_TYPE \ | |
93 | > \ | |
94 | \ | |
95 | >::type \ | |
96 | > \ | |
97 | { \ | |
98 | RIGHT_BODY; \ | |
99 | }; | |
100 | /*===========================================================================*/ | |
101 | ||
102 | ||
103 | #endif // BOOST_BIMAP_RELATION_DETAIL_STATIC_ACCES_BUILDER_HPP | |
104 | ||
105 |