「🔨」 fix(ex01/ex02): fixed things that i forgot to do
This commit is contained in:
@@ -1,9 +1,3 @@
|
||||
#include <stdexcept>
|
||||
#include <algorithm>
|
||||
#include <limits>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "Span.hpp"
|
||||
|
||||
Span::Span(void)
|
||||
@@ -72,3 +66,17 @@ int Span::longestSpan(void)
|
||||
|
||||
return (*max - *min);
|
||||
}
|
||||
|
||||
std::ostream &operator<<(std::ostream &os, const Span &o)
|
||||
{
|
||||
os << "(size = " << o.getSize() << ") ";
|
||||
std::vector<int> const &numbers = o.getData();
|
||||
for (unsigned int i = 0; i < numbers.size(); i++)
|
||||
{
|
||||
os << numbers[i];
|
||||
if (i != numbers.size() - 1)
|
||||
os << ", ";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user