microsoft / microsoft/STL

`<iomanip>`: Should the `operator<<` for the return types of `quoted` be SFINAE-friendly?

Open
#5,694 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Currently, this operator<< for _Quote_out is not constrained for type matching.

https://github.com/microsoft/STL/blob/023485cbe20df212bd21626d94f27619302d5809/stl/inc/iomanip#L184-L189

So when one attempts to detect operator<< via SFINAE, there will be false positive. This is the cause of the following test failure:

https://github.com/microsoft/STL/blob/023485cbe20df212bd21626d94f27619302d5809/tests/libcxx/expected_results.txt#L1164-L1165

In the current standard wording, it's unspecified whether the operator<< is SFINAE-friendly. I guess it's fine to leave such SFINAE-friendliness for QoI and no LWG issue is necessary.

While the libc++ test is somehow bogus and should be fixed, should we constrain the operator<< like libc++?

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

Read the _Quote_out operator<< implementation in stl/inc/iomanip at lines 184-189, then inspect the failing libc++ expectations in tests/libcxx/expected_results.txt at lines 1164-1165. Determine whether constraining the operator for type matching is appropriate despite the standard wording, and verify that operator detection no longer produces the reported false positive.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
devtools, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
43/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.