boost_no_std_distance.ipp 670 B

12345678910111213141516171819202122232425262728293031
  1. // (C) Copyright John Maddock 2001.
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. // See http://www.boost.org/libs/config for the most recent version.
  6. // MACRO: BOOST_NO_STD_DISTANCE
  7. // TITLE: std::distance
  8. // DESCRIPTION: The platform does not have a conforming version of std::distance.
  9. #include <algorithm>
  10. #include <iterator>
  11. namespace boost_no_std_distance{
  12. int test()
  13. {
  14. const char* begin = 0;
  15. const char* end = 0;
  16. if(std::distance(begin, end)) return -1;
  17. return 0;
  18. }
  19. }