region: make area and diameter constexpr

This commit is contained in:
Danny Robson 2019-03-20 16:07:42 +11:00
parent 89a4641c33
commit 426a3a3fde
2 changed files with 2 additions and 20 deletions

View File

@ -53,24 +53,6 @@ cruft::region<S,T>::region (point_t _a,
} }
//-----------------------------------------------------------------------------
template <size_t S, typename T>
T
cruft::region<S,T>::area (void) const
{
return e.area ();
}
//-----------------------------------------------------------------------------
template <size_t S, typename T>
T
cruft::region<S,T>::diameter (void) const
{
return e.diameter ();
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
template <size_t S, typename T> template <size_t S, typename T>
typename cruft::region<S,T>::extent_t typename cruft::region<S,T>::extent_t

View File

@ -52,8 +52,8 @@ namespace cruft {
} }
//--------------------------------------------------------------------- //---------------------------------------------------------------------
T area (void) const; constexpr T area (void) const { return e.area (); }
T diameter (void) const; constexpr T diameter (void) const { return e.diameter (); }
extent_t magnitude (void) const; extent_t magnitude (void) const;
extent_t magnitude (extent_t); extent_t magnitude (extent_t);