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 tags/support/tag_of.hpp
10 /// \brief Safe way to access the tag of a type
12 #ifndef BOOST_BIMAP_TAGS_SUPPORT_TAG_OF_HPP
13 #define BOOST_BIMAP_TAGS_SUPPORT_TAG_OF_HPP
19 #include <boost/config.hpp>
21 #include <boost/bimap/tags/tagged.hpp>
22 #include <boost/bimap/detail/debug/static_error.hpp>
24 /** \struct boost::bimaps::tags::support::tag_of
25 \brief Metafunction to obtain the tag of a type.
28 template< class TaggedType >
35 If the type is not tagged you will get a compile timer error with the following message:
38 USING_TAG_OF_WITH_AN_UNTAGGED_TYPE, TaggedType
41 See also tagged, value_type_of.
44 #ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
52 // tag_of metafunction
54 template< class Type >
57 BOOST_BIMAP_STATIC_ERROR( USING_TAG_OF_WITH_AN_UNTAGGED_TYPE, (Type) );
60 template< class Type, class Tag >
61 struct tag_of< tagged< Type, Tag > >
67 } // namespace support
72 #endif // BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
74 #endif // BOOST_BIMAP_TAGS_SUPPORT_TAG_OF_HPP