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)
8 * \file embedded_string_type.hpp
9 * \author Andrey Semashev
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.
16 #ifndef BOOST_LOG_DETAIL_EMBEDDED_STRING_TYPE_HPP_INCLUDED_
17 #define BOOST_LOG_DETAIL_EMBEDDED_STRING_TYPE_HPP_INCLUDED_
20 #include <boost/type_traits/remove_cv.hpp>
21 #include <boost/log/detail/config.hpp>
22 #include <boost/log/detail/header.hpp>
24 #ifdef BOOST_HAS_PRAGMA_ONCE
30 BOOST_LOG_OPEN_NAMESPACE
34 template< typename T, typename ArgT >
35 struct make_embedded_string_type_impl
40 template< typename ArgT >
41 struct make_embedded_string_type_impl< char, ArgT >
43 typedef std::basic_string< char > type;
46 template< typename ArgT >
47 struct make_embedded_string_type_impl< const char, ArgT >
49 typedef std::basic_string< char > type;
52 template< typename ArgT >
53 struct make_embedded_string_type_impl< wchar_t, ArgT >
55 typedef std::basic_string< wchar_t > type;
58 template< typename ArgT >
59 struct make_embedded_string_type_impl< const wchar_t, ArgT >
61 typedef std::basic_string< wchar_t > type;
64 #if !defined(BOOST_NO_CXX11_CHAR16_T)
65 template< typename ArgT >
66 struct make_embedded_string_type_impl< char16_t, ArgT >
68 typedef std::basic_string< char16_t > type;
71 template< typename ArgT >
72 struct make_embedded_string_type_impl< const char16_t, ArgT >
74 typedef std::basic_string< char16_t > type;
78 #if !defined(BOOST_NO_CXX11_CHAR32_T)
79 template< typename ArgT >
80 struct make_embedded_string_type_impl< char32_t, ArgT >
82 typedef std::basic_string< char32_t > type;
85 template< typename ArgT >
86 struct make_embedded_string_type_impl< const char32_t, ArgT >
88 typedef std::basic_string< char32_t > type;
92 //! An auxiliary type translator to store strings by value in function objects and attribute values
93 template< typename ArgT >
94 struct make_embedded_string_type :
95 public remove_cv< ArgT >
99 template< typename ArgT >
100 struct make_embedded_string_type< ArgT* > :
101 public make_embedded_string_type_impl< ArgT, ArgT* >
105 template< typename ArgT, unsigned int CountV >
106 struct make_embedded_string_type< ArgT[CountV] > :
107 public make_embedded_string_type_impl< ArgT, ArgT[CountV] >
111 template< typename ArgT, unsigned int CountV >
112 struct make_embedded_string_type< ArgT(&)[CountV] > :
113 public make_embedded_string_type_impl< ArgT, ArgT(&)[CountV] >
119 BOOST_LOG_CLOSE_NAMESPACE // namespace log
123 #include <boost/log/detail/footer.hpp>
125 #endif // BOOST_LOG_DETAIL_EMBEDDED_STRING_TYPE_HPP_INCLUDED_