File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -665,10 +665,10 @@ sz::string haystack = "some string";
665
665
sz::string_view needle = sz::string_view(haystack).substr(0, 4);
666
666
667
667
auto substring_position = haystack.find(needle); // Or `rfind`
668
- auto hash = std::hash<sz::string_view>(haystack); // Compatible with STL's `std::hash`
668
+ auto hash = std::hash<sz::string_view>{} (haystack); // Compatible with STL's `std::hash`
669
669
670
670
haystack.end() - haystack.begin() == haystack.size(); // Or `rbegin`, `rend`
671
- haystack.find_first_of(" \w \t") == 4; // Or `find_last_of`, `find_first_not_of`, `find_last_not_of`
671
+ haystack.find_first_of(" \v \t") == 4; // Or `find_last_of`, `find_first_not_of`, `find_last_not_of`
672
672
haystack.starts_with(needle) == true; // Or `ends_with`
673
673
haystack.remove_prefix(needle.size()); // Why is this operation in-place?!
674
674
haystack.contains(needle) == true; // STL has this only from C++ 23 onwards
You can’t perform that action at this time.
0 commit comments