microsoft / microsoft/STL

<range_algorithm_support.hpp>: Rework the handling of test::iterator references

Open
#1,761 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

test::ProxyRef is a scoped enumeration used to tell test::iterator what kind of reference type you'd like it to have. Before implementing join_view, test::ProxyRef::no would produce iterators with lvalue reference types, and test::ProxyRef::yes iterators that used test::proxy_reference as their reference type. To fully exercise join_view we needed to add support for prvalue reference types, so we hacked up enum class ProxyRef { no, yes, prvalue } which is completely unintuitive.

We should replace test::ProxyRef with the fully-general enum class RefStyle { lvalue, xvalue, prvalue, proxy } with what I hope are the obvious semantics.

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

Locate the definitions and uses of test::ProxyRef and test::iterator, then read how the current enum values select reference types. Replace the enum and its usages with RefStyle values for lvalue, xvalue, prvalue, and proxy, and verify that the iterator test coverage still exercises the intended reference styles for join_view.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
testing-qa
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 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.