in.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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_IN_05042005_0120)
  9. #define BOOST_IN_05042005_0120
  10. #include <boost/fusion/support/config.hpp>
  11. #include <istream>
  12. #include <boost/fusion/sequence/io/detail/in.hpp>
  13. #include <boost/fusion/support/is_sequence.hpp>
  14. namespace boost { namespace fusion
  15. {
  16. template <typename Sequence>
  17. inline std::istream&
  18. in(std::istream& is, Sequence& seq)
  19. {
  20. detail::read_sequence(is, seq);
  21. return is;
  22. }
  23. namespace operators
  24. {
  25. template <typename Sequence>
  26. inline typename
  27. boost::enable_if<
  28. fusion::traits::is_sequence<Sequence>
  29. , std::istream&
  30. >::type
  31. operator>>(std::istream& is, Sequence& seq)
  32. {
  33. return fusion::in(is, seq);
  34. }
  35. }
  36. using operators::operator>>;
  37. }}
  38. #endif