Fix warnings on incorrect for range reference bindings

release/4.3a0
Jose Luis Blanco Claraco 2020-07-27 00:11:51 +02:00
parent 406060b457
commit 8165291704
No known key found for this signature in database
GPG Key ID: D443304FBD70A641
7 changed files with 8 additions and 8 deletions

View File

@ -89,7 +89,7 @@ void TimingOutline::print(const std::string& outline) const {
childOrder[child.second->myOrder_] = child.second;
}
// Print children
for(const ChildOrder::value_type order_child: childOrder) {
for(const ChildOrder::value_type& order_child: childOrder) {
std::string childOutline(outline);
childOutline += "| ";
order_child.second->print(childOutline);

View File

@ -69,7 +69,7 @@ namespace gtsam {
for(Key j: f.keys()) cs[j] = f.cardinality(j);
// Convert map into keys
DiscreteKeys keys;
for(const DiscreteKey& key: cs)
for(const std::pair<const Key,size_t>& key: cs)
keys.push_back(key);
// apply operand
ADT result = ADT::apply(f, op);

View File

@ -56,7 +56,7 @@ bool Potentials::equals(const Potentials& other, double tol) const {
/* ************************************************************************* */
void Potentials::print(const string& s, const KeyFormatter& formatter) const {
cout << s << "\n Cardinalities: {";
for (const DiscreteKey& key : cardinalities_)
for (const std::pair<const Key,size_t>& key : cardinalities_)
cout << formatter(key.first) << ":" << key.second << ", ";
cout << "}" << endl;
ADT::print(" ");

View File

@ -145,7 +145,7 @@ void BlockJacobiPreconditioner::build(
/* getting the block diagonals over the factors */
std::map<Key, Matrix> hessianMap =gfg.hessianBlockDiagonal();
for ( const Matrix hessian: hessianMap | boost::adaptors::map_values)
for (const Matrix& hessian: hessianMap | boost::adaptors::map_values)
blocks.push_back(hessian);
/* if necessary, allocating the memory for cacheing the factorization results */

View File

@ -45,7 +45,7 @@ namespace gtsam {
/* ************************************************************************* */
VectorValues::VectorValues(const Vector& x, const Dims& dims) {
typedef pair<Key, size_t> Pair;
using Pair = pair<const Key, size_t>;
size_t j = 0;
for (const Pair& v : dims) {
Key key;

View File

@ -73,8 +73,8 @@ string findExampleDataFile(const string& name) {
namesToSearch.push_back(name + ".xml");
// Find first name that exists
for(const fs::path& root: rootsToSearch) {
for(const fs::path& name: namesToSearch) {
for(const fs::path root: rootsToSearch) {
for(const fs::path name: namesToSearch) {
if (fs::is_regular_file(root / name))
return (root / name).string();
}

View File

@ -248,7 +248,7 @@ void Module::parseMarkup(const std::string& data) {
// Create type attributes table and check validity
typeAttributes.addClasses(expandedClasses);
typeAttributes.addForwardDeclarations(forward_declarations);
for (const TypedefPair p: typedefs)
for (const TypedefPair& p: typedefs)
typeAttributes.addType(p.newType);
// add Eigen types as template arguments are also checked ?
vector<ForwardDeclaration> eigen;