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 relation/symmetrical_base.hpp
10 /// \brief Base class for symmetrical types
12 #ifndef BOOST_BIMAP_RELATION_SYMMETRICAL_BASE_HPP
13 #define BOOST_BIMAP_RELATION_SYMMETRICAL_BASE_HPP
15 #if defined(_MSC_VER) && (_MSC_VER>=1200)
19 #include <boost/config.hpp>
21 #include <boost/mpl/if.hpp>
22 #include <boost/type_traits/remove_const.hpp>
25 #include <boost/bimap/tags/tagged.hpp>
26 #include <boost/bimap/tags/support/default_tagged.hpp>
28 #include <boost/bimap/relation/member_at.hpp>
35 /// \brief Base of symetrical tagged types.
40 template< class TA, class TB, bool force_mutable = false >
41 class symmetrical_base
46 typedef BOOST_DEDUCED_TYPENAME tags::support::default_tagged
51 >::type tagged_left_type;
53 typedef BOOST_DEDUCED_TYPENAME tags::support::default_tagged
58 >::type tagged_right_type;
63 /// The type stored in the relation
65 typedef BOOST_DEDUCED_TYPENAME ::boost::mpl::if_c< force_mutable,
67 BOOST_DEDUCED_TYPENAME ::boost::remove_const<
68 BOOST_DEDUCED_TYPENAME tagged_left_type::value_type >::type,
69 BOOST_DEDUCED_TYPENAME tagged_left_type::value_type
71 >::type left_value_type;
73 typedef BOOST_DEDUCED_TYPENAME ::boost::mpl::if_c< force_mutable,
75 BOOST_DEDUCED_TYPENAME ::boost::remove_const<
76 BOOST_DEDUCED_TYPENAME tagged_right_type::value_type >::type,
77 BOOST_DEDUCED_TYPENAME tagged_right_type::value_type
79 >::type right_value_type;
83 /// The tag of the member. By default it is \c member_at::{side}
84 typedef BOOST_DEDUCED_TYPENAME tagged_left_type ::tag left_tag;
85 typedef BOOST_DEDUCED_TYPENAME tagged_right_type::tag right_tag;
91 } // namespace relation
96 #endif // BOOST_BIMAP_RELATION_SYMMETRICAL_BASE_HPP