diff --git a/extent.cpp b/extent.cpp index 7c0b0b10..03b4becb 100644 --- a/extent.cpp +++ b/extent.cpp @@ -86,19 +86,6 @@ extent::empty (void) const } -/////////////////////////////////////////////////////////////////////////////// -template -const extent extent::MIN { 0 }; - - -//----------------------------------------------------------------------------- -template -const extent extent::MAX -{ - std::numeric_limits::max () -}; - - /////////////////////////////////////////////////////////////////////////////// template extent_range::extent_range (extent _target): diff --git a/extent.hpp b/extent.hpp index e983d74a..eeb804a6 100644 --- a/extent.hpp +++ b/extent.hpp @@ -51,8 +51,8 @@ namespace util { bool empty (void) const; - static const extent MAX; - static const extent MIN; + static constexpr extent max (void); + static constexpr extent min (void); }; template diff --git a/extent.ipp b/extent.ipp index 8c4ddecf..2f732d56 100644 --- a/extent.ipp +++ b/extent.ipp @@ -22,6 +22,7 @@ #define __UTIL_EXTENT_IPP #include +#include /////////////////////////////////////////////////////////////////////////////// @@ -76,3 +77,25 @@ util::extent::includes (point p) const return false; return true; } + + +/////////////////////////////////////////////////////////////////////////////// +template +constexpr +util::extent +util::extent::max (void) +{ + return extent { + std::numeric_limits::max () + }; +} + + +//----------------------------------------------------------------------------- +template +constexpr +util::extent +util::extent::min (void) +{ + return extent { 0 }; +}