extent: add vector-only constructor
This commit is contained in:
parent
84c957440b
commit
6c88184b6b
10
extent.cpp
10
extent.cpp
@ -29,6 +29,16 @@ template <typename T>
|
||||
util::extent<T>::extent (const T _width, const T _height):
|
||||
w (_width),
|
||||
h (_height)
|
||||
{
|
||||
CHECK_GE (w, 0);
|
||||
CHECK_GE (h, 0);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T>
|
||||
util::extent<T>::extent (vector<2,T> _v):
|
||||
extent (_v.x, _v.y)
|
||||
{ ; }
|
||||
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
||||
namespace util {
|
||||
/**
|
||||
* A pure two-dimensional size, without positioning
|
||||
@ -33,6 +34,7 @@ namespace util {
|
||||
T w, h;
|
||||
|
||||
extent (const T _width, const T _height);
|
||||
extent (vector<2,T>);
|
||||
extent (const extent&);
|
||||
extent& operator= (const extent&);
|
||||
extent () = default;
|
||||
|
Loading…
Reference in New Issue
Block a user