From 4115f22c50ee0571e88a8ec44c0241693af7ed38 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Tue, 15 Dec 2020 14:25:57 +0100 Subject: Fixing cpp08/{00,01} --- cpp08/ex01/span.hpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'cpp08/ex01/span.hpp') diff --git a/cpp08/ex01/span.hpp b/cpp08/ex01/span.hpp index 0af8453..6b72fb5 100644 --- a/cpp08/ex01/span.hpp +++ b/cpp08/ex01/span.hpp @@ -6,7 +6,7 @@ /* By: charles +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/04/15 06:55:07 by charles #+# #+# */ -/* Updated: 2020/04/15 07:19:46 by charles ### ########.fr */ +/* Updated: 2020/12/15 12:22:31 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -24,14 +24,25 @@ public: ~Span(); Span(unsigned int n); + void addNumber(int x); + + template + void addNumber(InputIterator begin, InputIterator end) + { + for (; begin != end; ++begin) + addNumber(*begin); + } + int shortestSpan() const; - int longestSpan() const; + int longestSpan() const; private: - int* m_under; + int* m_under; unsigned int m_size; unsigned int m_fillIndex; + + void setupSpan() const; }; #endif -- cgit