diff options
author | Daniel Wilhelm <daniel@wili.li> | 2015-10-02 14:53:20 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2015-10-02 14:53:20 +0200 |
commit | 94db751716dd2851f99b5c4c2981da1d1f4780f8 (patch) | |
tree | e4ffc9f5ae2b2873f267a6e5d3d2092c8aad49a7 /zen/string_traits.h | |
parent | 6.10 (diff) | |
download | FreeFileSync-94db751716dd2851f99b5c4c2981da1d1f4780f8.tar.gz FreeFileSync-94db751716dd2851f99b5c4c2981da1d1f4780f8.tar.bz2 FreeFileSync-94db751716dd2851f99b5c4c2981da1d1f4780f8.zip |
6.11
Diffstat (limited to 'zen/string_traits.h')
-rw-r--r-- | zen/string_traits.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/zen/string_traits.h b/zen/string_traits.h index 69c1fbc8..ba97397c 100644 --- a/zen/string_traits.h +++ b/zen/string_traits.h @@ -8,8 +8,6 @@ #define STRING_TRAITS_HEADER_813274321443234 #include "type_tools.h" -#include "assert_static.h" - //uniform access to string-like types, both classes and character arrays namespace zen @@ -165,7 +163,11 @@ namespace implementation template <class C> inline size_t cStringLength(const C* str) //naive implementation seems somewhat faster than "optimized" strlen/wcslen! { - assert_static((IsSameType<C, char>::value || IsSameType<C, wchar_t>::value)); +#if defined _MSC_VER && _MSC_VER > 1800 + static_assert(false, "strlen/wcslen are vectorized in VS14 CTP3 -> test again!"); +#endif + + static_assert(IsSameType<C, char>::value || IsSameType<C, wchar_t>::value, ""); size_t len = 0; while (*str++ != 0) ++len; @@ -184,8 +186,8 @@ inline const char* strBegin(const char* str) { return str; } inline const wchar_t* strBegin(const wchar_t* str) { return str; } inline const char* strBegin(const char& ch) { return &ch; } inline const wchar_t* strBegin(const wchar_t& ch) { return &ch; } -inline const char* strBegin(const StringRef<char >& ref) { return ref.data(); } -inline const wchar_t* strBegin(const StringRef<wchar_t>& ref) { return ref.data(); } +inline const char* strBegin(const StringRef<char >& ref) { return ref.data(); } +inline const wchar_t* strBegin(const StringRef<wchar_t>& ref) { return ref.data(); } template <class S> inline |