diff options
author | Yuri Gorshenin <y@maps.me> | 2016-08-22 16:38:25 +0300 |
---|---|---|
committer | Yuri Gorshenin <y@maps.me> | 2016-08-22 16:58:26 +0300 |
commit | f53fb5454b11150cdb857d8200b20ae4c659a9ef (patch) | |
tree | 7af39b908a9cb9bddc0b0fca34f4c7eaecb35e11 /base | |
parent | 40b6dab6f3acff8a04cd760bbc7c9a339d2b966d (diff) |
[build] Build fix for libstdc++.
Diffstat (limited to 'base')
-rw-r--r-- | base/base_tests/string_utils_test.cpp | 4 | ||||
-rw-r--r-- | base/string_utils.hpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/base/base_tests/string_utils_test.cpp b/base/base_tests/string_utils_test.cpp index 7612468777..6d09bd530d 100644 --- a/base/base_tests/string_utils_test.cpp +++ b/base/base_tests/string_utils_test.cpp @@ -7,7 +7,6 @@ #include "std/fstream.hpp" #include "std/iomanip.hpp" #include "std/map.hpp" -#include "std/type_traits.hpp" #include "std/unordered_map.hpp" #include "std/vector.hpp" @@ -459,9 +458,6 @@ UNIT_TEST(Tokenize) TEST_EQUAL(strings::Tokenize<vector>("acb def ghi", " " /* delims */), vector<string>(expected), ()); TEST_EQUAL(strings::Tokenize<set>("acb def ghi", " " /* delims */), set<string>(expected), ()); } - { - static_assert(is_same<vector<string>, decltype(strings::Tokenize("", ""))>::value); - } } UNIT_TEST(LastUniChar) diff --git a/base/string_utils.hpp b/base/string_utils.hpp index 8d7c37e8a6..179a5d560b 100644 --- a/base/string_utils.hpp +++ b/base/string_utils.hpp @@ -10,6 +10,7 @@ #include "std/regex.hpp" #include "std/sstream.hpp" #include "std/string.hpp" +#include "std/type_traits.hpp" #include "3party/utfcpp/source/utf8/unchecked.h" @@ -315,6 +316,9 @@ Collection<string> Tokenize(string const & str, char const * delims) return c; } +static_assert(is_same<vector<string>, decltype(strings::Tokenize("", ""))>::value, + "Tokenize() should return vector<string> by default."); + /// Splits a string by the delimiter, keeps empty parts, on an empty string returns an empty vector. /// Does not support quoted columns, newlines in columns and escaped quotes. void ParseCSVRow(string const & s, char const delimiter, vector<string> & target); |