From a62bb554024e5e36e93215ee7c5f8ac61e060e61 Mon Sep 17 00:00:00 2001 From: Avner Peled Date: Sat, 7 Oct 2017 21:06:16 +0300 Subject: [PATCH] Fix reference to std::swap This caused a build error on my system ``` 4.12.5-gentoo COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3/gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.3/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /var/tmp/portage/sys-devel/gcc-4.9.3/work/gcc-4.9.3/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/python --enable-languages=c,c++,java,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.9.3 p1.5, pie-0.6.4' --enable-libstdcxx-time --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-altivec --disable-fixed-point --enable-targets=all --enable-libgomp --disable-libmudflap --disable-libssp --disable-libcilkrts --enable-lto --without-cloog --enable-libsanitizer Thread model: posix gcc version 4.9.3 (Gentoo 4.9.3 p1.5, pie-0.6.4) ``` --- src/prediction/user_history_predictor.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/prediction/user_history_predictor.cc b/src/prediction/user_history_predictor.cc index b68dbbfb8..24da4dd2a 100644 --- a/src/prediction/user_history_predictor.cc +++ b/src/prediction/user_history_predictor.cc @@ -841,7 +841,7 @@ bool UserHistoryPredictor::RomanFuzzyPrefixMatch( // swap. if (i + 1 < prefix.size()) { string swapped_prefix = prefix; - swap(swapped_prefix[i], swapped_prefix[i + 1]); + std::swap(swapped_prefix[i], swapped_prefix[i + 1]); if (Util::StartsWith(str, swapped_prefix)) { return true; }