make adaptors::tokenized compatible with boost 1.54

This commit is contained in:
Michael Krasnyk 2017-03-28 21:26:06 +02:00 committed by Patrick Niklaus
parent dac929f8df
commit ac6f07a744
2 changed files with 7 additions and 1 deletions

View File

@ -19,6 +19,12 @@ Feature: osrm-partition command line options: invalid options
And stderr should contain "fly-me-to-the-moon" And stderr should contain "fly-me-to-the-moon"
And it should exit with an error And it should exit with an error
Scenario: osrm-partition - Check invalid values
When I try to run "osrm-partition --max-cell-sizes 4,6@4,16 fly-me-to-the-moon.osrm"
Then stdout should be empty
And stderr should contain "is invalid"
And it should exit with an error
Scenario: osrm-partition - Check non-descending order Scenario: osrm-partition - Check non-descending order
When I try to run "osrm-partition --max-cell-sizes 4,64,16 fly-me-to-the-moon.osrm" When I try to run "osrm-partition --max-cell-sizes 4,64,16 fly-me-to-the-moon.osrm"
Then stdout should be empty Then stdout should be empty

View File

@ -51,7 +51,7 @@ void validate(boost::any &v, const std::vector<std::string> &values, MaxCellSize
const std::string &s = validators::get_single_string(values); const std::string &s = validators::get_single_string(values);
std::vector<size_t> output; std::vector<size_t> output;
boost::copy(s | tokenized(boost::regex(","), -1) | transformed([](const auto &x) { boost::copy(s | tokenized(boost::regex("[^,]+")) | transformed([](const auto &x) {
try try
{ {
return boost::lexical_cast<std::size_t>(x); return boost::lexical_cast<std::size_t>(x);