sphinx-doc / sphinx-doc/sphinx

C++, deduction guides

Open
#8,271 0 comments 1 reaction 1 assignee View on GitHub

@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

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.