Skip to content

Commit

Permalink
std: add missing const
Browse files Browse the repository at this point in the history
  • Loading branch information
jcarpent committed Jan 20, 2024
1 parent f501442 commit 703a6fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/eigenpy/std-vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ struct contains_algo;
template <typename T>
struct contains_algo<T, true> {
template <class Container, typename key_type>
static bool run(Container &container, key_type const &key) {
static bool run(const Container &container, key_type const &key) {
return std::find(container.begin(), container.end(), key) !=
container.end();
}
Expand All @@ -351,7 +351,7 @@ struct contains_algo<T, true> {
template <typename T>
struct contains_algo<T, false> {
template <class Container, typename key_type>
static bool run(Container &container, key_type const &key) {
static bool run(const Container &container, key_type const &key) {
for (size_t k = 0; k < container.size(); ++k) {
if (&container[k] == &key) return true;
}
Expand Down

0 comments on commit 703a6fb

Please sign in to comment.