From 35d0ef2e2cdb9d4fa5e4e4535026f826636d1e4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 9 Apr 2014 18:18:51 +0200 Subject: [PATCH] GCC 4.4 compatibility: no lambdas. The fugly lambda probably wasn't good idea anyway. So much ugly stuff just to avoid having mutable variable doesn't cut it. --- src/MagnumPlugins/ObjImporter/ObjImporter.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/MagnumPlugins/ObjImporter/ObjImporter.cpp b/src/MagnumPlugins/ObjImporter/ObjImporter.cpp index b511dd5dc..ad01143db 100644 --- a/src/MagnumPlugins/ObjImporter/ObjImporter.cpp +++ b/src/MagnumPlugins/ObjImporter/ObjImporter.cpp @@ -371,15 +371,16 @@ std::optional ObjImporter::doMesh3D(UnsignedInt id) { } /* Ignore unsupported keywords, error out on unknown keywords */ - } else if(![&keyword](){ - /* Using lambda to emulate for-else construct like in Python */ + } else { + bool valid = false; const std::initializer_list expected{"mtllib", "usemtl", "g", "s"}; for(auto it = expected.begin(); it != expected.end(); ++it) - if(keyword == *it) return true; - return false; - }()) { - Error() << "Trade::ObjImporter::mesh3D(): unknown keyword" << keyword; - return std::nullopt; + if(keyword == *it) valid = true; + + if(!valid) { + Error() << "Trade::ObjImporter::mesh3D(): unknown keyword" << keyword; + return std::nullopt; + } } }} catch(std::exception) {