<complex>: Investigate simplifying complex<NonFloating>
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 11.1k
- Forks
- 1.7k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 22
Description
The primary template for _Ctraits<_Ty> is used for _Ty other than float, double, and long double:
Therefore, it's very weird - WG21-N4861 26.4 [complex.numbers]/2 says "The effect of instantiating the template complex for any type other than float, double, or long double is unspecified." Based on this code, I believe that we have non-Standard support for complex<int> etc. (Gaussian integers):
https://github.com/microsoft/STL/blob/852a3085906108045a3951064baaf4952f596e9e/stl/inc/complex#L1815-L1817
Because this is ancient, I suspect that removing our non-Standard support for complex<Integral> would break a lot of code. However, we could investigate simplifying the machinery here, as long as we're careful to preserve the runtime behavior.
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
Start by reading stl/inc/complex around lines 57-170 and 1815-1817, then trace how _Ctraits<_Ty> supports complex integral types. Compare the existing behavior with the standard's unspecified status and determine whether the machinery can be simplified without changing runtime behavior. Done means a justified simplification plan or implementation that preserves the relevant behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- devtools
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100