Example: String Split
Here, we'll determine whether string_view can be used for splitting a string into several view objects.
string_view
might be a potential optimization for string splitting. If you own a lar​ge persistent string, you might want to create a list of string_view objects that maps words of that larger string.
Note: The code is inspired by the article by Marco Arena - string_view odi et amo1.
Get hands-on with 1400+ tech skills courses.