mirror of
https://github.com/korenkonder/ReDIVA.git
synced 2026-10-05 21:28:13 +03:00
Added rvalue variant for prj::find
This commit is contained in:
@@ -13,7 +13,17 @@
|
||||
|
||||
namespace prj {
|
||||
template <class T>
|
||||
bool find(std::vector<T>& vec, T& value) {
|
||||
bool find(std::vector<T>& vec, const T& value) {
|
||||
auto begin = vec.begin();
|
||||
auto end = vec.end();
|
||||
for (auto i = begin; i != end; i++)
|
||||
if (*i == value)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
bool find(std::vector<T>& vec, const T&& value) {
|
||||
auto begin = vec.begin();
|
||||
auto end = vec.end();
|
||||
for (auto i = begin; i != end; i++)
|
||||
|
||||
Reference in New Issue
Block a user