From a9c5d05ea88af113d9493244cbe9f478789949b3 Mon Sep 17 00:00:00 2001 From: Julian Daube Date: Sun, 8 Oct 2017 19:09:50 +0200 Subject: [PATCH] fix macro bug, add to test case --- .cproject | 44 ++++++++++++++++++++++++++++++++++++++++++++ main.cpp | 8 +++++--- 2 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 .cproject diff --git a/.cproject b/.cproject new file mode 100644 index 0000000..aa9a1ad --- /dev/null +++ b/.cproject @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/main.cpp b/main.cpp index 635fa44..b9a3835 100644 --- a/main.cpp +++ b/main.cpp @@ -48,11 +48,13 @@ protected: template std::string readTill(iterator &start, const iterator &end, std::function limiter) { - while(start != end && !limiter(start)) { - ++start; + iterator current = start; + + while(current != end && !limiter(current)) { + ++current; } - return std::string(start, end); + return std::string(start, current); }