Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:29:39

0001 // Boost.Bimap
0002 //
0003 // Copyright (c) 2006-2007 Matias Capeletto
0004 //
0005 // Distributed under the Boost Software License, Version 1.0.
0006 // (See accompanying file LICENSE_1_0.txt or copy at
0007 // http://www.boost.org/LICENSE_1_0.txt)
0008 
0009 /// \file relation/symmetrical_base.hpp
0010 /// \brief Base class for symmetrical types
0011 
0012 #ifndef BOOST_BIMAP_RELATION_SYMMETRICAL_BASE_HPP
0013 #define BOOST_BIMAP_RELATION_SYMMETRICAL_BASE_HPP
0014 
0015 #if defined(_MSC_VER)
0016 #pragma once
0017 #endif
0018 
0019 #include <boost/config.hpp>
0020 
0021 #include <boost/mpl/if.hpp>
0022 #include <boost/type_traits/remove_const.hpp>
0023 
0024 // Boost.Bimap
0025 #include <boost/bimap/tags/tagged.hpp>
0026 #include <boost/bimap/tags/support/default_tagged.hpp>
0027 
0028 #include <boost/bimap/relation/member_at.hpp>
0029 
0030 
0031 namespace boost {
0032 namespace bimaps {
0033 namespace relation {
0034 
0035 /// \brief Base of symmetrical tagged types.
0036 /**
0037 
0038                                                            **/
0039 
0040 template< class TA, class TB, bool force_mutable = false >
0041 class symmetrical_base
0042 {
0043 
0044     public:
0045 
0046     typedef BOOST_DEDUCED_TYPENAME tags::support::default_tagged
0047     <
0048         TA,
0049         member_at::left
0050 
0051     >::type tagged_left_type;
0052 
0053     typedef BOOST_DEDUCED_TYPENAME tags::support::default_tagged
0054     <
0055         TB,
0056         member_at::right
0057 
0058     >::type tagged_right_type;
0059 
0060     public:
0061 
0062     //@{
0063         /// The type stored in the relation
0064 
0065         typedef BOOST_DEDUCED_TYPENAME ::boost::mpl::if_c< force_mutable,
0066 
0067             BOOST_DEDUCED_TYPENAME ::boost::remove_const<
0068                 BOOST_DEDUCED_TYPENAME tagged_left_type::value_type >::type,
0069             BOOST_DEDUCED_TYPENAME tagged_left_type::value_type
0070 
0071         >::type left_value_type;
0072 
0073         typedef BOOST_DEDUCED_TYPENAME ::boost::mpl::if_c< force_mutable,
0074 
0075             BOOST_DEDUCED_TYPENAME ::boost::remove_const<
0076                 BOOST_DEDUCED_TYPENAME tagged_right_type::value_type >::type,
0077             BOOST_DEDUCED_TYPENAME tagged_right_type::value_type
0078 
0079         >::type right_value_type;
0080     //@}
0081 
0082     //@{
0083         /// The tag of the member. By default it is \c member_at::{side}
0084         typedef BOOST_DEDUCED_TYPENAME tagged_left_type ::tag  left_tag;
0085         typedef BOOST_DEDUCED_TYPENAME tagged_right_type::tag right_tag;
0086     //@}
0087 };
0088 
0089 
0090 
0091 } // namespace relation
0092 } // namespace bimaps
0093 } // namespace boost
0094 
0095 
0096 #endif // BOOST_BIMAP_RELATION_SYMMETRICAL_BASE_HPP
0097