From dba4e673ca6b2923893b3880a1e81ea0e6607aa8 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Thu, 24 Aug 2017 16:25:27 +1000 Subject: [PATCH] coord/ops: add scalar/vector relational operators --- coord/ops.hpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/coord/ops.hpp b/coord/ops.hpp index d8b47903..c996b8d4 100644 --- a/coord/ops.hpp +++ b/coord/ops.hpp @@ -887,6 +887,25 @@ namespace util { for (size_t i = 0; i < S; ++i) \ out[i] = k[i] OP u; \ return out; \ + } \ + \ + template < \ + size_t S, \ + typename T, \ + typename U, \ + template class K, \ + typename = std::enable_if_t< \ + is_coord_v>, void \ + > \ + > \ + constexpr \ + vector \ + operator OP (const U u, const K k) \ + { \ + vector out {}; \ + for (size_t i = 0; i < S; ++i) \ + out[i] = u OP k[i]; \ + return out; \ } SCALAR_OP(<)