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:
@@ -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; }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user