move std function
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
//! \~russian Математический вектор
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Math vector
|
||||
Math vector
|
||||
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -805,11 +805,12 @@ public:
|
||||
|
||||
//! \~english Applies \a f to every coordinate without modifying the vector.
|
||||
//! \~russian Применяет \a f к каждой координате без изменения вектора.
|
||||
void forEach(std::function<void(const Type &)> f) const { c.forEach(f); }
|
||||
void forEach(std::function<void(const Type &)> f) const { c.forEach(std::move(f)); }
|
||||
|
||||
//! \~english Applies \a f to every coordinate and returns this vector.
|
||||
//! \~russian Применяет \a f к каждой координате и возвращает этот вектор.
|
||||
_CVector & forEach(std::function<void(Type &)> f) {
|
||||
c.forEach(f);
|
||||
c.forEach(std::move(f));
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user