extent: add contract methods
This commit is contained in:
parent
5b878983a6
commit
af11d7c730
20
extent.cpp
20
extent.cpp
@ -77,7 +77,25 @@ template <size_t S, typename T>
|
||||
util::extent<S,T>
|
||||
util::extent<S,T>::expanded (T t) const
|
||||
{
|
||||
return expanded (util::vector<S,T> {t});
|
||||
return *this + util::vector<S,T> {t};
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <size_t S, typename T>
|
||||
util::extent<S,T>
|
||||
util::extent<S,T>::contracted (vector<S,T> t) const
|
||||
{
|
||||
return *this - t;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <size_t S, typename T>
|
||||
util::extent<S,T>
|
||||
util::extent<S,T>::contracted (T t) const
|
||||
{
|
||||
return *this - vector<S,T> {-t};
|
||||
}
|
||||
|
||||
|
||||
|
@ -45,6 +45,8 @@ namespace util {
|
||||
|
||||
extent expanded (vector<S,T>) const;
|
||||
extent expanded (T) const;
|
||||
extent contracted (vector<S,T>) const;
|
||||
extent contracted (T) const;
|
||||
|
||||
bool empty (void) const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user