]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/log/include/boost/log/detail/deduce_char_type.hpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / log / include / boost / log / detail / deduce_char_type.hpp
1 /*
2 * Copyright Andrey Semashev 2007 - 2015.
3 * Distributed under the Boost Software License, Version 1.0.
4 * (See accompanying file LICENSE_1_0.txt or copy at
5 * http://www.boost.org/LICENSE_1_0.txt)
6 */
7 /*!
8 * \file deduce_char_type.hpp
9 * \author Andrey Semashev
10 * \date 17.11.2012
11 *
12 * \brief This header is the Boost.Log library implementation, see the library documentation
13 * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html.
14 */
15
16 #ifndef BOOST_LOG_DETAIL_DEDUCE_CHAR_TYPE_HPP_INCLUDED_
17 #define BOOST_LOG_DETAIL_DEDUCE_CHAR_TYPE_HPP_INCLUDED_
18
19 #include <boost/log/detail/config.hpp>
20 #include <boost/log/detail/header.hpp>
21
22 #ifdef BOOST_HAS_PRAGMA_ONCE
23 #pragma once
24 #endif
25
26 namespace boost {
27
28 BOOST_LOG_OPEN_NAMESPACE
29
30 namespace aux {
31
32 template< typename T >
33 struct deduced_char_type;
34
35 template< >
36 struct deduced_char_type< char >
37 {
38 typedef char type;
39 };
40
41 template< >
42 struct deduced_char_type< const char >
43 {
44 typedef char type;
45 };
46
47 template< >
48 struct deduced_char_type< wchar_t >
49 {
50 typedef wchar_t type;
51 };
52
53 template< >
54 struct deduced_char_type< const wchar_t >
55 {
56 typedef wchar_t type;
57 };
58
59 //! Auxiliary traits to detect character type from a string
60 template< typename RangeT >
61 struct deduce_char_type :
62 public deduced_char_type< typename RangeT::value_type >
63 {
64 };
65
66 template< typename T >
67 struct deduce_char_type< T* > :
68 public deduced_char_type< T >
69 {
70 };
71
72 template< typename T >
73 struct deduce_char_type< T* const > :
74 public deduced_char_type< T >
75 {
76 };
77
78 template< typename T, unsigned int CountV >
79 struct deduce_char_type< T[CountV] > :
80 public deduced_char_type< T >
81 {
82 };
83
84 template< typename T >
85 struct deduce_char_type< T& > :
86 public deduce_char_type< T >
87 {
88 };
89
90 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
91
92 template< typename T >
93 struct deduce_char_type< T&& > :
94 public deduce_char_type< T >
95 {
96 };
97
98 #endif
99
100 } // namespace aux
101
102 BOOST_LOG_CLOSE_NAMESPACE // namespace log
103
104 } // namespace boost
105
106 #include <boost/log/detail/footer.hpp>
107
108 #endif // BOOST_LOG_DETAIL_DEDUCE_CHAR_TYPE_HPP_INCLUDED_