extent: add ostream operator
This commit is contained in:
parent
89c87cbf06
commit
ff17c51a85
12
extent.cpp
12
extent.cpp
@ -108,6 +108,18 @@ namespace util {
|
||||
{ return; }
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T>
|
||||
std::ostream&
|
||||
operator<< (std::ostream &os, util::extent<T> e) {
|
||||
os << "[" << e.w << ", " << e.h << "]";
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
template std::ostream& operator<< (std::ostream&, util::extent<uint16_t>);
|
||||
template std::ostream& operator<< (std::ostream&, util::extent<uint32_t>);
|
||||
template std::ostream& operator<< (std::ostream&, util::extent<uint64_t>);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace util {
|
||||
|
@ -20,6 +20,8 @@
|
||||
#ifndef __UTIL_EXTENT_HPP
|
||||
#define __UTIL_EXTENT_HPP
|
||||
|
||||
#include <iostream>
|
||||
|
||||
namespace util {
|
||||
/**
|
||||
* A pure two-dimensional size, without positioning
|
||||
@ -47,5 +49,7 @@ namespace util {
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
template <typename T>
|
||||
std::ostream& operator<< (std::ostream&, util::extent<T>);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user