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 is_character_type.hpp 9 * \author Andrey Semashev 10 * \date 25.07.2015 11 * 12 * The header defines \c is_character_type trait which checks if the type is one of the character types 13 */ 14 15 #ifndef BOOST_LOG_DETAIL_IS_CHARACTER_TYPE_HPP_INCLUDED_ 16 #define BOOST_LOG_DETAIL_IS_CHARACTER_TYPE_HPP_INCLUDED_ 17 18 #include <boost/log/detail/config.hpp> 19 #include <boost/log/detail/header.hpp> 20 21 #ifdef BOOST_HAS_PRAGMA_ONCE 22 #pragma once 23 #endif 24 25 namespace boost { 26 27 BOOST_LOG_OPEN_NAMESPACE 28 29 namespace aux { 30 31 template< typename T > 32 struct is_character_type 33 { 34 static BOOST_CONSTEXPR_OR_CONST bool value = false; 35 }; 36 37 template< > 38 struct is_character_type< char > 39 { 40 static BOOST_CONSTEXPR_OR_CONST bool value = true; 41 }; 42 43 template< > 44 struct is_character_type< wchar_t > 45 { 46 static BOOST_CONSTEXPR_OR_CONST bool value = true; 47 }; 48 49 #if !defined(BOOST_NO_CXX11_CHAR16_T) 50 template< > 51 struct is_character_type< char16_t > 52 { 53 static BOOST_CONSTEXPR_OR_CONST bool value = true; 54 }; 55 #endif 56 57 #if !defined(BOOST_NO_CXX11_CHAR32_T) 58 template< > 59 struct is_character_type< char32_t > 60 { 61 static BOOST_CONSTEXPR_OR_CONST bool value = true; 62 }; 63 #endif 64 65 } // namespace aux 66 67 BOOST_LOG_CLOSE_NAMESPACE // namespace log 68 69 } // namespace boost 70 71 #include <boost/log/detail/footer.hpp> 72 73 #endif // BOOST_LOG_DETAIL_IS_CHARACTER_TYPE_HPP_INCLUDED_ 74