adl_test.cpp 667 B

12345678910111213141516171819202122232425
  1. // Copyright (C) 2017 Michel Morin.
  2. //
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // (See accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. #include <vector>
  7. #include <boost/array.hpp>
  8. #include <boost/iterator/advance.hpp>
  9. #include <boost/iterator/distance.hpp>
  10. int main()
  11. {
  12. // Test that boost::advance/distance are not found by ADL.
  13. // (https://github.com/boostorg/iterator/issues/43)
  14. typedef boost::array<int, 1> boost_type;
  15. std::vector<boost_type> std_boost(2);
  16. std::vector<boost_type>::iterator it = std_boost.begin();
  17. advance(it, 2);
  18. (void)distance(it, it);
  19. return 0;
  20. }