isocpp / isocpp/CppCoreGuidelines
Is gsl::narrow intended to work with custom arithmetic types?
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 45.3k
- Forks
- 5.6k
- PR merge metrics
- No merged PRs in 30d
Description
An issue ( Microsoft/gsl#990 ) was recently filed in the Microsoft GSL repository, requesting additional support for gsl::narrow on custom arithmetic types. Do the CppCoreGuidelines intend for narrow to support custom arithmetic types.
Also should enums be considered for this narrow support as well? Should narrow be allow to cast from a scoped enum to a different type than its underlying type directly?
Link to the users proof of concept: https://github.com/microsoft/GSL/issues/990#issuecomment-891246530
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 the linked Microsoft GSL issue and its proof of concept, then review the question about gsl::narrow support for custom arithmetic types and scoped enums. Done means reaching and recording a clear decision about the intended support and casting behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100