is_keyword_descriptor.hpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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_keyword_descriptor.hpp
  9. * \author Andrey Semashev
  10. * \date 14.07.2012
  11. *
  12. * The header contains attribute keyword descriptor detection trait.
  13. */
  14. #ifndef BOOST_LOG_EXPRESSIONS_IS_KEYWORD_DESCRIPTOR_HPP_INCLUDED_
  15. #define BOOST_LOG_EXPRESSIONS_IS_KEYWORD_DESCRIPTOR_HPP_INCLUDED_
  16. #include <boost/mpl/bool.hpp>
  17. #include <boost/log/detail/config.hpp>
  18. #include <boost/log/detail/header.hpp>
  19. #ifdef BOOST_HAS_PRAGMA_ONCE
  20. #pragma once
  21. #endif
  22. namespace boost {
  23. BOOST_LOG_OPEN_NAMESPACE
  24. namespace expressions {
  25. /*!
  26. * Base class for keyword descriptors. All keyword descriptors must derive from this class to support the \c is_keyword_descriptor trait.
  27. */
  28. struct keyword_descriptor
  29. {
  30. #ifndef BOOST_LOG_DOXYGEN_PASS
  31. typedef void _is_boost_log_keyword_descriptor;
  32. #endif // BOOST_LOG_DOXYGEN_PASS
  33. };
  34. /*!
  35. * The metafunction detects if the type \c T is a keyword descriptor
  36. */
  37. template< typename T, typename VoidT = void >
  38. struct is_keyword_descriptor :
  39. public mpl::false_
  40. {
  41. };
  42. #ifndef BOOST_LOG_DOXYGEN_PASS
  43. template< typename T >
  44. struct is_keyword_descriptor< T, typename T::_is_boost_log_keyword_descriptor > :
  45. public mpl::true_
  46. {
  47. };
  48. #endif
  49. } // namespace expressions
  50. BOOST_LOG_CLOSE_NAMESPACE // namespace log
  51. } // namespace boost
  52. #include <boost/log/detail/footer.hpp>
  53. #endif // BOOST_LOG_EXPRESSIONS_IS_KEYWORD_DESCRIPTOR_HPP_INCLUDED_