]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/log/include/boost/log/detail/embedded_string_type.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / log / include / boost / log / detail / embedded_string_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 embedded_string_type.hpp
9 * \author Andrey Semashev
10 * \date 16.08.2009
11 *
12 * 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_EMBEDDED_STRING_TYPE_HPP_INCLUDED_
17#define BOOST_LOG_DETAIL_EMBEDDED_STRING_TYPE_HPP_INCLUDED_
18
19#include <string>
20#include <boost/type_traits/remove_cv.hpp>
21#include <boost/log/detail/config.hpp>
22#include <boost/log/detail/header.hpp>
23
24#ifdef BOOST_HAS_PRAGMA_ONCE
25#pragma once
26#endif
27
28namespace boost {
29
30BOOST_LOG_OPEN_NAMESPACE
31
32namespace aux {
33
34template< typename T, typename ArgT >
35struct make_embedded_string_type_impl
36{
37 typedef ArgT type;
38};
39
40template< typename ArgT >
41struct make_embedded_string_type_impl< char, ArgT >
42{
43 typedef std::basic_string< char > type;
44};
45
46template< typename ArgT >
47struct make_embedded_string_type_impl< const char, ArgT >
48{
49 typedef std::basic_string< char > type;
50};
51
52template< typename ArgT >
53struct make_embedded_string_type_impl< wchar_t, ArgT >
54{
55 typedef std::basic_string< wchar_t > type;
56};
57
58template< typename ArgT >
59struct make_embedded_string_type_impl< const wchar_t, ArgT >
60{
61 typedef std::basic_string< wchar_t > type;
62};
63
64#if !defined(BOOST_NO_CXX11_CHAR16_T)
65template< typename ArgT >
66struct make_embedded_string_type_impl< char16_t, ArgT >
67{
68 typedef std::basic_string< char16_t > type;
69};
70
71template< typename ArgT >
72struct make_embedded_string_type_impl< const char16_t, ArgT >
73{
74 typedef std::basic_string< char16_t > type;
75};
76#endif
77
78#if !defined(BOOST_NO_CXX11_CHAR32_T)
79template< typename ArgT >
80struct make_embedded_string_type_impl< char32_t, ArgT >
81{
82 typedef std::basic_string< char32_t > type;
83};
84
85template< typename ArgT >
86struct make_embedded_string_type_impl< const char32_t, ArgT >
87{
88 typedef std::basic_string< char32_t > type;
89};
90#endif
91
92//! An auxiliary type translator to store strings by value in function objects and attribute values
93template< typename ArgT >
94struct make_embedded_string_type :
95 public remove_cv< ArgT >
96{
97};
98
99template< typename ArgT >
100struct make_embedded_string_type< ArgT* > :
101 public make_embedded_string_type_impl< ArgT, ArgT* >
102{
103};
104
105template< typename ArgT, unsigned int CountV >
106struct make_embedded_string_type< ArgT[CountV] > :
107 public make_embedded_string_type_impl< ArgT, ArgT[CountV] >
108{
109};
110
111template< typename ArgT, unsigned int CountV >
112struct make_embedded_string_type< ArgT(&)[CountV] > :
113 public make_embedded_string_type_impl< ArgT, ArgT(&)[CountV] >
114{
115};
116
117} // namespace aux
118
119BOOST_LOG_CLOSE_NAMESPACE // namespace log
120
121} // namespace boost
122
123#include <boost/log/detail/footer.hpp>
124
125#endif // BOOST_LOG_DETAIL_EMBEDDED_STRING_TYPE_HPP_INCLUDED_