summaryrefslogtreecommitdiff
path: root/lib/parse_plural.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:19:14 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:19:14 +0200
commit01eb8253196672c969a39587e90b49321a182428 (patch)
tree4a3b71d7913de519744466c9227fda6461c4f0b5 /lib/parse_plural.h
parent5.0 (diff)
downloadFreeFileSync-01eb8253196672c969a39587e90b49321a182428.tar.gz
FreeFileSync-01eb8253196672c969a39587e90b49321a182428.tar.bz2
FreeFileSync-01eb8253196672c969a39587e90b49321a182428.zip
5.1
Diffstat (limited to 'lib/parse_plural.h')
-rw-r--r--lib/parse_plural.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/parse_plural.h b/lib/parse_plural.h
index 297aaafc..3c5820d0 100644
--- a/lib/parse_plural.h
+++ b/lib/parse_plural.h
@@ -9,6 +9,7 @@
#include <list>
#include <memory>
+#include <functional>
#include <zen/string_base.h>
@@ -185,7 +186,7 @@ private:
Token nextToken()
{
//skip whitespace
- pos = std::find_if(pos, stream.end(), std::not1(std::ptr_fun(std::iswspace)));
+ pos = std::find_if(pos, stream.end(), [](char c) { return !zen::isWhiteSpace(c); });
if (pos == stream.end()) return Token(Token::TK_END);
@@ -196,12 +197,12 @@ private:
return Token(i->second);
}
- Wstring::const_iterator digitEnd = std::find_if(pos, stream.end(), std::not1(std::ptr_fun(std::iswdigit)));
+ Wstring::const_iterator digitEnd = std::find_if(pos, stream.end(), [](char c) { return !zen::isDigit(c); });
int digitCount = digitEnd - pos;
if (digitCount != 0)
{
Token out(Token::TK_NUMBER);
- out.number = zen::toNumber<int>(Wstring(&*pos, digitCount));
+ out.number = zen::stringTo<int>(Wstring(&*pos, digitCount));
pos += digitCount;
return out;
}
@@ -391,8 +392,7 @@ private:
template <class T>
const T& manageObj(const T& obj)
{
- std::shared_ptr<Expression> newEntry(new T(obj));
- dump_.push_back(newEntry);
+ dump_.push_back(std::make_shared<T>(obj));
return static_cast<T&>(*dump_.back());
}
bgstack15