out.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*=============================================================================
  2. Copyright (c) 1999-2003 Jaakko Jarvi
  3. Copyright (c) 1999-2003 Jeremiah Willcock
  4. Copyright (c) 2001-2011 Joel de Guzman
  5. Distributed under the Boost Software License, Version 1.0. (See accompanying
  6. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. ==============================================================================*/
  8. #if !defined(BOOST_OUT_05042005_0120)
  9. #define BOOST_OUT_05042005_0120
  10. #include <ostream>
  11. #include <boost/fusion/sequence/io/detail/out.hpp>
  12. #include <boost/fusion/support/is_sequence.hpp>
  13. #include <boost/utility/enable_if.hpp>
  14. #include <boost/mpl/or.hpp>
  15. namespace boost { namespace fusion
  16. {
  17. template <typename Sequence>
  18. inline std::ostream&
  19. out(std::ostream& os, Sequence& seq)
  20. {
  21. detail::print_sequence(os, seq);
  22. return os;
  23. }
  24. namespace operators
  25. {
  26. template <typename Sequence>
  27. inline typename
  28. boost::enable_if<
  29. fusion::traits::is_sequence<Sequence>
  30. , std::ostream&
  31. >::type
  32. operator<<(std::ostream& os, Sequence const& seq)
  33. {
  34. return fusion::out(os, seq);
  35. }
  36. }
  37. using operators::operator<<;
  38. }}
  39. #endif