range_distance_compat_test.cpp 682 B

12345678910111213141516171819202122
  1. // Copyright (C) 2018 Andrey Semashev
  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 <boost/range/distance.hpp>
  7. #include <boost/range/iterator_range_core.hpp>
  8. #include <boost/iterator/distance.hpp>
  9. int main()
  10. {
  11. // Test that boost::distance from Boost.Range works with boost::distance from Boost.Iterator
  12. // (https://github.com/boostorg/iterator/commit/b844c8df530c474ec1856870b9b0de5f487b84d4#commitcomment-30603668)
  13. typedef boost::iterator_range<const char*> range_type;
  14. range_type range;
  15. (void)boost::distance(range);
  16. return 0;
  17. }