3 ms·
folly provides functions to resize std::string & std::vector without initialization [0]. [0] https://github.com/facebook/folly/blob/3c8829785e3ce86cb821cc87853
by terrelln 3y ago
folly provides functions to resize std::string & std::vector without initialization [0].
[0] https://github.com/facebook/folly/blob/3c8829785e3ce86cb821cc87853cfd2b823c6a13/folly/memory/UninitializedMemoryHacks.h#L49-L51 https://github.com/facebook/folly/blob/3c8829785e3ce86cb821c...
- jeffbee 3y agoYeah, it's nice! And Abseil does it, IFF you use LLVM libc++. https://github.com/abseil/abseil-cpp/blob/master/absl/strings/internal/resize_uninitialized.h https://github.com/abseil/abseil-cpp/blob/master/absl/string... The standard adopted it as resize_and_overwrite. Which I think is a little clunky.