Questions tagged [string-view]

A string_view is a C++ class template that is a non-owning reference to a string.

Reference: http://en.cppreference.com/w/cpp/experimental/basic_string_view

138 questions
-1
votes
1 answer

Is there really no explicit constructor of std::string from an std::string_view?

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…
einpoklum
  • 86,754
  • 39
  • 223
  • 453
-3
votes
1 answer

basic_string to basic_string_view Implicit Conversion... ughhh why?

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…
user9816683
  • 107
  • 4
-4
votes
2 answers

std::string_view with C Fuction

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() { …
JuliusCaesar
  • 321
  • 1
  • 11
1 2 3
9
10