3 ms·
C++23’s New Function Syntax
- MontyCarloHall 4y agoI haven’t really followed the evolution (and apparent dramatic increase in complexity) of C++ since C++11 or so. What does all the additional complex syntax give us that plain old std::string say_a_to(std::string what, std::string name) { return what + ", " + name + "!"; } does not?
- stefanos82 4y agostd::string allocates heap memory; usually it's implemented as std::vector<char> behind the scenes, whereas with string_view it's implemented as const char *, thus the string it's allocated in stack.