Extend resizeWithoutInitialization() to support any std::basic_string<T> (#1339)
Summary: Currently `folly/memory/UninitializedMemoryHacks.h`'s `resizeWithoutInitialization()` is able to do its job for `std::vector<T>` and `std::string` only. This PR extends it to support `std::basic_string<T>`. Effectively, replicated the machinery pattern used to achieve the same for any `std::vector<T>`. Added test cases too, however the test executable is not being built by the `CMakeLists.txt` (had to enable it locally for testing.) Is there any particular reason why these tests for `folly/memory/UninitializedMemoryHacks.h` are not built/run by default? `folly/memory/test/UninitializedMemoryHacksODR.cpp` `folly/memory/test/UninitializedMemoryHacksTest.cpp` Pull Request resolved: https://github.com/facebook/folly/pull/1339 Reviewed By: Mizuchi Differential Revision: D20603510 Pulled By: yfeldblum fbshipit-source-id: dc92ca71cab6a76e2d93c2bbcb4a325bcd70468c
Showing
Please register or sign in to comment