Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:34:18

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 unconstrained_set_of.hpp
0010 /// \brief Include support for set constrains for the bimap container
0011 
0012 #ifndef BOOST_BIMAP_UNCONSTRAINED_SET_OF_HPP
0013 #define BOOST_BIMAP_UNCONSTRAINED_SET_OF_HPP
0014 
0015 #if defined(_MSC_VER)
0016 #pragma once
0017 #endif
0018 
0019 #include <boost/config.hpp>
0020 
0021 #include <boost/bimap/detail/user_interface_config.hpp>
0022 
0023 #include <boost/mpl/bool.hpp>
0024 
0025 #include <boost/concept_check.hpp>
0026 
0027 #include <boost/bimap/detail/concept_tags.hpp>
0028 
0029 #include <boost/bimap/tags/support/value_type_of.hpp>
0030 
0031 #include <boost/bimap/detail/generate_index_binder.hpp>
0032 #include <boost/bimap/detail/generate_view_binder.hpp>
0033 #include <boost/bimap/detail/generate_relation_binder.hpp>
0034 
0035 #include <boost/bimap/views/unconstrained_map_view.hpp>
0036 #include <boost/bimap/views/unconstrained_set_view.hpp>
0037 
0038 namespace boost {
0039 namespace bimaps {
0040 
0041 /// \brief Set Type Specification
0042 /**
0043 This struct is used to specify a set specification.
0044 It is not a container, it is just a metaprogramming facility to
0045 express the type of a set. Generally, this specification will
0046 be used in other place to create a container.
0047 The first parameter is the type of the objects in the set.
0048 
0049 \code
0050 
0051 using namespace support;
0052 
0053 BOOST_STATIC_ASSERT( is_set_type_of< unconstrained_set_of<Type> >::value )
0054 
0055 \endcode
0056 
0057 See also unconstrained_set_of_relation.
0058                                                                         **/
0059 
0060 template
0061 <
0062     class KeyType
0063 >
0064 struct unconstrained_set_of : public ::boost::bimaps::detail::set_type_of_tag
0065 {
0066     /// User type, can be tagged
0067     typedef KeyType user_type;
0068 
0069     /// Type of the object that will be stored in the container
0070     typedef BOOST_DEDUCED_TYPENAME ::boost::bimaps::tags::support::
0071         value_type_of<user_type>::type value_type;
0072 
0073     struct lazy_concept_checked
0074     {
0075         BOOST_CLASS_REQUIRE ( value_type,
0076                               boost, AssignableConcept );
0077 
0078         typedef unconstrained_set_of type;
0079     };
0080 
0081     BOOST_BIMAP_GENERATE_INDEX_BINDER_FAKE
0082 
0083     BOOST_BIMAP_GENERATE_MAP_VIEW_BINDER(
0084 
0085         // binds to
0086         views::unconstrained_map_view
0087     )
0088 
0089     BOOST_BIMAP_GENERATE_SET_VIEW_BINDER(
0090 
0091         // binds to
0092         views::unconstrained_set_view
0093     )
0094 
0095     typedef mpl::bool_<true> mutable_key;
0096 };
0097 
0098 /// \brief Set Of Relation Specification
0099 /**
0100 This struct is similar to unconstrained_set_of but it is bind
0101 logically to a relation. It is used in the bimap instantiation to
0102 specify the desired type of the main view.
0103 
0104 See also unconstrained_set_of, is_set_type_of_relation.
0105                                                                 **/
0106 
0107 struct unconstrained_set_of_relation : public ::boost::bimaps::detail::set_type_of_relation_tag
0108 {
0109 
0110     BOOST_BIMAP_GENERATE_RELATION_BINDER_0CP(
0111 
0112         // binds to
0113         unconstrained_set_of
0114     )
0115 
0116     typedef mpl::bool_<true>  left_mutable_key;
0117     typedef mpl::bool_<true> right_mutable_key;
0118 };
0119 
0120 #ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
0121 
0122 namespace detail {
0123 
0124 template<class T>
0125 struct is_unconstrained_set_of :
0126     ::boost::mpl::false_ {};
0127 
0128 template<class T>
0129 struct is_unconstrained_set_of< unconstrained_set_of<T> > :
0130     ::boost::mpl::true_ {};
0131 
0132 } // namespace detail
0133 
0134 #endif // BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
0135 
0136 } // namespace bimaps
0137 } // namespace boost
0138 
0139 
0140 /** \struct boost::bimaps::detail::is_unconstrained_set_of
0141 \brief Trait to check if a type is unconstrained_set_of.
0142 \code
0143 template< class T >
0144 struct is_unconstrained_set_of;
0145 \endcode
0146                                                                             **/
0147 
0148 
0149 #endif // BOOST_BIMAP_UNCONSTRAINED_SET_OF_HPP
0150