`<utility>`: Is extending triviality for `pair` and `tuple` on the list of improvements for vNext?
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 11.2k
- Forks
- 1.7k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 22
Description
static_assert(std::is_trivially_copy_assignable_v<std::tuple<int, int>>); // fails
static_assert(std::is_trivially_copy_constructible_v<std::tuple<int, int>>); // fails
static_assert(std::is_trivially_copy_assignable_v<std::pair<int, int>>); // fails
static_assert(std::is_trivially_copy_constructible_v<std::pair<int, int>>); // passes
Current the implementation of pair and tuple is not trivially copy constructible and assignable when their underlying types are, which I assume hinders performance and certain optimizations - which is a shame since they should be zero cost abstractions. Implementing this improvement is an obvious ABI break and I believe it would require rewriting a big chunk of the tuple implementation. I was wondering if this improvement is considered in the vNext abi break - I know tuple compresssion of empty types is, but I haven't seen any discurssion on this.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No implementation file or test is named. Start by locating the std::pair and std::tuple implementations and reviewing the repository’s vNext ABI-break discussion, then determine whether trivial copy construction and assignment can be added without violating the ABI plan. Done means a decided scope and corresponding implementation and regression tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100