is_ostream.hpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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_ostream.hpp
  9. * \author Andrey Semashev
  10. * \date 05.07.2015
  11. *
  12. * \brief 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. In this file
  14. * internal configuration macros are defined.
  15. */
  16. #ifndef BOOST_LOG_DETAIL_IS_OSTREAM_HPP_INCLUDED_
  17. #define BOOST_LOG_DETAIL_IS_OSTREAM_HPP_INCLUDED_
  18. #include <iosfwd>
  19. #include <boost/type_traits/is_base_of.hpp>
  20. #include <boost/type_traits/has_left_shift.hpp>
  21. #include <boost/log/detail/config.hpp>
  22. #include <boost/log/utility/formatting_ostream_fwd.hpp>
  23. #include <boost/log/detail/header.hpp>
  24. #ifdef BOOST_HAS_PRAGMA_ONCE
  25. #pragma once
  26. #endif
  27. namespace boost {
  28. BOOST_LOG_OPEN_NAMESPACE
  29. namespace aux {
  30. template< typename T >
  31. struct is_ostream
  32. {
  33. static BOOST_CONSTEXPR_OR_CONST bool value = is_base_of< std::ios_base, T >::value && has_left_shift< T, int >::value;
  34. };
  35. template< typename CharT, typename TraitsT, typename AllocatorT >
  36. struct is_ostream< basic_formatting_ostream< CharT, TraitsT, AllocatorT > >
  37. {
  38. static BOOST_CONSTEXPR_OR_CONST bool value = true;
  39. };
  40. } // namespace aux
  41. BOOST_LOG_CLOSE_NAMESPACE // namespace log
  42. } // namespace boost
  43. #include <boost/log/detail/footer.hpp>
  44. #endif // BOOST_LOG_DETAIL_IS_OSTREAM_HPP_INCLUDED_