d08 ex01 ok

This commit is contained in:
hugogogo
2022-03-14 01:43:22 +01:00
parent a3be2c8f16
commit 685806cdfd
8 changed files with 683 additions and 0 deletions

43
d08/ex01/Span.hpp Normal file
View File

@@ -0,0 +1,43 @@
#ifndef SPAN_HPP
# define SPAN_HPP
# include "colors.h"
# include <iostream>
# include <string>
# include <vector>
# include <iterator>
# include <algorithm>
class Span {
public:
Span(unsigned int N);
Span( Span const & src );
~Span();
Span & operator=( Span const & rhs );
void addNumber(int nb);
void addNumber(int * arr, unsigned int size);
unsigned int shortestSpan();
unsigned int longestSpan();
// unsigned int const getMax() const;
std::vector<int>::const_iterator begin() const;
std::vector<int>::const_iterator end() const;
bool empty() const;
private:
Span();
unsigned int const _max;
std::vector<int> _container;
std::vector<int> _sort;
};
std::ostream & operator<<(std::ostream & o, Span const & rhs);
#endif