region: add extent query method 'size'

This commit is contained in:
Danny Robson 2015-02-17 16:24:16 +11:00
parent 6bd9ad333c
commit 8ea1a04f57
2 changed files with 11 additions and 0 deletions

View File

@ -69,6 +69,15 @@ util::region<T>::diameter (void) const
}
//-----------------------------------------------------------------------------
template <typename T>
util::extent<typename util::region<T>::size_type>
util::region<T>::size (void) const
{
return { w, h };
}
//-----------------------------------------------------------------------------
template <typename T>
void

View File

@ -47,6 +47,8 @@ namespace util {
size_type area (void) const;
size_type diameter (void) const;
util::extent<size_type> size (void) const;
void scale (T factor);
bool empty (void) const;