]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/bimap/include/boost/bimap/tags/support/value_type_of.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / bimap / include / boost / bimap / tags / support / value_type_of.hpp
CommitLineData
7c673cae
FG
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/value_type_of.hpp
10/// \brief Consistent way to access the value type of a tagged or untagged type.
11
12#ifndef BOOST_BIMAP_TAGS_SUPPORT_VALUE_TYPE_OF_HPP
13#define BOOST_BIMAP_TAGS_SUPPORT_VALUE_TYPE_OF_HPP
14
15#if defined(_MSC_VER)
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::value_type_of
24\brief Metafunction to work with tagged and untagged type uniformly
25
26\code
27template< class Type >
28struct value_type_of
29{
30 typedef {UntaggedType} type;
31};
32\endcode
33
34If the type is tagged this metafunction returns Type::value_type, and if it is not
35tagged it return the same type. This allows to work consistenly with tagged and
36untagged types.
37
38See also tagged, tag_of.
39 **/
40
41#ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
42
43
44namespace boost {
45namespace bimaps {
46namespace tags {
47namespace support {
48
49
50// value_type_of metafunction
51
52template< class Type >
53struct value_type_of
54{
55 typedef Type type;
56};
57
58template< class Type, class Tag >
59struct value_type_of< tagged< Type, Tag > >
60{
61 typedef Type type;
62};
63
64
65} // namespace support
66} // namespace tags
67} // namespace bimaps
68} // namespace boost
69
70#endif // BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
71
72#endif // BOOST_BIMAP_TAGS_SUPPORT_VALUE_TYPE_OF_HPP
73
74