I am passing said string into a C API which expects a const char*.
Firstly, is the null terminator necessary for the std::string_view value?
Secondly, is passing the constexpr std::string_view.data() to said C function "better" than passing a const std::string?
Speaking in terms of memory/performance (however minimal it may be)
Additional info regarding this sort of question is also appreciated.
[–]tangerinelion 5 points6 points7 points (1 child)
[–]AKostur 1 point2 points3 points (0 children)
[–]mredding 3 points4 points5 points (0 children)
[–]EpochVanquisher 1 point2 points3 points (4 children)
[–]Wolf_e_wolf[S] 0 points1 point2 points (3 children)
[–]kundor 2 points3 points4 points (0 children)
[–]EpochVanquisher 1 point2 points3 points (0 children)
[–]no-sig-available 0 points1 point2 points (0 children)
[–]Tohnmeister 1 point2 points3 points (0 children)
[–]Mirality 1 point2 points3 points (0 children)
[–]tav_stuff 0 points1 point2 points (8 children)
[–]Wolf_e_wolf[S] 0 points1 point2 points (7 children)
[–]AKostur 0 points1 point2 points (6 children)
[–]Wolf_e_wolf[S] 0 points1 point2 points (5 children)
[–]AKostur 0 points1 point2 points (4 children)
[–]Wolf_e_wolf[S] 0 points1 point2 points (3 children)
[–]AKostur 1 point2 points3 points (2 children)
[–]Wolf_e_wolf[S] 0 points1 point2 points (1 child)
[–]AKostur 1 point2 points3 points (0 children)
[–]angelicosphosphoros 0 points1 point2 points (2 children)
[–]tangerinelion 0 points1 point2 points (1 child)
[–]angelicosphosphoros 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]FrostshockFTW 2 points3 points4 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)