aboutsummaryrefslogtreecommitdiff
path: root/cpp08/ex01/span.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp08/ex01/span.hpp')
-rw-r--r--cpp08/ex01/span.hpp17
1 files changed, 14 insertions, 3 deletions
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 <charles.cabergs@gmail.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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 <typename InputIterator>
+ 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