Imported Upstream version 1.8.15
[platform/upstream/doxygen.git] / testing / 070_ref_variadic_template.cpp
1 // objective: test \ref command with a variadic template function
2 // check: 070__ref__variadic__template_8cpp.xml
3
4 /** \file
5  *
6  *  @attention
7  *  @parblock
8  *  At the time of writing, the part between \<\> is totally ignored:
9  *  %func<Args...>(Args... args) is interpreted as %func(Args... args).
10  *
11  *  Beware that a function parameter with either a \& or \* operator,
12  *  e.g. 'const Args&... args', requires \\link and \\ref to specify
13  *  such parameter as verbatim, i.e. 'const Args&... args'.  At the
14  *  time of writing, the form %func(const Args&...) will fail, unless
15  *  the function parameter was declared just as 'const Args&...'.
16  *  @endparblock
17  *
18  *  \ref Test::func(int,Args...)const "variadic template method"
19  *
20  *  References to the variadic template function overloads:
21  *    @li \ref func(int,Args&... args) "First overload"
22  *    @li \ref func(int,Args&&... args) "Second overload"
23  *    @li \ref func(int,const Args&... args) "Third overload"
24  *    @li \ref func(int,const Args&&... args) "Fourth overload"
25  *    @li \ref func(int,Args*... args) "Fifth overload"
26  *    @li \ref func(int,Args**... args) "Sixth overload"
27  *    @li \ref func(int,const Args*... args) "Seventh overload"
28  *    @li \ref func(int,const Args**... args) "Eighth overload"
29  *    @li \ref func(int,Args...) "Ninth overload"
30  *
31  *  The followings are interpreted the same:
32  *    @li \ref func(int,const Args&... args) "without template argument"
33  *    @li \ref func<Args...>(int,const Args&... args) "with template argument"
34  *
35  *  See the \ref Test "test" class.
36  */
37
38 /** A function
39  */
40 void func(int p);
41
42 /** A variadic template function overload
43  */
44 template <typename... Args>
45 void func(int p, Args&... args);
46
47 /** A variadic template function overload
48  */
49 template <typename... Args>
50 void func(int p, Args&&... args);
51
52 /** A variadic template function overload
53  */
54 template <typename... Args>
55 void func(int p, const Args&... args);
56
57 /** A variadic template function overload
58  */
59 template <typename... Args>
60 void func(int p, const Args&&... args);
61
62 /** A variadic template function overload
63  */
64 template <typename... Args>
65 void func(int p, Args*... args);
66
67 /** A variadic template function overload
68  */
69 template <typename... Args>
70 void func(int p, Args**... args);
71
72 /** A variadic template function overload
73  */
74 template <typename... Args>
75 void func(int p, const Args*... args);
76
77 /** A variadic template function overload
78  */
79 template <typename... Args>
80 void func(int p, const Args**... args);
81
82 /** A variadic template function overload
83  */
84 template <typename... Args>
85 void func(int p, Args... args);
86
87 /** A test */
88 class Test
89 {
90  public:
91   /** A variadic template method
92    */
93   template <typename... Args>
94   void func(int p, Args... args) const;
95 };