Chris@16: // Boost.Bimap Chris@16: // Chris@16: // Copyright (c) 2006-2007 Matias Capeletto Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. Chris@16: // (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: /// \file unconstrained_set_of.hpp Chris@16: /// \brief Include support for set constrains for the bimap container Chris@16: Chris@16: #ifndef BOOST_BIMAP_UNCONSTRAINED_SET_OF_HPP Chris@16: #define BOOST_BIMAP_UNCONSTRAINED_SET_OF_HPP Chris@16: Chris@101: #if defined(_MSC_VER) Chris@16: #pragma once Chris@16: #endif Chris@16: Chris@16: #include Chris@16: Chris@16: #include Chris@16: Chris@16: #include Chris@16: Chris@16: #include Chris@16: Chris@16: #include Chris@16: Chris@16: #include Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: #include Chris@16: #include Chris@16: Chris@16: namespace boost { Chris@16: namespace bimaps { Chris@16: Chris@16: /// \brief Set Type Specification Chris@16: /** Chris@16: This struct is used to specify a set specification. Chris@16: It is not a container, it is just a metaprogramming facility to Chris@16: express the type of a set. Generally, this specification will Chris@16: be used in other place to create a container. Chris@16: The first parameter is the type of the objects in the set. Chris@16: Chris@16: \code Chris@16: Chris@16: using namespace support; Chris@16: Chris@16: BOOST_STATIC_ASSERT( is_set_type_of< unconstrained_set_of >::value ) Chris@16: Chris@16: \endcode Chris@16: Chris@16: See also unconstrained_set_of_relation. Chris@16: **/ Chris@16: Chris@16: template Chris@16: < Chris@16: class KeyType Chris@16: > Chris@16: struct unconstrained_set_of : public ::boost::bimaps::detail::set_type_of_tag Chris@16: { Chris@16: /// User type, can be tagged Chris@16: typedef KeyType user_type; Chris@16: Chris@16: /// Type of the object that will be stored in the container Chris@16: typedef BOOST_DEDUCED_TYPENAME ::boost::bimaps::tags::support:: Chris@16: value_type_of::type value_type; Chris@16: Chris@16: struct lazy_concept_checked Chris@16: { Chris@16: BOOST_CLASS_REQUIRE ( value_type, Chris@16: boost, AssignableConcept ); Chris@16: Chris@16: typedef unconstrained_set_of type; Chris@16: }; Chris@16: Chris@16: BOOST_BIMAP_GENERATE_INDEX_BINDER_FAKE Chris@16: Chris@16: BOOST_BIMAP_GENERATE_MAP_VIEW_BINDER( Chris@16: Chris@16: // binds to Chris@16: views::unconstrained_map_view Chris@16: ) Chris@16: Chris@16: BOOST_BIMAP_GENERATE_SET_VIEW_BINDER( Chris@16: Chris@16: // binds to Chris@16: views::unconstrained_set_view Chris@16: ) Chris@16: Chris@16: typedef mpl::bool_ mutable_key; Chris@16: }; Chris@16: Chris@16: /// \brief Set Of Relation Specification Chris@16: /** Chris@16: This struct is similar to unconstrained_set_of but it is bind Chris@16: logically to a relation. It is used in the bimap instantiation to Chris@16: specify the desired type of the main view. Chris@16: Chris@16: See also unconstrained_set_of, is_set_type_of_relation. Chris@16: **/ Chris@16: Chris@16: struct unconstrained_set_of_relation : public ::boost::bimaps::detail::set_type_of_relation_tag Chris@16: { Chris@16: Chris@16: BOOST_BIMAP_GENERATE_RELATION_BINDER_0CP( Chris@16: Chris@16: // binds to Chris@16: unconstrained_set_of Chris@16: ) Chris@16: Chris@16: typedef mpl::bool_ left_mutable_key; Chris@16: typedef mpl::bool_ right_mutable_key; Chris@16: }; Chris@16: Chris@16: #ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES Chris@16: Chris@16: namespace detail { Chris@16: Chris@16: template Chris@16: struct is_unconstrained_set_of : Chris@16: ::boost::mpl::false_ {}; Chris@16: Chris@16: template Chris@16: struct is_unconstrained_set_of< unconstrained_set_of > : Chris@16: ::boost::mpl::true_ {}; Chris@16: Chris@16: } // namespace detail Chris@16: Chris@16: #endif // BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES Chris@16: Chris@16: } // namespace bimaps Chris@16: } // namespace boost Chris@16: Chris@16: Chris@16: /** \struct boost::bimaps::detail::is_unconstrained_set_of Chris@16: \brief Trait to check if a type is unconstrained_set_of. Chris@16: \code Chris@16: template< class T > Chris@16: struct is_unconstrained_set_of; Chris@16: \endcode Chris@16: **/ Chris@16: Chris@16: Chris@16: #endif // BOOST_BIMAP_UNCONSTRAINED_SET_OF_HPP Chris@16: