microsoft / microsoft/STL

<tuple>: Consider non-recursive assignment/swap/comparison

Open
#217 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C++
Stars
11.1k
Forks
1.7k
Avg merge
4d 15h
Merged PRs (30d)
22

Description

Our recursive-inheritance tuple implementation has a _This_type typedef and _Get_rest() member function:

https://github.com/microsoft/STL/blob/6b0238d7035236af0f81917262691db701e70fe3/stl/inc/tuple#L229

https://github.com/microsoft/STL/blob/6b0238d7035236af0f81917262691db701e70fe3/stl/inc/tuple#L642-L648

They're used to implement assignment, swap, and comparison recursively:

https://github.com/microsoft/STL/blob/6b0238d7035236af0f81917262691db701e70fe3/stl/inc/tuple#L610-L618

It could be simpler (and better for throughput) to implement this non-recursively with pack expansions.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in stl/inc/tuple at the referenced _This_type, _Get_rest(), and assignment, swap, and comparison implementations. Review how the recursive operations are structured, then assess a pack-expansion-based replacement while preserving the existing tuple behavior and standard-library requirements. The issue is complete when these operations no longer depend on recursive implementation and their behavior remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.