diff options
author | Erik Schnetter <schnetter@gmail.com> | 2013-02-14 16:52:28 -0500 |
---|---|---|
committer | Erik Schnetter <schnetter@gmail.com> | 2013-02-14 16:52:28 -0500 |
commit | 81ad7c3dcac78c382a6a0db7bb28724612758d05 (patch) | |
tree | bcb0c2bf26e409de78cccf8b3747706201cab524 /vec_pseudo.h | |
parent | 078cc157a086a0f6b47813044ee16e9a842bce28 (diff) | |
download | vecmathlib-81ad7c3dcac78c382a6a0db7bb28724612758d05.zip vecmathlib-81ad7c3dcac78c382a6a0db7bb28724612758d05.tar.gz |
Move definition of all and any into class
Diffstat (limited to 'vec_pseudo.h')
-rw-r--r-- | vec_pseudo.h | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/vec_pseudo.h b/vec_pseudo.h index c93e8bf..69eb02c 100644 --- a/vec_pseudo.h +++ b/vec_pseudo.h @@ -101,8 +101,18 @@ namespace vecmathlib { return res; } - bool all() const; - bool any() const; + bool all() const + { + bool res = true; + for (int d=0; d<size; ++d) res = res && v[d]; + return res; + } + bool any() const + { + bool res = false; + for (int d=0; d<size; ++d) res = res || v[d]; + return res; + } @@ -736,24 +746,6 @@ namespace vecmathlib { template<typename T, int N> inline - bool boolpseudovec<T,N>::all() const - { - bool res = true; - for (int d=0; d<size; ++d) res = res && v[d]; - return res; - } - - template<typename T, int N> - inline - bool boolpseudovec<T,N>::any() const - { - bool res = false; - for (int d=0; d<size; ++d) res = res || v[d]; - return res; - } - - template<typename T, int N> - inline auto boolpseudovec<T,N>::ifthen(intvec_t x, intvec_t y) const -> intvec_t { intvec_t res; |