Commit | Line | Data |
---|---|---|
644af6c8 BH |
1 | Source: https://git.archlinux.org/svntogit/community.git/plain/trunk/boost-1.68.patch?h=packages/aegisub |
2 | From d8336d2fed73c72d1227b343d6acfb991bc1651b Mon Sep 17 00:00:00 2001 | |
3 | From: Jan Beich <jbeich@FreeBSD.org> | |
4 | Date: Mon, 9 Jul 2018 20:15:29 +0000 | |
5 | Subject: [PATCH] Keep using std::distance after Boost 1.68 | |
6 | ||
7 | src/search_replace_engine.cpp:256:14: error: call to | |
8 | 'distance' is ambiguous | |
9 | count += distance( | |
10 | ^~~~~~~~ | |
11 | /usr/include/c++/v1/iterator:511:1: note: candidate function [with _InputIter = | |
12 | boost::u32regex_iterator<std::__1::__wrap_iter<const char *> >] | |
13 | distance(_InputIter __first, _InputIter __last) | |
14 | ^ | |
15 | /usr/local/include/boost/iterator/distance.hpp:49:9: note: candidate function [with SinglePassIterator = | |
16 | boost::u32regex_iterator<std::__1::__wrap_iter<const char *> >] | |
17 | distance(SinglePassIterator first, SinglePassIterator last) | |
18 | ^ | |
19 | --- | |
20 | src/search_replace_engine.cpp | 2 +- | |
21 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
22 | ||
23 | diff --git a/src/search_replace_engine.cpp b/src/search_replace_engine.cpp | |
24 | index 594c21e5e..14c71680d 100644 | |
25 | --- a/src/search_replace_engine.cpp | |
26 | +++ b/src/search_replace_engine.cpp | |
27 | @@ -253,7 +253,7 @@ bool SearchReplaceEngine::ReplaceAll() { | |
28 | if (MatchState ms = matches(&diag, 0)) { | |
29 | auto& diag_field = diag.*get_dialogue_field(settings.field); | |
30 | std::string const& text = diag_field.get(); | |
31 | - count += distance( | |
32 | + count += std::distance( | |
33 | boost::u32regex_iterator<std::string::const_iterator>(begin(text), end(text), *ms.re), | |
34 | boost::u32regex_iterator<std::string::const_iterator>()); | |
35 | diag_field = u32regex_replace(text, *ms.re, settings.replace_with); |