From f87481c5e029f95315196ef725572a237efea8af Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Wed, 15 Apr 2015 13:51:52 +1000 Subject: [PATCH] vector: add constant unit vector --- vector.cpp | 5 +++++ vector.hpp | 1 + 2 files changed, 6 insertions(+) diff --git a/vector.cpp b/vector.cpp index 407a47f5..57a82877 100644 --- a/vector.cpp +++ b/vector.cpp @@ -181,6 +181,11 @@ util::vector::is_zero (void) const //----------------------------------------------------------------------------- +template +const util::vector +util::vector::UNIT (T{1}); + + template const util::vector util::vector::ZERO (T{0}); diff --git a/vector.hpp b/vector.hpp index d85e570e..20c405a3 100644 --- a/vector.hpp +++ b/vector.hpp @@ -43,6 +43,7 @@ namespace util { vector normalised [[gnu::warn_unused_result]] (void) const; // constants + static const vector UNIT; static const vector ZERO; void sanity (void) const;