summaryrefslogtreecommitdiff
path: root/zen
diff options
context:
space:
mode:
Diffstat (limited to 'zen')
-rw-r--r--zen/globals.h2
-rw-r--r--zen/legacy_compiler.h6
-rw-r--r--zen/serialize.h1
-rw-r--r--zen/stl_tools.h6
-rw-r--r--zen/string_tools.h48
-rw-r--r--zen/sys_error.h2
6 files changed, 33 insertions, 32 deletions
diff --git a/zen/globals.h b/zen/globals.h
index e59d64c1..4c1453a2 100644
--- a/zen/globals.h
+++ b/zen/globals.h
@@ -206,7 +206,7 @@ void registerGlobalForDestruction(CleanUpEntry& entry)
//------------------------------------------------------------------------------------------
#if __cpp_lib_atomic_wait
-#error implement + rewiew improvements
+ #error implement + rewiew improvements
#endif
diff --git a/zen/legacy_compiler.h b/zen/legacy_compiler.h
index 6ce1d765..54dd7f59 100644
--- a/zen/legacy_compiler.h
+++ b/zen/legacy_compiler.h
@@ -9,9 +9,9 @@
#if !__cpp_lib_erase_if
-#include <vector>
-#include <set>
-#include <map>
+ #include <vector>
+ #include <set>
+ #include <map>
#endif
diff --git a/zen/serialize.h b/zen/serialize.h
index 5a38303c..bdeec858 100644
--- a/zen/serialize.h
+++ b/zen/serialize.h
@@ -9,6 +9,7 @@
#include <functional>
#include <cstdint>
+#include <stdexcept>
#include "string_base.h"
//keep header clean from specific stream implementations! (e.g.file_io.h)! used by abstract.h!
diff --git a/zen/stl_tools.h b/zen/stl_tools.h
index d09010ad..8856ce84 100644
--- a/zen/stl_tools.h
+++ b/zen/stl_tools.h
@@ -96,7 +96,7 @@ public:
/**/ T& ref() { return *ref_; };
const T& ref() const { return *ref_; };
- std::shared_ptr< T> ptr() { return ref_; };
+ std::shared_ptr< T> ptr() { return ref_; };
std::shared_ptr<const T> ptr() const { return ref_; };
private:
@@ -207,9 +207,9 @@ BidirectionalIterator1 searchLast(const BidirectionalIterator1 first1, Bid
//http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0458r2.html
template <class Container, class ValueType, typename = std::enable_if_t<!IsStringLikeV<Container>>> inline
-bool contains(const Container& c, const ValueType& val, int dummy = 0 /*overload string_tools.h contains()*/)
+ bool contains(const Container& c, const ValueType& val, int dummy = 0 /*overload string_tools.h contains()*/)
{
- return c.find(val) != c.end();
+ return c.find(val) != c.end();
}
//---------------------------------------------------------------------------------------
diff --git a/zen/string_tools.h b/zen/string_tools.h
index 7f9a07ff..47271bc7 100644
--- a/zen/string_tools.h
+++ b/zen/string_tools.h
@@ -34,19 +34,19 @@ template <class Char> Char asciiToUpper(Char c);
//both S and T can be strings or char/wchar_t arrays or single char/wchar_t
template <class S, class T, typename = std::enable_if_t<IsStringLikeV<S>>> bool contains(const S& str, const T& term);
-template <class S, class T> bool startsWith (const S& str, const T& prefix);
-template <class S, class T> bool startsWithAsciiNoCase(const S& str, const T& prefix);
+ template <class S, class T> bool startsWith (const S& str, const T& prefix);
+ template <class S, class T> bool startsWithAsciiNoCase(const S& str, const T& prefix);
-template <class S, class T> bool endsWith (const S& str, const T& postfix);
-template <class S, class T> bool endsWithAsciiNoCase(const S& str, const T& postfix);
+ template <class S, class T> bool endsWith (const S& str, const T& postfix);
+ template <class S, class T> bool endsWithAsciiNoCase(const S& str, const T& postfix);
-template <class S, class T> bool equalString (const S& lhs, const T& rhs);
-template <class S, class T> bool equalAsciiNoCase(const S& lhs, const T& rhs);
+ template <class S, class T> bool equalString (const S& lhs, const T& rhs);
+ template <class S, class T> bool equalAsciiNoCase(const S& lhs, const T& rhs);
-template <class S, class T> int compareString (const S& lhs, const T& rhs);
-template <class S, class T> int compareAsciiNoCase(const S& lhs, const T& rhs); //basic case-insensitive comparison (considering A-Z only!)
+ template <class S, class T> int compareString (const S& lhs, const T& rhs);
+ template <class S, class T> int compareAsciiNoCase(const S& lhs, const T& rhs); //basic case-insensitive comparison (considering A-Z only!)
-struct LessAsciiNoCase //STL container predicate
+ struct LessAsciiNoCase //STL container predicate
{
template <class S> bool operator()(const S& lhs, const S& rhs) const { return compareAsciiNoCase(lhs, rhs) < 0; }
};
@@ -165,21 +165,21 @@ template <class Char> inline
Char asciiToLower(Char c)
{
if (static_cast<Char>('A') <= c && c <= static_cast<Char>('Z'))
- return static_cast<Char>(c - static_cast<Char>('A') + static_cast<Char>('a'));
- return c;
+ return static_cast<Char>(c - static_cast<Char>('A') + static_cast<Char>('a'));
+ return c;
}
-template <class Char> inline
-Char asciiToUpper(Char c)
+ template <class Char> inline
+ Char asciiToUpper(Char c)
{
if (static_cast<Char>('a') <= c && c <= static_cast<Char>('z'))
- return static_cast<Char>(c - static_cast<Char>('a') + static_cast<Char>('A'));
- return c;
+ return static_cast<Char>(c - static_cast<Char>('a') + static_cast<Char>('A'));
+ return c;
}
-namespace impl
+ namespace impl
{
inline int strcmpWithNulls(const char* ptr1, const char* ptr2, size_t num) { return std:: memcmp(ptr1, ptr2, num); } //support embedded 0, unlike strncmp/wcsncmp!
inline int strcmpWithNulls(const wchar_t* ptr1, const wchar_t* ptr2, size_t num) { return std::wmemcmp(ptr1, ptr2, num); } //
@@ -793,10 +793,10 @@ template <class S, class Num> inline
S numberTo(const Num& number)
{
using TypeTag = std::integral_constant<impl::NumberType,
- IsSignedInt <Num>::value ? impl::NumberType::SIGNED_INT :
- IsUnsignedInt<Num>::value ? impl::NumberType::UNSIGNED_INT :
- IsFloat <Num>::value ? impl::NumberType::FLOATING_POINT :
- impl::NumberType::OTHER>;
+ IsSignedInt <Num>::value ? impl::NumberType::SIGNED_INT :
+ IsUnsignedInt<Num>::value ? impl::NumberType::UNSIGNED_INT :
+ IsFloat <Num>::value ? impl::NumberType::FLOATING_POINT :
+ impl::NumberType::OTHER>;
return impl::numberTo<S>(number, TypeTag());
}
@@ -806,10 +806,10 @@ template <class Num, class S> inline
Num stringTo(const S& str)
{
using TypeTag = std::integral_constant<impl::NumberType,
- IsSignedInt <Num>::value ? impl::NumberType::SIGNED_INT :
- IsUnsignedInt<Num>::value ? impl::NumberType::UNSIGNED_INT :
- IsFloat <Num>::value ? impl::NumberType::FLOATING_POINT :
- impl::NumberType::OTHER>;
+ IsSignedInt <Num>::value ? impl::NumberType::SIGNED_INT :
+ IsUnsignedInt<Num>::value ? impl::NumberType::UNSIGNED_INT :
+ IsFloat <Num>::value ? impl::NumberType::FLOATING_POINT :
+ impl::NumberType::OTHER>;
return impl::stringTo<Num>(str, TypeTag());
}
diff --git a/zen/sys_error.h b/zen/sys_error.h
index f3b38250..57503732 100644
--- a/zen/sys_error.h
+++ b/zen/sys_error.h
@@ -85,7 +85,7 @@ std::wstring formatSystemError(const std::wstring& functionName, long long lastE
inline
std::wstring formatSystemError(const std::wstring& functionName, ErrorCode ec)
{
- const std::wstring errorDescr = formatSystemErrorRaw(ec);
+ const std::wstring errorDescr = formatSystemErrorRaw(ec);
const std::wstring errorCode = numberTo<std::wstring>(ec);
//const std::wstring errorCode = printNumber<std::wstring>(L"0x%08x", static_cast<int>(ec));
bgstack15