4 ms·
Not sure why you brought the STL in to it. Copying a std::string is as easy as assigning the variable, or calling the assign function with a char* and length
by nly 5y ago
Not sure why you brought the STL in to it. Copying a std::string is as easy as assigning the variable, or calling the assign function with a char* and length
- jstimpfle 5y agoHowever, that will require a 1000s of SLOC implementation of a weird class type with lots of subtle semantics, and a generally inefficient behaviour (small heap allocations).
- forrestthewoods 5y agoI’m asserting that the CRT API design is bad. And following up that C++’s isn’t any better. std::string does better facilitate copying strings. But string manipulation with std::string is really really bad. I’m also saying that the concept of defining an API but not providing an implementation is insane. That is, imho, extremely inappropriate at the language level. Differences in behavior between C and C++ STL implementations on different platforms is infamous. And almost entirely unnecessary.