vector and maitrix foreach
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
|
||||
#include "pimathbase.h"
|
||||
|
||||
|
||||
template<uint Cols, uint Rows, typename Type>
|
||||
class PIMathMatrixT;
|
||||
|
||||
@@ -445,6 +446,20 @@ public:
|
||||
|
||||
PIVector<Type> toVector() const {return c;}
|
||||
|
||||
const _CVector & forEach(std::function<void(const Type &)> f) const {
|
||||
c.forEach(f);
|
||||
return *this;
|
||||
}
|
||||
_CVector copyForEach(std::function<Type(const Type &)> f) const {
|
||||
_CVector ret;
|
||||
ret.c = c.copyForEach(f);
|
||||
return ret;
|
||||
}
|
||||
_CVector & forEachInplace(std::function<Type(const Type &)> f) {
|
||||
c.forEachInplace(f);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline Type * data() {return c.data();}
|
||||
inline const Type * data() const {return c.data();}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user