istream.cpp 712 B

12345678910111213141516171819202122232425
  1. // Range v3 library
  2. //
  3. // Copyright Eric Niebler 2014-present
  4. //
  5. // Use, modification and distribution is subject to the
  6. // Boost Software License, Version 1.0. (See accompanying
  7. // file LICENSE_1_0.txt or copy at
  8. // http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. // Project home: https://github.com/ericniebler/range-v3
  11. #include <range/v3/view/istream.hpp>
  12. #include <range/v3/view/subrange.hpp>
  13. #include <sstream>
  14. #include "../simple_test.hpp"
  15. #include "../test_utils.hpp"
  16. int main()
  17. {
  18. static const char test[] = "abcd3210";
  19. std::istringstream ss{test};
  20. ::check_equal(ranges::istream<char>(ss),
  21. ranges::make_subrange(test, test + sizeof(test) - 1));
  22. return ::test_result();
  23. }