]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/log/include/boost/log/detail/deduce_char_type.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / log / include / boost / log / detail / deduce_char_type.hpp
CommitLineData
7c673cae
FG
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
26namespace boost {
27
28BOOST_LOG_OPEN_NAMESPACE
29
30namespace aux {
31
32template< typename T >
33struct deduced_char_type;
34
35template< >
36struct deduced_char_type< char >
37{
38 typedef char type;
39};
40
41template< >
42struct deduced_char_type< const char >
43{
44 typedef char type;
45};
46
47template< >
48struct deduced_char_type< wchar_t >
49{
50 typedef wchar_t type;
51};
52
53template< >
54struct deduced_char_type< const wchar_t >
55{
56 typedef wchar_t type;
57};
58
59//! Auxiliary traits to detect character type from a string
60template< typename RangeT >
61struct deduce_char_type :
62 public deduced_char_type< typename RangeT::value_type >
63{
64};
65
66template< typename T >
67struct deduce_char_type< T* > :
68 public deduced_char_type< T >
69{
70};
71
72template< typename T >
73struct deduce_char_type< T* const > :
74 public deduced_char_type< T >
75{
76};
77
78template< typename T, unsigned int CountV >
79struct deduce_char_type< T[CountV] > :
80 public deduced_char_type< T >
81{
82};
83
84template< typename T >
85struct deduce_char_type< T& > :
86 public deduce_char_type< T >
87{
88};
89
90#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
91
92template< typename T >
93struct deduce_char_type< T&& > :
94 public deduce_char_type< T >
95{
96};
97
98#endif
99
100} // namespace aux
101
102BOOST_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_