extent: add ostream operator

This commit is contained in:
Danny Robson 2014-07-02 15:43:59 +10:00
parent 89c87cbf06
commit ff17c51a85
2 changed files with 17 additions and 1 deletions

View File

@ -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 {

View File

@ -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