Added rvalue variant for prj::find

This commit is contained in:
korenkonder
2024-08-05 22:17:02 +03:00
parent d807552c7e
commit d0ea9d39bf
+11 -1
View File
@@ -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++)