[libcxx-commits] [PATCH] D61139: (ABI break) Remove could-be-defaulted SMFs from `stack` and `queue` and `priority_queue`.

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Apr 30 13:34:42 PDT 2019


Quuxplusone added a comment.

@ldionne: I think adding the macro `_LIBCPP_ABI_CONTAINER_ADAPTERS_ALWAYS_NONTRIVIAL` makes the code "more complicated" because then there will be two different codepaths in need of testing.

If we completely gave up on my original ABI-breaking perf-improvement idea, and just eliminated all the SMFs except a simple `~queue() {}  /* deliberately not =default'ed */` to ward off the perf improvement... I do think that would be simpler.  But you'd have to `=default` all the other SMFs anyway, because user-providing the destructor causes the move operations to disappear.

However! I think the problem with that idea is that it would make `std::stack<int, fixed_capacity_vector<int, 10>>` no longer trivially-destructible! Right now it's not trivially copyable but it is trivially destructible; after your idea, it would remain non-trivially copyable but it would no longer be trivially destructible. So your idea would sadly be a perf //regression//, not merely the desired perf non-improvement. :(


Repository:
  rCXX libc++

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61139/new/

https://reviews.llvm.org/D61139





More information about the libcxx-commits mailing list