is_character_type.hpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. #ifndef BOOST_LOG_DETAIL_IS_CHARACTER_TYPE_HPP_INCLUDED_
  15. #define BOOST_LOG_DETAIL_IS_CHARACTER_TYPE_HPP_INCLUDED_
  16. #include <boost/log/detail/config.hpp>
  17. #include <boost/log/detail/header.hpp>
  18. #ifdef BOOST_HAS_PRAGMA_ONCE
  19. #pragma once
  20. #endif
  21. namespace boost {
  22. BOOST_LOG_OPEN_NAMESPACE
  23. namespace aux {
  24. template< typename T >
  25. struct is_character_type
  26. {
  27. static BOOST_CONSTEXPR_OR_CONST bool value = false;
  28. };
  29. template< >
  30. struct is_character_type< char >
  31. {
  32. static BOOST_CONSTEXPR_OR_CONST bool value = true;
  33. };
  34. template< >
  35. struct is_character_type< wchar_t >
  36. {
  37. static BOOST_CONSTEXPR_OR_CONST bool value = true;
  38. };
  39. #if !defined(BOOST_NO_CXX11_CHAR16_T)
  40. template< >
  41. struct is_character_type< char16_t >
  42. {
  43. static BOOST_CONSTEXPR_OR_CONST bool value = true;
  44. };
  45. #endif
  46. #if !defined(BOOST_NO_CXX11_CHAR32_T)
  47. template< >
  48. struct is_character_type< char32_t >
  49. {
  50. static BOOST_CONSTEXPR_OR_CONST bool value = true;
  51. };
  52. #endif
  53. } // namespace aux
  54. BOOST_LOG_CLOSE_NAMESPACE // namespace log
  55. } // namespace boost
  56. #include <boost/log/detail/footer.hpp>
  57. #endif // BOOST_LOG_DETAIL_IS_CHARACTER_TYPE_HPP_INCLUDED_