source: fix compilation with Boost 1.71.0 beta 1

Due to argument-dependent lookup rules the `boost::algorithm::split`
function has always been considered by the compiler when resolving an
unqualified call to `split`.

Before Boost 1.71.0 the `boost::algorithm::split` function took an
lvalue reference as its `Input` argument. Therefore a temporary
instance of `std::string` would cause `boost::algorithm::split` not to
be considered due to SFINAE, and the compiler would keep looking,
finally finding the top-level `split` function.

In Boost 1.71.0 the first argument was changed to an rvalue
reference. Therefore the temporary `std::string` instance is now a
valid argument to the function, and the compiler considers
`boost::algorithm::split` to be a possible call. Other functions
aren't looked up.

The fix is easy: just be explicit which namespace to take the symbol
from. That way argument-dependent lookup will not be done.

Fixes #2599.
This commit is contained in:
Moritz Bunkus 2019-08-08 17:49:24 +02:00
parent 39f7b45d9f
commit 02a074b61f
No known key found for this signature in database
GPG Key ID: 74AF00ADF2E32C85
2 changed files with 5 additions and 1 deletions

View File

@ -5,6 +5,10 @@
* mkvmerge: mkvmerge now allows appending AV1, VP8, VP9, h.264/AVC and
h.265/HEVC tracks whose pixel dimensions differ. Implements #2582.
## Bug fixes
* source code: fixed building with Boost 1.71.0. Fixes #2599.
# Version 35.0.0 "All The Love In The World" 2019-06-22

View File

@ -29,7 +29,7 @@ inline std::vector<std::string>
split(std::string const &text,
std::string const &pattern = ",",
size_t max = 0) {
return split(text, boost::regex("\\Q"s + pattern, boost::regex::perl), max);
return ::split(text, boost::regex("\\Q"s + pattern, boost::regex::perl), max);
}
void strip(std::string &s, bool newlines = false);