@@ -944,8 +944,8 @@ namespace attributes {
944944 rcppInterfacesWarning (" No interfaces specified" , lineNumber);
945945 }
946946 else {
947- for (std:: size_t i= 0 ; i<params. size (); i++ ) {
948- std::string param = params[i] .name ();
947+ for (auto & params_i : params ) {
948+ std::string param = params_i .name ();
949949 if (param != kInterfaceR && param != kInterfaceCpp ) {
950950 rcppInterfacesWarning (
951951 " Unknown interface '" + param + " '" , lineNumber);
@@ -1420,13 +1420,12 @@ namespace attributes {
14201420 // track cppExports and signatures (we use these at the end to
14211421 // generate the ValidateSignature and RegisterCCallable functions)
14221422 if (attributes.hasInterface (kInterfaceCpp )) {
1423- for (auto
1424- it = attributes.begin (); it != attributes.end (); ++it) {
1425- if (it->isExportedFunction ()) {
1423+ for (const auto & attribute : attributes) {
1424+ if (attribute.isExportedFunction ()) {
14261425 // add it to the list if it's not hidden
1427- Function fun = it-> function ().renamedTo (it-> exportedName ());
1426+ Function fun = attribute. function ().renamedTo (attribute. exportedName ());
14281427 if (!fun.isHidden ())
1429- cppExports_.push_back (*it );
1428+ cppExports_.push_back (attribute );
14301429 }
14311430 }
14321431 }
@@ -2059,11 +2058,10 @@ namespace attributes {
20592058 const std::string& contextId) {
20602059
20612060 // process each attribute
2062- for (auto
2063- it = attributes.begin (); it != attributes.end (); ++it) {
2061+ for (const auto & attribute : attributes) {
20642062
20652063 // alias the attribute and function (bail if not export)
2066- const Attribute& attribute = *it;
2064+
20672065 if (!attribute.isExportedFunction ())
20682066 continue ;
20692067 const Function& function = attribute.function ();
@@ -2479,10 +2477,10 @@ namespace {
24792477 const std::string& dllInfo) const
24802478 {
24812479 // process each attribute
2482- for (auto it = attributes. begin (); it != attributes. end (); ++it ) {
2480+ for (const auto & attribute : attributes) {
24832481
24842482 // alias the attribute and function (bail if not export)
2485- const Attribute& attribute = *it;
2483+
24862484 if (!attribute.isExportedFunction ()) continue ;
24872485 const Function& function = attribute.function ();
24882486
@@ -2685,9 +2683,8 @@ BEGIN_RCPP
26852683
26862684 Rcpp::CharacterVector vDepends = Rcpp::as<Rcpp::CharacterVector>(sDepends );
26872685 std::set<std::string> depends;
2688- for (Rcpp::CharacterVector::iterator
2689- it = vDepends.begin (); it != vDepends.end (); ++it) {
2690- depends.insert (std::string (*it));
2686+ for (auto & vDepend : vDepends) {
2687+ depends.insert (std::string (vDepend));
26912688 }
26922689
26932690 std::vector<std::string> cppFiles =
0 commit comments