Added two new traits and a way to specify them
Summary: Added IsBits (has value semantics; can be copied by memcpy and deleted by free. Implies IsRelocatable) and Is0Initializable (new (ptr) T() is equivalent to memset(ptr, 0, sizeof(T))). Converted the boost types for IsRelocatable to std types (now available from <type_traits>). Added a new way to specify IsRelocatable, IsBits, and Is0Initializable: typedef std::true_type <property-name> in your class. No namespace exiting required. This method also supports inheritance, and may be overriden in base classes. Added a test file to test Traits. Test Plan: Run new test file. Compile some real-world code (in my case, multifeed). Reviewed By: andrei.alexandrescu@fb.com FB internal diff: D610996
Showing
folly/test/TraitsTest.cpp
0 → 100644
Please register or sign in to comment