123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- #ifndef BOOST_BEAST_WRITE_OSTREAM_HPP
- #define BOOST_BEAST_WRITE_OSTREAM_HPP
- #include <boost/beast/core/detail/config.hpp>
- #include <boost/beast/core/detail/ostream.hpp>
- #include <type_traits>
- #include <streambuf>
- #include <utility>
- #ifdef BOOST_BEAST_ALLOW_DEPRECATED
- #include <boost/beast/core/make_printable.hpp>
- #endif
- namespace boost {
- namespace beast {
- template<class DynamicBuffer>
- #if BOOST_BEAST_DOXYGEN
- __implementation_defined__
- #else
- detail::ostream_helper<
- DynamicBuffer, char, std::char_traits<char>,
- detail::basic_streambuf_movable::value>
- #endif
- ostream(DynamicBuffer& buffer)
- {
- static_assert(
- net::is_dynamic_buffer<DynamicBuffer>::value,
- "DynamicBuffer type requirements not met");
- return detail::ostream_helper<
- DynamicBuffer, char, std::char_traits<char>,
- detail::basic_streambuf_movable::value>{buffer};
- }
- #ifdef BOOST_BEAST_ALLOW_DEPRECATED
- template<class T>
- detail::make_printable_adaptor<T>
- buffers(T const& t)
- {
- return make_printable(t);
- }
- #else
- template<class T>
- void buffers(T const&)
- {
- static_assert(sizeof(T) == 0,
- "The function buffers() is deprecated, use make_printable() instead, "
- "or define BOOST_BEAST_ALLOW_DEPRECATED to silence this error.");
- }
- #endif
- }
- }
- #endif
|