From 3f07f6edf741700c8bc908316dcf641a4f824efb Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Sat, 7 Mar 2015 03:18:13 +1100 Subject: [PATCH] coord/ops: negation operator --- coord/ops.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/coord/ops.hpp b/coord/ops.hpp index 953a023d..7f02b37e 100644 --- a/coord/ops.hpp +++ b/coord/ops.hpp @@ -148,6 +148,15 @@ namespace util { SCALAR_OP(/=) #undef SCALAR_OP + //------------------------------------------------------------------------- + // negation + template class K> + K operator- (K k) + { + k *= -1; + return ; + } + /////////////////////////////////////////////////////////////////////////// // logic operators