diff --git a/include/boost/regex/v3/regex_match.hpp b/include/boost/regex/v3/regex_match.hpp index fa819ef8..5a8dcbe0 100644 --- a/include/boost/regex/v3/regex_match.hpp +++ b/include/boost/regex/v3/regex_match.hpp @@ -213,7 +213,11 @@ public: } void estimate_max_state_count(iterator a, iterator b, std::size_t states, std::random_access_iterator_tag*) { +#ifndef BOOST_NO_STD_DISTANCE difference_type dist = std::distance(a,b); +#else + difference_type dist = b - a; +#endif states *= states; difference_type lim = std::numeric_limits::max() - 1000 - states; if(dist > (difference_type)(lim / states))