Some (many?) programmers who are introduced to both std::string_view and std::string ask themselves: "Why can I convert the latter into the former, but not the other way around?"
One part of the question is answered here:
Why is there no implicit…
The C++ Standards Committee had an opportunity to make code safer with string_view but they opted to add implicit conversion from basic_string to basic_string_view.
So effectively, they're saying this
// No worries, everyone always reads the…
I'm using some C Leagacy Code within a C++ project.
On used C function looks like this
void Add_To_log(const * const char pString_1, const * const char pString_2, int number);
Now when I call this Functions from C++ Code like this
foo()
{
…