From 252a870a22d3684890a5bcbdcac2e0490131ef31 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 23 Nov 2020 12:00:44 +1000 Subject: [PATCH] range: correct the ostream operator template variable refs --- range.cpp | 16 ++++++++++++++++ range.hpp | 15 ++++----------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/range.cpp b/range.cpp index cf657661..01ec8d16 100644 --- a/range.cpp +++ b/range.cpp @@ -169,6 +169,22 @@ cruft::range::operator ==(const cruft::range &rhs) const } +/////////////////////////////////////////////////////////////////////////////// +template +std::ostream& +cruft::operator <<(std::ostream &os, const range &rhs) { + os << '[' << rhs.lo << ", " << rhs.hi << ']'; + return os; +} + + +template std::ostream& cruft::operator<< (std::ostream&, range const&); +template std::ostream& cruft::operator<< (std::ostream&, range const&); +template std::ostream& cruft::operator<< (std::ostream&, range const&); +template std::ostream& cruft::operator<< (std::ostream&, range const&); +template std::ostream& cruft::operator<< (std::ostream&, range const&); + + /////////////////////////////////////////////////////////////////////////////// template void diff --git a/range.hpp b/range.hpp index 99a7d4be..2a6f9336 100644 --- a/range.hpp +++ b/range.hpp @@ -3,17 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2010-2015 Danny Robson + * Copyright 2010-2020 Danny Robson */ - -#ifndef __UTIL_RANGE_HPP -#define __UTIL_RANGE_HPP +#pragma once #include -#include #include #include +#include namespace cruft { /** @@ -119,10 +117,5 @@ namespace cruft { // ostream operators template std::ostream& - operator <<(std::ostream &os, const range &rhs) { - os << '[' << rhs.min << ", " << rhs.max << ']'; - return os; - } + operator <<(std::ostream &os, const range &); } - -#endif