Answer the question
In order to leave comments, you need to log in
Difference between string_view and const string_view&?
What is the difference between string_view
or const string_view&
in function arguments?
Does it make sense to use const string_view&
instead of string_view
?
As I understand it, string_view
this is a wrapper over the pointer char*
.
It turns out that the argument string_view
will copy the pointer to char*
, but const string_view&
refer to the pointer?
For years I have used in arguments for strings. I started to join new features and I don’t understand where to stick it . It seems that he wrote, but the hand itself reaches out to remakeconst string&
string_view
const string_view&
Answer the question
In order to leave comments, you need to log in
What is the difference between string_view or const string_view& in function arguments?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question