microsoft / STL

MSVC's implementation of the C++ Standard Library.
Other
10.21k stars 1.51k forks source link

STL: Consider replacing uses of _Compressed_pair with tuple #197

Open CaseyCarter opened 5 years ago

CaseyCarter commented 5 years ago

Once tuple "compresses" empty objects, we can likely simplify metaprogramming (for example, in the forwarding call wrappers https://github.com/microsoft/STL/pull/158#discussion_r336827719) by using tuple instead of _Compressed_pair.

vNext note: Resolving this issue will require breaking binary compatibility. We won't be able to accept pull requests for this issue until the vNext branch is available. See #169 for more information.

frederick-vs-ja commented 1 year ago

This seemly damages throughput, since tuple has a large number of constructors (and the number has increased in C++23) that might be not intentionally used as implementation details.

I suggest using a simplified version of tuple as implementation details of both tuple and other components.

philnik777 commented 1 year ago

Or, given that this is vNext anyways, use [[no_unique_address]] to make your code simpler and faster to compile.