sphinx-doc / sphinx-doc/sphinx
C++, deduction guides
Open
@jakobandersen is already working on this.
Since Oct 3, 2020.
domains:cpp
type:enhancement
- Dominant language
- Python
- Stars
- 8k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description
C++17 added deduction guides for class templates, https://en.cppreference.com/w/cpp/language/class_template_argument_deduction. It should be possible to document them.
Describe the solution you'd like
I'm not sure how to the should be documented, but I'm currently leaning towards a new directive cpp:deduction-guide. E.g.,
.. cpp:deduction-guide:: template<class Iter> \
container(Iter b, Iter e) -> container<typename std::iterator_traits<Iter>::value_type>;
The rendering should just be of the argument, without extra annotation of the object type.
Additional context
- Initiated by michaeljones/breathe#587
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.
Assessment
This issue has not been assessed yet.