xo-ratio: bugfix: narrow operator<< template
This commit is contained in:
parent
24df33c505
commit
54cb306903
1 changed files with 4 additions and 4 deletions
|
|
@ -17,9 +17,9 @@ namespace xo {
|
||||||
* print_ratio(std::cerr, make_ratio(1,2); // outputs "<ratio 1/2>"
|
* print_ratio(std::cerr, make_ratio(1,2); // outputs "<ratio 1/2>"
|
||||||
* @endcode
|
* @endcode
|
||||||
**/
|
**/
|
||||||
template <typename Ratio>
|
template <typename Int>
|
||||||
void
|
void
|
||||||
print_ratio (std::ostream & os, const Ratio & x) {
|
print_ratio (std::ostream & os, const ratio<Int> & x) {
|
||||||
os << "<ratio " << x.num() << "/" << x.den() << ">";
|
os << "<ratio " << x.num() << "/" << x.den() << ">";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -30,9 +30,9 @@ namespace xo {
|
||||||
* std::cout << make_ratio(2,3); // outputs "<ratio 2/3>"
|
* std::cout << make_ratio(2,3); // outputs "<ratio 2/3>"
|
||||||
* @endcode
|
* @endcode
|
||||||
**/
|
**/
|
||||||
template <typename Ratio>
|
template <typename Int>
|
||||||
inline std::ostream &
|
inline std::ostream &
|
||||||
operator<< (std::ostream & os, const Ratio & x) {
|
operator<< (std::ostream & os, const ratio<Int> & x) {
|
||||||
print_ratio(os, x);
|
print_ratio(os, x);
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue