range: correct the ostream operator template variable refs

This commit is contained in:
Danny Robson 2020-11-23 12:00:44 +10:00
parent 4250e71d6e
commit 252a870a22
2 changed files with 20 additions and 11 deletions

View File

@ -169,6 +169,22 @@ cruft::range<T>::operator ==(const cruft::range<T> &rhs) const
} }
///////////////////////////////////////////////////////////////////////////////
template <typename T>
std::ostream&
cruft::operator <<(std::ostream &os, const range<T> &rhs) {
os << '[' << rhs.lo << ", " << rhs.hi << ']';
return os;
}
template std::ostream& cruft::operator<< (std::ostream&, range<int> const&);
template std::ostream& cruft::operator<< (std::ostream&, range<long> const&);
template std::ostream& cruft::operator<< (std::ostream&, range<unsigned int> const&);
template std::ostream& cruft::operator<< (std::ostream&, range<unsigned long> const&);
template std::ostream& cruft::operator<< (std::ostream&, range<float> const&);
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
template <typename T> template <typename T>
void void

View File

@ -3,17 +3,15 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
* *
* Copyright 2010-2015 Danny Robson <danny@nerdcruft.net> * Copyright 2010-2020 Danny Robson <danny@nerdcruft.net>
*/ */
#pragma once
#ifndef __UTIL_RANGE_HPP
#define __UTIL_RANGE_HPP
#include <cstdint> #include <cstdint>
#include <ostream>
#include <limits> #include <limits>
#include <type_traits> #include <type_traits>
#include <iosfwd>
namespace cruft { namespace cruft {
/** /**
@ -119,10 +117,5 @@ namespace cruft {
// ostream operators // ostream operators
template <typename T> template <typename T>
std::ostream& std::ostream&
operator <<(std::ostream &os, const range<T> &rhs) { operator <<(std::ostream &os, const range<T> &);
os << '[' << rhs.min << ", " << rhs.max << ']';
return os;
}
} }
#endif