`<chrono>`: Need more robust handling of custom arithmetic types
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 11.2k
- Forks
- 1.7k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 22
Description
Observed by @statementreply.
In general, we currently do not robustly handle custom arithmetic-like types. Note that we expect this use case to be very uncommon, so this is not a high-priority bug.
Until this is completely addressed, we should make sure to at least fail cleanly if custom arithmetic-like types are used. As an example, we currently use _STD nextafter on a duration::rep that could potentially be a custom arithmetic-like type, in which case it would fail cleanly.
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 with stl/inc/chrono around lines 3243-3246 and read the linked discussion in microsoft/STL#1671. Determine how custom arithmetic-like duration::rep types should fail cleanly when passed to _STD nextafter, then verify the behavior against relevant chrono coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100