vector: add constant unit vector

This commit is contained in:
Danny Robson 2015-04-15 13:51:52 +10:00
parent 13ea2bbdf5
commit f87481c5e0
2 changed files with 6 additions and 0 deletions

View File

@ -181,6 +181,11 @@ util::vector<S,T>::is_zero (void) const
//-----------------------------------------------------------------------------
template <size_t S, typename T>
const util::vector<S,T>
util::vector<S,T>::UNIT (T{1});
template <size_t S, typename T>
const util::vector<S,T>
util::vector<S,T>::ZERO (T{0});

View File

@ -43,6 +43,7 @@ namespace util {
vector<S,T> normalised [[gnu::warn_unused_result]] (void) const;
// constants
static const vector<S,T> UNIT;
static const vector<S,T> ZERO;
void sanity (void) const;