Part 0/3 is D50119: it adds __has_extension(__is_trivially_relocatable) to the compiler.
Part 1/3 is D61761: it implements the library traits and algorithms mandated by P1144.
Part 2/3 is D63620: it implements Quality-of-Implementation features to warrant certain std library types as "trivially relocatable."
Part 3/3 is D67524: it implements Quality-of-Implementation features to optimize certain std library functions for better performance on types that have been warranted "trivially relocatable."
This implements the library behavior proposed in P1144R3. This patch doesn't do any special optimizations (e.g. to std::vector::reserve) nor add warrants to libc++ class types; those will come later. This is just the bare minimum to conform to P1144's additions to the standard.
We mangle relocate_at into __libcpp_relocate_at, and so on, in order to discourage users from using them. (The intent is that libc++ itself will be able to use them to enable optimizations. Such optimizations are the point of D67524.)
TODO:
- any reason to gate the new names on any particular _LIBCPP_STD_VER, such as 17? (I think not.)
- do the tests pass with a compiler that doesn't support __has_extension(__is_trivially_relocatable)? how best to structure the tests so as not to break this?