out.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 <boost/fusion/support/config.hpp>
  11. #include <ostream>
  12. #include <boost/fusion/sequence/io/detail/out.hpp>
  13. #include <boost/fusion/support/is_sequence.hpp>
  14. #include <boost/utility/enable_if.hpp>
  15. #include <boost/mpl/or.hpp>
  16. namespace boost { namespace fusion
  17. {
  18. template <typename Sequence>
  19. inline std::ostream&
  20. out(std::ostream& os, Sequence& seq)
  21. {
  22. detail::print_sequence(os, seq);
  23. return os;
  24. }
  25. namespace operators
  26. {
  27. template <typename Sequence>
  28. inline typename
  29. boost::enable_if<
  30. fusion::traits::is_sequence<Sequence>
  31. , std::ostream&
  32. >::type
  33. operator<<(std::ostream& os, Sequence const& seq)
  34. {
  35. return fusion::out(os, seq);
  36. }
  37. }
  38. using operators::operator<<;
  39. }}
  40. #endif