1 // (C) Copyright Gennadiy Rozental 2001.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 // See http://www.boost.org/libs/test for the library home page.
10 // Version : $Revision$
12 // Description : simple helpers for creating cusom output manipulators
13 // ***************************************************************************
15 #ifndef BOOST_TEST_UTILS_CUSTOM_MANIP_HPP
16 #define BOOST_TEST_UTILS_CUSTOM_MANIP_HPP
21 #include <boost/test/detail/suppress_warnings.hpp>
23 //____________________________________________________________________________//
29 // ************************************************************************** //
30 // ************** custom manipulators helpers ************** //
31 // ************************************************************************** //
33 template<typename Manip>
34 struct custom_printer {
35 explicit custom_printer( std::ostream& ostr ) : m_ostr( &ostr ) {}
37 std::ostream& operator*() const { return *m_ostr; }
40 std::ostream* const m_ostr;
43 //____________________________________________________________________________//
45 template<typename Uniq> struct custom_manip {};
47 //____________________________________________________________________________//
49 template<typename Uniq>
50 inline custom_printer<custom_manip<Uniq> >
51 operator<<( std::ostream& ostr, custom_manip<Uniq> const& ) { return custom_printer<custom_manip<Uniq> >( ostr ); }
53 //____________________________________________________________________________//
56 } // namespace unit_test
59 #include <boost/test/detail/enable_warnings.hpp>
61 #endif // BOOST_TEST_UTILS_CUSTOM_MANIP_HPP