OGLplus  (0.59.0) a C++ wrapper for rendering APIs

compare.hpp
Go to the documentation of this file.
1 #ifndef EAGINE_VECT_COMPARE_HPP
9 #define EAGINE_VECT_COMPARE_HPP
10 
11 #include "data.hpp"
12 
13 namespace eagine::vect {
14 
15 template <typename T, int N, bool V>
16 struct is_zero {
17  using _dT = data_t<T, N, V>;
18  using _dpT = data_param_t<T, N, V>;
19 
20  static auto apply(_dpT v) noexcept -> bool {
21  for(int i = 0; i < N; ++i) {
22  if(v[i] > T(0) || v[i] < T(0)) {
23  return false;
24  }
25  }
26  return true;
27  }
28 };
29 
30 // TODO: some optimizations ?
31 
32 } // namespace eagine::vect
33 
34 #endif // EAGINE_VECT_COMPARE_HPP
static auto is_zero(const vector< T, N, V > &v) noexcept -> bool
Tests if a vector has zero lenght.
Definition: vector.hpp:287

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).