4c02a659529ec8e153eac983f4b5a1d0b48a559f
[senf.git] / boost / bimap / tags / support / default_tagged.hpp
1 // Boost.Bimap
2 //
3 // Copyright (c) 2006-2007 Matias Capeletto
4 //
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)
8
9 /// \file tags/support/default_tagged.hpp
10 /// \brief Weak tagging
11
12 #ifndef BOOST_BIMAP_TAGS_SUPPORT_DEFAULT_TAGGED_HPP
13 #define BOOST_BIMAP_TAGS_SUPPORT_DEFAULT_TAGGED_HPP
14
15 #if defined(_MSC_VER) && (_MSC_VER>=1200)
16 #pragma once
17 #endif
18
19 #include <boost/config.hpp>
20
21 #include <boost/bimap/tags/tagged.hpp>
22
23 /** \struct boost::bimaps::tags::support::default_tagged
24 \brief Weak tagging metafunction
25
26 \code
27 template< class Type, class Tag >
28 struct default_tagged
29 {
30     typedef {TaggedType} type;
31 };
32 \endcode
33
34 If the type is not tagged, this metafunction returns a tagged type with the
35 default tag. If it is tagged, the returns the type unchanged.
36
37 See also tagged, overwrite_tagged.
38                                                                                 **/
39
40 #ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
41
42 namespace boost {
43 namespace bimaps {
44 namespace tags {
45 namespace support {
46
47
48 // Default Tagging
49 // A metafunction that create a tagged type with a default tag value.
50
51 template< class Type, class DefaultTag >
52 struct default_tagged
53 {
54     typedef tagged<Type,DefaultTag> type;
55 };
56
57 template< class Type, class OldTag, class NewTag >
58 struct default_tagged< tagged< Type, OldTag >, NewTag >
59 {
60     typedef tagged<Type,OldTag> type;
61 };
62
63 } // namespace support
64 } // namespace tags
65 } // namespace bimaps
66 } // namespace boost
67
68 #endif // BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
69
70 #endif // BOOST_BIMAP_TAGS_SUPPORT_DEFAULT_TAGGED_HPP
71
72
73