cldoc
cldoc copied to clipboard
Support variadic template parameters
Example code (copy paste into a file and run cldoc on it, works as is):
#include <type_traits>
template <class... Ts> struct list;
// A list of types <Ts...>
//
// @Ts... types in the list
template <class... Ts> struct list
{
// @return size of the list
static constexpr std::size_t size() { return sizeof...(Ts); }
};
This generates the following documentation:
Structures
list<Ts, Ts> // A list of types <Ts...>
Then when clicking on list:
Struct list<Ts, Ts> A list of types <Ts...>
Template Parameters Ts Ts
Member Functions
static size_t size ( ) Size of the list return size of the list
The following is (in my opinion) wrong (each of these should be a separate issue):
- It should be
list<Ts...>, - the reference for
<Ts...>in the comment should work - the documentation for the template parameter pack should work
- constexpr is not documented, IMO the cleanest is to just present the function signature as is:
static constexpr size_t size();
Confirmed in latest master.
Template parameter packs are not displayed as parameter packs, but are duplicated, e.g.
template <typename ... Ts>
struct TypeList;
is documented as
Struct TypeList<Types, Types>
...actually, the duplication seems to be more general than this. Will file or update a separate issue.