GCC fixes for MapProvider iterator

This commit is contained in:
Dan Paulat 2023-04-30 18:38:48 -05:00
parent 98ab8904be
commit 1c1864e45d
3 changed files with 24 additions and 20 deletions

View file

@ -41,15 +41,21 @@ public:
mapProvider_.SetValidator(
[](const std::string& value)
{
return std::find_if(map::MapProviderIterator().begin(),
map::MapProviderIterator().end(),
[&value](map::MapProvider mapProvider)
{
std::string mapProviderName =
map::GetMapProviderName(mapProvider);
boost::to_lower(mapProviderName);
return value == mapProviderName;
}) != map::MapProviderIterator().end();
for (map::MapProvider mapProvider : map::MapProviderIterator())
{
// If the value is equal to a lower case map provider name
std::string mapProviderName =
map::GetMapProviderName(mapProvider);
boost::to_lower(mapProviderName);
if (value == mapProviderName)
{
// Regard as a match, valid
return true;
}
}
// No match found, invalid
return false;
});
mapboxApiKey_.SetValidator([](const std::string& value)
{ return !value.empty(); });