Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support variadic template parameters #79

Open
gnzlbg opened this issue Jan 29, 2015 · 2 comments
Open

Support variadic template parameters #79

gnzlbg opened this issue Jan 29, 2015 · 2 comments

Comments

@gnzlbg
Copy link

gnzlbg commented Jan 29, 2015

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();

@cbiffle
Copy link

cbiffle commented Jul 13, 2015

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>

@cbiffle
Copy link

cbiffle commented Jul 13, 2015

...actually, the duplication seems to be more general than this. Will file or update a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants