[do not merge] Implement P1144 trivially-relocatable for indirect and polymorphic - #345
[do not merge] Implement P1144 trivially-relocatable for indirect and polymorphic#345Quuxplusone wants to merge 4 commits into
indirect and polymorphic#345Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #345 +/- ##
=======================================
Coverage 98.67% 98.67%
=======================================
Files 7 7
Lines 605 605
=======================================
Hits 597 597
Misses 8 8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Added an issue to track adding further unit-test support: #347 |
|
Added an issue to track adding tests bases on |
|
Regarding the comment on various versions of polymorphic...
What can we do to make this clearer? Should a note be added to the readme on the different implementations? Basically, there are 4 versions:
The 2 versions in experimentation were provided because questions we made about whether either of these approaches should be preferred during discussion of the designs at LEWG. The intention in supporting these is the design space is fully explored. Please let me know if you have any questions or if there are any actions we can take to better document the purpose of supporting these. |
1d1a133 to
102bf28
Compare
indirect and polymorphicindirect and polymorphic
|
@jbcoe @Twon fyi, llvm/llvm-project#84621 is in review right now, to implement |
|
Closing as P1144 is not the direction chosen by the C++ standards committee. |
This is my take on #302, just to have a "clean copy." I would like it merged, but I expect it to be closed, per the discussion on #302 about not wanting to maintain the extra complexity. (My goal is just to record this branch history in a neat place for any posterity who want to play with it on Godbolt.)
I've added the same logic for
polymorphic<T>. (#302 did it only forindirect<T>.)While doing this, I noticed:
is_nothrow_move_constructible,!is_trivially_fooable, etc. I think such unit tests should be added.indirect<T>correctly usesallocator_traits<A>::pointer, butpolymorphic<T>hard-codescblock_t*instead ofallocator_traits<A>::rebind_alloc<cblock_t>::pointer. This meanspolymorphic<T>isn't compatible with Boost.Interprocessoffset_ptrallocators. I could work up such a PR if you're interested; but (next bullet)XYZ_HAS_STD_OPTIONAL(invariably true in C++17 and later) in "indirect_test.cc" (requires C++20 or later); these could perhaps be removed, unless the plan is to backportindirectto C++14-or-earlier just likepolymorphicwas backported.