mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 16:48:19 +00:00
Make char*/wchar_t* split methods use string_view/wstring_view
This commit is contained in:
parent
b41a4bf06d
commit
701fc3654a
2 changed files with 6 additions and 6 deletions
|
@ -2716,8 +2716,8 @@ TEST_CASE("util filesystem")
|
|||
|
||||
TEST_CASE("util split")
|
||||
{
|
||||
using str_vec = std::vector<std::string>;
|
||||
using wstr_vec = std::vector<std::wstring>;
|
||||
using str_vec = std::vector<std::string_view>;
|
||||
using wstr_vec = std::vector<std::wstring_view>;
|
||||
|
||||
SUBCASE("w/ delim")
|
||||
{
|
||||
|
|
|
@ -612,14 +612,14 @@ template <typename T, typename U = typename T::value_type*> std::vector<T> split
|
|||
return split(s, T{delim});
|
||||
}
|
||||
|
||||
inline std::vector<std::string> split(const char* s, const char* delim)
|
||||
inline std::vector<std::string_view> split(const char* s, const char* delim)
|
||||
{
|
||||
return split(std::string(s), std::string(delim));
|
||||
return split(std::string_view(s), std::string_view(delim));
|
||||
}
|
||||
|
||||
inline std::vector<std::wstring> split(const wchar_t* s, const wchar_t* delim)
|
||||
inline std::vector<std::wstring_view> split(const wchar_t* s, const wchar_t* delim)
|
||||
{
|
||||
return split(std::wstring(s), std::wstring(delim));
|
||||
return split(std::wstring_view(s), std::wstring_view(delim));
|
||||
}
|
||||
|
||||
} // namespace util
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue