view: find function takes const ref
This commit is contained in:
parent
86332b4d3c
commit
b027b60be0
2
view.hpp
2
view.hpp
@ -44,7 +44,7 @@ namespace util {
|
||||
constexpr const T& cbegin (void) const noexcept;
|
||||
constexpr const T& cend (void) const noexcept;
|
||||
|
||||
constexpr T find (value_type) const noexcept;
|
||||
constexpr T find (const value_type&) const noexcept;
|
||||
|
||||
constexpr bool empty (void) const noexcept;
|
||||
constexpr size_t size (void) const noexcept;
|
||||
|
2
view.ipp
2
view.ipp
@ -111,7 +111,7 @@ util::view<T>::cend (void) const noexcept
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
template <typename T>
|
||||
constexpr T
|
||||
util::view<T>::find (value_type v) const noexcept
|
||||
util::view<T>::find (const value_type &v) const noexcept
|
||||
{
|
||||
for (T i = cbegin (); i != cend (); ++i)
|
||||
if (*i == v)
|
||||
|
Loading…
Reference in New Issue
Block a user