non-class type return values are non-modifiable, const qualifier is ignored (-Wignored-qualifiers)

ex:
int func() { return 0; }
main() { func() = 5; } // invalid
This commit is contained in:
James Cline
2012-01-17 19:54:00 +00:00
parent 9124085d13
commit 94ebf46924
4 changed files with 6 additions and 6 deletions
@@ -59,7 +59,7 @@ class QueryStat
: bound(SortPolicy::WorstDistance()) { }
//! Get the bound.
const double Bound() const { return bound; }
double Bound() const { return bound; }
//! Modify the bound.
double& Bound() { return bound; }
};
@@ -77,7 +77,7 @@ class FurthestNeighborSort
*
* @return 0
*/
static inline const double WorstDistance() { return 0; }
static inline double WorstDistance() { return 0; }
/**
* Return what should represent the best possible distance with this
@@ -86,7 +86,7 @@ class FurthestNeighborSort
*
* @return DBL_MAX
*/
static inline const double BestDistance() { return DBL_MAX; }
static inline double BestDistance() { return DBL_MAX; }
};
}; // namespace neighbor
@@ -81,7 +81,7 @@ class NearestNeighborSort
*
* @return DBL_MAX
*/
static inline const double WorstDistance() { return DBL_MAX; }
static inline double WorstDistance() { return DBL_MAX; }
/**
* Return what should represent the best possible distance with this
@@ -90,7 +90,7 @@ class NearestNeighborSort
*
* @return 0.0
*/
static inline const double BestDistance() { return 0.0; }
static inline double BestDistance() { return 0.0; }
};
}; // namespace neighbor
@@ -45,7 +45,7 @@ class SaveRestoreTest
return success;
}
const size_t AnInt() { return anInt; }
size_t AnInt() { return anInt; }
void AnInt(size_t s) { this->anInt = s; }
};