region: remove `expanded' function

we're trying to move away from mutating operators.

also, we do the bad thing of just renaming the non-mutating operator
given it appears no one is using the mutating operator in our code bases
anyway...
This commit is contained in:
Danny Robson 2017-08-09 17:28:53 +10:00
parent b6edf25cd8
commit 72f631ab4b
2 changed files with 5 additions and 29 deletions

View File

@ -274,31 +274,10 @@ util::region<S,T>::inset (vector<S,T> mag) const
}
//-----------------------------------------------------------------------------
template <size_t S, typename T>
util::region<S,T>&
util::region<S,T>::expand (vector<S,T> v)
{
p -= v;
e += v * T{2};
return *this;
}
//-----------------------------------------------------------------------------
template <size_t S, typename T>
util::region<S,T>&
util::region<S,T>::expand (T mag)
{
return expand (vector<S,T> {mag});
}
//-----------------------------------------------------------------------------
template <size_t S, typename T>
util::region<S,T>
util::region<S,T>::expanded (vector<S,T> v) const
util::region<S,T>::expand (vector<S,T> v) const
{
return {
p - v,
@ -310,9 +289,9 @@ util::region<S,T>::expanded (vector<S,T> v) const
//-----------------------------------------------------------------------------
template <size_t S, typename T>
util::region<S,T>
util::region<S,T>::expanded (T mag) const
util::region<S,T>::expand (T mag) const
{
return expanded (vector<S,T> {mag});
return expand (vector<S,T> {mag});
}

View File

@ -88,11 +88,8 @@ namespace util {
region inset (T mag) const;
region inset (vector<S,T> mag) const;
region expanded (T mag) const;
region expanded (vector<S,T>) const;
region& expand (T mag);
region& expand (vector<S,T>);
region expand (T mag) const;
region expand (vector<S,T>) const;
// arithmetic operators
region operator+ (vector<S,T>) const;