I am aware that std::string_view
is a non-owning reference to a string and the major differences between std::string_view
and std::string
are
Now, Why std::string_view is not applicable to other types ? or why this implementation is specific ONLY to std::string
?
For Example : if we have similar <T>generic_view
where T
can be of any type including custom types.
With this, instead of using const T&
as function argument, <T>generic_view
can be used. And also other advantages of std::string_view
will be useful like Allocation, Copying etc..