gather_fail1.cpp 838 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. Copyright (c) Marshall Clow 2011-2012.
  3. Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. For more information, see http://www.boost.org
  6. */
  7. #include <iostream>
  8. #include <boost/config.hpp>
  9. #include <boost/algorithm/gather.hpp>
  10. #include <string>
  11. #include <vector>
  12. #include <list>
  13. #include "iterator_test.hpp"
  14. namespace ba = boost::algorithm;
  15. bool is_ten ( int i ) { return i == 10; }
  16. void test_sequence1 () {
  17. std::vector<int> v;
  18. typedef input_iterator<std::vector<int>::iterator> II;
  19. // This should fail to compile, since gather doesn't work with input iterators
  20. (void) ba::gather ( II( v.begin ()), II( v.end ()), II( v.begin ()), is_ten );
  21. }
  22. int main ()
  23. {
  24. test_sequence1 ();
  25. return 0;
  26. }