From d1ea1015a94dc46a5ceb4725706529be15b77068 Mon Sep 17 00:00:00 2001 From: Yao Chen Date: Fri, 20 May 2016 21:41:18 -0400 Subject: [PATCH] Replaced BOOSE_FOREACH with for in wrap folder. Tested the changed code locally: successful. --- wrap/Argument.cpp | 19 +++++----- wrap/Class.cpp | 23 ++++++------ wrap/Class.h | 5 ++- wrap/FullyOverloadedFunction.h | 10 +++--- wrap/GlobalFunction.cpp | 3 +- wrap/Module.cpp | 35 +++++++++---------- wrap/OverloadedFunction.h | 12 +++---- wrap/TemplateInstantiationTypedef.cpp | 3 +- wrap/TypeAttributesTable.cpp | 7 ++-- wrap/tests/expected/geometry_wrapper.cpp | 3 +- wrap/tests/expected2/geometry_wrapper.cpp | 3 +- .../testNamespaces_wrapper.cpp | 3 +- wrap/utilities.cpp | 7 ++-- 13 files changed, 61 insertions(+), 72 deletions(-) diff --git a/wrap/Argument.cpp b/wrap/Argument.cpp index 848998eb0..cde04afe0 100644 --- a/wrap/Argument.cpp +++ b/wrap/Argument.cpp @@ -18,7 +18,6 @@ #include "Argument.h" -#include #include #include @@ -40,7 +39,7 @@ Argument Argument::expandTemplate(const TemplateSubstitution& ts) const { ArgumentList ArgumentList::expandTemplate( const TemplateSubstitution& ts) const { ArgumentList instArgList; - BOOST_FOREACH(const Argument& arg, *this) { + for(const Argument& arg: *this) { Argument instArg = arg.expandTemplate(ts); instArgList.push_back(instArg); } @@ -50,7 +49,7 @@ ArgumentList ArgumentList::expandTemplate( /* ************************************************************************* */ string Argument::matlabClass(const string& delim) const { string result; - BOOST_FOREACH(const string& ns, type.namespaces()) + for(const string& ns: type.namespaces()) result += ns + delim; if (type.name() == "string" || type.name() == "unsigned char" || type.name() == "char") @@ -110,7 +109,7 @@ void Argument::proxy_check(FileWriter& proxyFile, const string& s) const { string ArgumentList::types() const { string str; bool first = true; - BOOST_FOREACH(Argument arg, *this) { + for(Argument arg: *this) { if (!first) str += ","; str += arg.type.name(); @@ -124,8 +123,8 @@ string ArgumentList::signature() const { string sig; bool cap = false; - BOOST_FOREACH(Argument arg, *this) { - BOOST_FOREACH(char ch, arg.type.name()) + for(Argument arg: *this) { + for(char ch: arg.type.name()) if (isupper(ch)) { sig += ch; //If there is a capital letter, we don't want to read it below @@ -144,7 +143,7 @@ string ArgumentList::signature() const { string ArgumentList::names() const { string str; bool first = true; - BOOST_FOREACH(Argument arg, *this) { + for(Argument arg: *this) { if (!first) str += ","; str += arg.name; @@ -155,7 +154,7 @@ string ArgumentList::names() const { /* ************************************************************************* */ bool ArgumentList::allScalar() const { - BOOST_FOREACH(Argument arg, *this) + for(Argument arg: *this) if (!arg.isScalar()) return false; return true; @@ -164,7 +163,7 @@ bool ArgumentList::allScalar() const { /* ************************************************************************* */ void ArgumentList::matlab_unwrap(FileWriter& file, int start) const { int index = start; - BOOST_FOREACH(Argument arg, *this) { + for(Argument arg: *this) { stringstream buf; buf << "in[" << index << "]"; arg.matlab_unwrap(file, buf.str()); @@ -176,7 +175,7 @@ void ArgumentList::matlab_unwrap(FileWriter& file, int start) const { void ArgumentList::emit_prototype(FileWriter& file, const string& name) const { file.oss << name << "("; bool first = true; - BOOST_FOREACH(Argument arg, *this) { + for(Argument arg: *this) { if (!first) file.oss << ", "; file.oss << arg.type.name() << " " << arg.name; diff --git a/wrap/Class.cpp b/wrap/Class.cpp index d7a3b6ee4..3a12290eb 100644 --- a/wrap/Class.cpp +++ b/wrap/Class.cpp @@ -20,7 +20,6 @@ #include "utilities.h" #include "Argument.h" -#include #include #include #include @@ -157,7 +156,7 @@ void Class::matlab_proxy(Str toolboxPath, Str wrapperName, << " function disp(obj), obj.display; end\n %DISP Calls print on the object\n"; // Methods - BOOST_FOREACH(const Methods::value_type& name_m, methods_) { + for(const Methods::value_type& name_m: methods_) { const Method& m = name_m.second; m.proxy_wrapper_fragments(proxyFile, wrapperFile, cppName, matlabQualName, matlabUniqueName, wrapperName, typeAttributes, functionNames); @@ -172,7 +171,7 @@ void Class::matlab_proxy(Str toolboxPath, Str wrapperName, proxyFile.oss << " methods(Static = true)\n"; // Static methods - BOOST_FOREACH(const StaticMethods::value_type& name_m, static_methods) { + for(const StaticMethods::value_type& name_m: static_methods) { const StaticMethod& m = name_m.second; m.proxy_wrapper_fragments(proxyFile, wrapperFile, cppName, matlabQualName, matlabUniqueName, wrapperName, typeAttributes, functionNames); @@ -301,7 +300,7 @@ Class Class::expandTemplate(const TemplateSubstitution& ts) const { vector Class::expandTemplate(Str templateArg, const vector& instantiations) const { vector result; - BOOST_FOREACH(const Qualified& instName, instantiations) { + for(const Qualified& instName: instantiations) { Qualified expandedClass = (Qualified) (*this); expandedClass.expand(instName.name()); const TemplateSubstitution ts(templateArg, instName, expandedClass); @@ -319,7 +318,7 @@ vector Class::expandTemplate(Str templateArg, vector Class::expandTemplate(Str templateArg, const vector& integers) const { vector result; - BOOST_FOREACH(int i, integers) { + for(int i: integers) { Qualified expandedClass = (Qualified) (*this); stringstream ss; ss << i; string instName = ss.str(); @@ -342,7 +341,7 @@ void Class::addMethod(bool verbose, bool is_const, Str methodName, if (tmplate.valid()) { // Create method to expand // For all values of the template argument, create a new method - BOOST_FOREACH(const Qualified& instName, tmplate.argValues()) { + for(const Qualified& instName: tmplate.argValues()) { const TemplateSubstitution ts(tmplate.argName(), instName, *this); // substitute template in arguments ArgumentList expandedArgs = argumentList.expandTemplate(ts); @@ -413,7 +412,7 @@ void Class::appendInheritedMethods(const Class& cls, if (cls.parentClass) { // Find parent - BOOST_FOREACH(const Class& parent, classes) { + for(const Class& parent: classes) { // We found a parent class for our parent, TODO improve ! if (parent.name() == cls.parentClass->name()) { methods_.insert(parent.methods_.begin(), parent.methods_.end()); @@ -426,7 +425,7 @@ void Class::appendInheritedMethods(const Class& cls, /* ************************************************************************* */ string Class::getTypedef() const { string result; - BOOST_FOREACH(Str namesp, namespaces()) { + for(Str namesp: namespaces()) { result += ("namespace " + namesp + " { "); } result += ("typedef " + typedefName + " " + name() + ";"); @@ -446,12 +445,12 @@ void Class::comment_fragment(FileWriter& proxyFile) const { if (!methods_.empty()) proxyFile.oss << "%\n%-------Methods-------\n"; - BOOST_FOREACH(const Methods::value_type& name_m, methods_) + for(const Methods::value_type& name_m: methods_) name_m.second.comment_fragment(proxyFile); if (!static_methods.empty()) proxyFile.oss << "%\n%-------Static Methods-------\n"; - BOOST_FOREACH(const StaticMethods::value_type& name_m, static_methods) + for(const StaticMethods::value_type& name_m: static_methods) name_m.second.comment_fragment(proxyFile); if (hasSerialization) { @@ -653,9 +652,9 @@ string Class::getSerializationExport() const { void Class::python_wrapper(FileWriter& wrapperFile) const { wrapperFile.oss << "class_<" << name() << ">(\"" << name() << "\")\n"; constructor.python_wrapper(wrapperFile, name()); - BOOST_FOREACH(const StaticMethod& m, static_methods | boost::adaptors::map_values) + for(const StaticMethod& m: static_methods | boost::adaptors::map_values) m.python_wrapper(wrapperFile, name()); - BOOST_FOREACH(const Method& m, methods_ | boost::adaptors::map_values) + for(const Method& m: methods_ | boost::adaptors::map_values) m.python_wrapper(wrapperFile, name()); wrapperFile.oss << ";\n\n"; } diff --git a/wrap/Class.h b/wrap/Class.h index 2f7457f06..e69c38f41 100644 --- a/wrap/Class.h +++ b/wrap/Class.h @@ -39,7 +39,6 @@ namespace bl = boost::lambda; -#include #include #include @@ -145,9 +144,9 @@ public: friend std::ostream& operator<<(std::ostream& os, const Class& cls) { os << "class " << cls.name() << "{\n"; os << cls.constructor << ";\n"; - BOOST_FOREACH(const StaticMethod& m, cls.static_methods | boost::adaptors::map_values) + for(const StaticMethod& m: cls.static_methods | boost::adaptors::map_values) os << m << ";\n"; - BOOST_FOREACH(const Method& m, cls.methods_ | boost::adaptors::map_values) + for(const Method& m: cls.methods_ | boost::adaptors::map_values) os << m << ";\n"; os << "};" << std::endl; return os; diff --git a/wrap/FullyOverloadedFunction.h b/wrap/FullyOverloadedFunction.h index 30e27764b..80d974d88 100644 --- a/wrap/FullyOverloadedFunction.h +++ b/wrap/FullyOverloadedFunction.h @@ -44,7 +44,7 @@ public: void verifyReturnTypes(const std::vector& validtypes, const std::string& s) const { - BOOST_FOREACH(const ReturnValue& retval, returnVals_) { + for(const ReturnValue& retval: returnVals_) { retval.type1.verify(validtypes, s); if (retval.isPair) retval.type2.verify(validtypes, s); @@ -55,7 +55,7 @@ public: std::vector expandReturnValuesTemplate( const TemplateSubstitution& ts) const { std::vector result; - BOOST_FOREACH(const ReturnValue& retVal, returnVals_) { + for(const ReturnValue& retVal: returnVals_) { ReturnValue instRetVal = retVal.expandTemplate(ts); result.push_back(instRetVal); } @@ -73,7 +73,7 @@ public: // emit a list of comments, one for each overload void usage_fragment(FileWriter& proxyFile, const std::string& name) const { unsigned int argLCount = 0; - BOOST_FOREACH(ArgumentList argList, argLists_) { + for(ArgumentList argList: argLists_) { argList.emit_prototype(proxyFile, name); if (argLCount != nrOverloads() - 1) proxyFile.oss << ", "; @@ -87,7 +87,7 @@ public: // emit a list of comments, one for each overload void comment_fragment(FileWriter& proxyFile, const std::string& name) const { size_t i = 0; - BOOST_FOREACH(ArgumentList argList, argLists_) { + for(ArgumentList argList: argLists_) { proxyFile.oss << "%"; argList.emit_prototype(proxyFile, name); proxyFile.oss << " : returns " << returnVals_[i++].return_type(false) @@ -125,7 +125,7 @@ template inline void verifyReturnTypes(const std::vector& validTypes, const std::map& vt) { typedef typename std::map::value_type NamedMethod; - BOOST_FOREACH(const NamedMethod& namedMethod, vt) + for(const NamedMethod& namedMethod: vt) namedMethod.second.verifyReturnTypes(validTypes); } diff --git a/wrap/GlobalFunction.cpp b/wrap/GlobalFunction.cpp index 013ef6d28..3f667e2c9 100644 --- a/wrap/GlobalFunction.cpp +++ b/wrap/GlobalFunction.cpp @@ -8,7 +8,6 @@ #include "GlobalFunction.h" #include "utilities.h" -#include #include namespace wrap { @@ -44,7 +43,7 @@ void GlobalFunction::matlab_proxy(const string& toolboxPath, } size_t lastcheck = grouped_functions.size(); - BOOST_FOREACH(const GlobalFunctionMap::value_type& p, grouped_functions) { + for(const GlobalFunctionMap::value_type& p: grouped_functions) { p.second.generateSingleFunction(toolboxPath, wrapperName, typeAttributes, file, functionNames); if (--lastcheck != 0) diff --git a/wrap/Module.cpp b/wrap/Module.cpp index 9d505a525..abf9a2a02 100644 --- a/wrap/Module.cpp +++ b/wrap/Module.cpp @@ -22,7 +22,6 @@ #include "TypeAttributesTable.h" #include "utilities.h" -#include #include #include @@ -58,7 +57,7 @@ static void handle_possible_template(vector& classes, const Class& cls, vector classInstantiations = (t.nrValues() > 0) ? cls.expandTemplate(arg, t.argValues()) : cls.expandTemplate(arg, t.intList()); - BOOST_FOREACH(const Class& c, classInstantiations) + for(const Class& c: classInstantiations) classes.push_back(c); } } @@ -177,11 +176,11 @@ void Module::parseMarkup(const std::string& data) { } // Post-process classes for serialization markers - BOOST_FOREACH(Class& cls, classes) + for(Class& cls: classes) cls.erase_serialization(); // Explicitly add methods to the classes from parents so it shows in documentation - BOOST_FOREACH(Class& cls, classes) + for(Class& cls: classes) cls.appendInheritedMethods(cls, classes); // Expand templates - This is done first so that template instantiations are @@ -199,7 +198,7 @@ void Module::parseMarkup(const std::string& data) { verifyReturnTypes(validTypes, global_functions); hasSerialiable = false; - BOOST_FOREACH(const Class& cls, expandedClasses) + for(const Class& cls: expandedClasses) cls.verifyAll(validTypes,hasSerialiable); // Create type attributes table and check validity @@ -239,14 +238,14 @@ void Module::matlab_code(const string& toolboxPath) const { // create typedef classes - we put this at the top of the wrap file so that // collectors and method arguments can use these typedefs - BOOST_FOREACH(const Class& cls, expandedClasses) + for(const Class& cls: expandedClasses) if(!cls.typedefName.empty()) wrapperFile.oss << cls.getTypedef() << "\n"; wrapperFile.oss << "\n"; // Generate boost.serialization export flags (needs typedefs from above) if (hasSerialiable) { - BOOST_FOREACH(const Class& cls, expandedClasses) + for(const Class& cls: expandedClasses) if(cls.isSerializable) wrapperFile.oss << cls.getSerializationExport() << "\n"; wrapperFile.oss << "\n"; @@ -261,11 +260,11 @@ void Module::matlab_code(const string& toolboxPath) const { vector functionNames; // Function names stored by index for switch // create proxy class and wrapper code - BOOST_FOREACH(const Class& cls, expandedClasses) + for(const Class& cls: expandedClasses) cls.matlab_proxy(toolboxPath, wrapperName, typeAttributes, wrapperFile, functionNames); // create matlab files and wrapper code for global functions - BOOST_FOREACH(const GlobalFunctions::value_type& p, global_functions) + for(const GlobalFunctions::value_type& p: global_functions) p.second.matlab_proxy(toolboxPath, wrapperName, typeAttributes, wrapperFile, functionNames); // finish wrapper file @@ -321,7 +320,7 @@ vector Module::ExpandTypedefInstantiations(const vector& classes, vector expandedClasses = classes; - BOOST_FOREACH(const TemplateInstantiationTypedef& inst, instantiations) { + for(const TemplateInstantiationTypedef& inst: instantiations) { // Add the new class to the list expandedClasses.push_back(inst.findAndExpand(classes)); } @@ -339,7 +338,7 @@ vector Module::ExpandTypedefInstantiations(const vector& classes, /* ************************************************************************* */ vector Module::GenerateValidTypes(const vector& classes, const vector forwardDeclarations) { vector validTypes; - BOOST_FOREACH(const ForwardDeclaration& fwDec, forwardDeclarations) { + for(const ForwardDeclaration& fwDec: forwardDeclarations) { validTypes.push_back(fwDec.name); } validTypes.push_back("void"); @@ -353,7 +352,7 @@ vector Module::GenerateValidTypes(const vector& classes, const ve validTypes.push_back("Vector"); validTypes.push_back("Matrix"); //Create a list of parsed classes for dependency checking - BOOST_FOREACH(const Class& cls, classes) { + for(const Class& cls: classes) { validTypes.push_back(cls.qualifiedName("::")); } @@ -363,7 +362,7 @@ vector Module::GenerateValidTypes(const vector& classes, const ve /* ************************************************************************* */ void Module::WriteCollectorsAndCleanupFcn(FileWriter& wrapperFile, const std::string& moduleName, const std::vector& classes) { // Generate all collectors - BOOST_FOREACH(const Class& cls, classes) { + for(const Class& cls: classes) { const string matlabUniqueName = cls.qualifiedName(), cppName = cls.qualifiedName("::"); wrapperFile.oss << "typedef std::set*> " @@ -379,7 +378,7 @@ void Module::WriteCollectorsAndCleanupFcn(FileWriter& wrapperFile, const std::st " mstream mout;\n" // Send stdout to MATLAB console " std::streambuf *outbuf = std::cout.rdbuf(&mout);\n\n" " bool anyDeleted = false;\n"; - BOOST_FOREACH(const Class& cls, classes) { + for(const Class& cls: classes) { const string matlabUniqueName = cls.qualifiedName(); const string cppName = cls.qualifiedName("::"); const string collectorType = "Collector_" + matlabUniqueName; @@ -411,7 +410,7 @@ void Module::WriteRTTIRegistry(FileWriter& wrapperFile, const std::string& modul " const mxArray *alreadyCreated = mexGetVariablePtr(\"global\", \"gtsam_" + moduleName + "_rttiRegistry_created\");\n" " if(!alreadyCreated) {\n" " std::map types;\n"; - BOOST_FOREACH(const Class& cls, classes) { + for(const Class& cls: classes) { if(cls.isVirtual) wrapperFile.oss << " types.insert(std::make_pair(typeid(" << cls.qualifiedName("::") << ").name(), \"" << cls.qualifiedName(".") << "\"));\n"; @@ -423,7 +422,7 @@ void Module::WriteRTTIRegistry(FileWriter& wrapperFile, const std::string& modul " if(!registry)\n" " registry = mxCreateStructMatrix(1, 1, 0, NULL);\n" " typedef std::pair StringPair;\n" - " BOOST_FOREACH(const StringPair& rtti_matlab, types) {\n" + " for(const StringPair& rtti_matlab: types) {\n" " int fieldId = mxAddField(registry, rtti_matlab.first.c_str());\n" " if(fieldId < 0)\n" " mexErrMsgTxt(\"gtsam wrap: Error indexing RTTI types, inheritance will not work correctly\");\n" @@ -458,11 +457,11 @@ void Module::python_wrapper(const string& toolboxPath) const { wrapperFile.oss << "{\n"; // write out classes - BOOST_FOREACH(const Class& cls, expandedClasses) + for(const Class& cls: expandedClasses) cls.python_wrapper(wrapperFile); // write out global functions - BOOST_FOREACH(const GlobalFunctions::value_type& p, global_functions) + for(const GlobalFunctions::value_type& p: global_functions) p.second.python_wrapper(wrapperFile); // finish wrapper file diff --git a/wrap/OverloadedFunction.h b/wrap/OverloadedFunction.h index 7718bc139..55e581ad8 100644 --- a/wrap/OverloadedFunction.h +++ b/wrap/OverloadedFunction.h @@ -49,7 +49,7 @@ public: std::vector expandArgumentListsTemplate( const TemplateSubstitution& ts) const { std::vector result; - BOOST_FOREACH(const ArgumentList& argList, argLists_) { + for(const ArgumentList& argList: argLists_) { ArgumentList instArgList = argList.expandTemplate(ts); result.push_back(instArgList); } @@ -63,8 +63,8 @@ public: void verifyArguments(const std::vector& validArgs, const std::string s) const { - BOOST_FOREACH(const ArgumentList& argList, argLists_) { - BOOST_FOREACH(Argument arg, argList) { + for(const ArgumentList& argList: argLists_) { + for(Argument arg: argList) { std::string fullType = arg.type.qualifiedName("::"); if (find(validArgs.begin(), validArgs.end(), fullType) == validArgs.end()) @@ -75,7 +75,7 @@ public: friend std::ostream& operator<<(std::ostream& os, const ArgumentOverloads& overloads) { - BOOST_FOREACH(const ArgumentList& argList, overloads.argLists_) + for(const ArgumentList& argList: overloads.argLists_) os << argList << std::endl; return os; } @@ -106,7 +106,7 @@ static std::map expandMethodTemplate( const std::map& methods, const TemplateSubstitution& ts) { std::map result; typedef std::pair NamedMethod; - BOOST_FOREACH(NamedMethod namedMethod, methods) { + for(NamedMethod namedMethod: methods) { F instMethod = namedMethod.second; instMethod.expandTemplate(ts); namedMethod.second = instMethod; @@ -119,7 +119,7 @@ template inline void verifyArguments(const std::vector& validArgs, const std::map& vt) { typedef typename std::map::value_type NamedMethod; - BOOST_FOREACH(const NamedMethod& namedMethod, vt) + for(const NamedMethod& namedMethod: vt) namedMethod.second.verifyArguments(validArgs); } diff --git a/wrap/TemplateInstantiationTypedef.cpp b/wrap/TemplateInstantiationTypedef.cpp index e925fd381..4c77d4e76 100644 --- a/wrap/TemplateInstantiationTypedef.cpp +++ b/wrap/TemplateInstantiationTypedef.cpp @@ -20,7 +20,6 @@ #include "utilities.h" #include -#include #include using namespace std; @@ -31,7 +30,7 @@ Class TemplateInstantiationTypedef::findAndExpand( const vector& classes) const { // Find matching class boost::optional matchedClass; - BOOST_FOREACH(const Class& cls, classes) { + for(const Class& cls: classes) { if (cls.name() == class_.name() && cls.namespaces() == class_.namespaces() && cls.templateArgs.size() == typeList.size()) { matchedClass.reset(cls); diff --git a/wrap/TypeAttributesTable.cpp b/wrap/TypeAttributesTable.cpp index 27de70d0e..f98e9b760 100644 --- a/wrap/TypeAttributesTable.cpp +++ b/wrap/TypeAttributesTable.cpp @@ -20,7 +20,6 @@ #include "Class.h" #include "utilities.h" -#include #include #include @@ -45,7 +44,7 @@ const TypeAttributes& TypeAttributesTable::attributes(const string& key) const { /* ************************************************************************* */ void TypeAttributesTable::addClasses(const vector& classes) { - BOOST_FOREACH(const Class& cls, classes) { + for(const Class& cls: classes) { if (!table_.insert( make_pair(cls.qualifiedName("::"), TypeAttributes(cls.isVirtual))).second) throw DuplicateDefinition("class " + cls.qualifiedName("::")); @@ -55,7 +54,7 @@ void TypeAttributesTable::addClasses(const vector& classes) { /* ************************************************************************* */ void TypeAttributesTable::addForwardDeclarations( const vector& forwardDecls) { - BOOST_FOREACH(const ForwardDeclaration& fwDec, forwardDecls) { + for(const ForwardDeclaration& fwDec: forwardDecls) { if (!table_.insert(make_pair(fwDec.name, TypeAttributes(fwDec.isVirtual))).second) throw DuplicateDefinition("class " + fwDec.name); } @@ -63,7 +62,7 @@ void TypeAttributesTable::addForwardDeclarations( /* ************************************************************************* */ void TypeAttributesTable::checkValidity(const vector& classes) const { - BOOST_FOREACH(const Class& cls, classes) { + for(const Class& cls: classes) { boost::optional parent = cls.qualifiedParent(); if (parent) { diff --git a/wrap/tests/expected/geometry_wrapper.cpp b/wrap/tests/expected/geometry_wrapper.cpp index 226030a0d..ef9051d14 100644 --- a/wrap/tests/expected/geometry_wrapper.cpp +++ b/wrap/tests/expected/geometry_wrapper.cpp @@ -1,6 +1,5 @@ #include #include -#include #include #include @@ -116,7 +115,7 @@ void _geometry_RTTIRegister() { if(!registry) registry = mxCreateStructMatrix(1, 1, 0, NULL); typedef std::pair StringPair; - BOOST_FOREACH(const StringPair& rtti_matlab, types) { + for(const StringPair& rtti_matlab: types) { int fieldId = mxAddField(registry, rtti_matlab.first.c_str()); if(fieldId < 0) mexErrMsgTxt("gtsam wrap: Error indexing RTTI types, inheritance will not work correctly"); diff --git a/wrap/tests/expected2/geometry_wrapper.cpp b/wrap/tests/expected2/geometry_wrapper.cpp index 4b41f3958..8526900a7 100644 --- a/wrap/tests/expected2/geometry_wrapper.cpp +++ b/wrap/tests/expected2/geometry_wrapper.cpp @@ -1,6 +1,5 @@ #include #include -#include #include @@ -91,7 +90,7 @@ void _geometry_RTTIRegister() { if(!registry) registry = mxCreateStructMatrix(1, 1, 0, NULL); typedef std::pair StringPair; - BOOST_FOREACH(const StringPair& rtti_matlab, types) { + for(const StringPair& rtti_matlab: types) { int fieldId = mxAddField(registry, rtti_matlab.first.c_str()); if(fieldId < 0) mexErrMsgTxt("gtsam wrap: Error indexing RTTI types, inheritance will not work correctly"); diff --git a/wrap/tests/expected_namespaces/testNamespaces_wrapper.cpp b/wrap/tests/expected_namespaces/testNamespaces_wrapper.cpp index 6d22e1625..0f5c70348 100644 --- a/wrap/tests/expected_namespaces/testNamespaces_wrapper.cpp +++ b/wrap/tests/expected_namespaces/testNamespaces_wrapper.cpp @@ -1,6 +1,5 @@ #include #include -#include #include #include @@ -81,7 +80,7 @@ void _testNamespaces_RTTIRegister() { if(!registry) registry = mxCreateStructMatrix(1, 1, 0, NULL); typedef std::pair StringPair; - BOOST_FOREACH(const StringPair& rtti_matlab, types) { + for(const StringPair& rtti_matlab: types) { int fieldId = mxAddField(registry, rtti_matlab.first.c_str()); if(fieldId < 0) mexErrMsgTxt("gtsam wrap: Error indexing RTTI types, inheritance will not work correctly"); diff --git a/wrap/utilities.cpp b/wrap/utilities.cpp index 57a5bce29..32ee85eee 100644 --- a/wrap/utilities.cpp +++ b/wrap/utilities.cpp @@ -19,7 +19,6 @@ #include #include -#include #include #include "utilities.h" @@ -71,9 +70,9 @@ bool assert_equal(const vector& expected, const vector& actual) } if(!match) { cout << "expected: " << endl; - BOOST_FOREACH(const vector::value_type& a, expected) { cout << "[" << a << "] "; } + for(const vector::value_type& a: expected) { cout << "[" << a << "] "; } cout << "\nactual: " << endl; - BOOST_FOREACH(const vector::value_type& a, actual) { cout << "[" << a << "] "; } + for(const vector::value_type& a: actual) { cout << "[" << a << "] "; } cout << endl; return false; } @@ -132,7 +131,7 @@ void createNamespaceStructure(const std::vector& namespaces, const std::string& toolboxPath) { using namespace boost::filesystem; path curPath = toolboxPath; - BOOST_FOREACH(const string& subdir, namespaces) { + for(const string& subdir: namespaces) { // curPath /= "+" + subdir; // original - resulted in valgrind error curPath = curPath / string(string("+") + subdir); if(!is_directory(curPath)) {