move std function

This commit is contained in:
2026-03-20 16:31:30 +03:00
parent 4537e40832
commit 96c22e1184
28 changed files with 145 additions and 131 deletions

View File

@@ -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;
}