point: add min/max convenience methods

these create the smallest/largest expressible coordinates
This commit is contained in:
Danny Robson 2017-07-28 14:22:21 +10:00
parent bdd2e06044
commit 1f337ef964

View File

@ -37,8 +37,27 @@ namespace util {
template <size_t D> point<D,T> homog (void) const;
static constexpr point<S,T> origin (void);
///////////////////////////////////////////////////////////////////////
static constexpr
auto min (void)
{
return point { std::numeric_limits<T>::lowest () };
}
//-------------------------------------------------------------------
static constexpr
auto max (void)
{
return point { std::numeric_limits<T>::max () };
}
//-------------------------------------------------------------------
static constexpr
point<S,T> origin (void);
///////////////////////////////////////////////////////////////////////
void sanity (void) const;
};