extent: move ostream operator to util namespace

This commit is contained in:
Danny Robson 2015-01-15 14:04:18 +11:00
parent 75156cedc3
commit c931c718fe
2 changed files with 11 additions and 8 deletions

View File

@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with libgim. If not, see <http://www.gnu.org/licenses/>. * along with libgim. If not, see <http://www.gnu.org/licenses/>.
* *
* Copyright 2010-2012 Danny Robson <danny@nerdcruft.net> * Copyright 2010-2015 Danny Robson <danny@nerdcruft.net>
*/ */
#include "extent.hpp" #include "extent.hpp"
@ -113,15 +113,15 @@ namespace util {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
template <typename T> template <typename T>
std::ostream& std::ostream&
operator<< (std::ostream &os, util::extent<T> e) { util::operator<< (std::ostream &os, util::extent<T> e) {
os << "[" << e.w << ", " << e.h << "]"; os << "[" << e.w << ", " << e.h << "]";
return os; return os;
} }
template std::ostream& operator<< (std::ostream&, util::extent<uint16_t>); template std::ostream& util::operator<< (std::ostream&, util::extent<uint16_t>);
template std::ostream& operator<< (std::ostream&, util::extent<uint32_t>); template std::ostream& util::operator<< (std::ostream&, util::extent<uint32_t>);
template std::ostream& operator<< (std::ostream&, util::extent<uint64_t>); template std::ostream& util::operator<< (std::ostream&, util::extent<uint64_t>);
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
namespace util { namespace util {

View File

@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with libgim. If not, see <http://www.gnu.org/licenses/>. * along with libgim. If not, see <http://www.gnu.org/licenses/>.
* *
* Copyright 2010-2012 Danny Robson <danny@nerdcruft.net> * Copyright 2010-2015 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_EXTENT_HPP #ifndef __UTIL_EXTENT_HPP
@ -50,10 +50,13 @@ namespace util {
void sanity (void) const; void sanity (void) const;
}; };
typedef extent<size_t> extent2u;
template <typename T>
std::ostream& operator<< (std::ostream&, util::extent<T>);
} }
template <typename T>
std::ostream& operator<< (std::ostream&, util::extent<T>);
#include "extent.ipp" #include "extent.ipp"