I've got the following method which gets std::string
as input argument.
int func(const std::string &filename);
From it's signature, the input type refers passed by reference (no copy is made) and shouldn't be changed (by the const
prefix).
Would it be equivalent of using std::string_view
instead, which is also used for read only ?
int func(std::string_view filename);
And if not, so in which aspect they're not similar (runtime, memory consumption, functionality, etc.)