summaryrefslogtreecommitdiffstats
path: root/testing/069_link_variadic_template.cpp
blob: 89ab57c36631fb1ff73da166e1e493c1085d8d1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// objective: test \link command with a variadic template function
// check: 069__link__variadic__template_8cpp.xml

/** \file
 *
 *  @attention
 *  @parblock
 *  At the time of writing, the part between \<\> is totally ignored:
 *  %func<Args...>(Args... args) is interpreted as %func(Args... args).
 *
 *  Beware that a function parameter with either a \& or \* operator,
 *  e.g. 'const Args&... args', requires \\link and \\ref to specify
 *  such parameter as verbatim, i.e. 'const Args&... args'.  At the
 *  time of writing, the form %func(const Args&...) will fail, unless
 *  the function parameter was declared just as 'const Args&...'.
 *  @endparblock
 *
 *  \link Test::func(int,Args...)const variadic template method\endlink
 *
 *  Links to the variadic template function overloads:
 *    @li \link func(int,Args&... args) First overload\endlink
 *    @li \link func(int,Args&&... args) Second overload\endlink
 *    @li \link func(int,const Args&... args) Third overload\endlink
 *    @li \link func(int,const Args&&... args) Fourth overload\endlink
 *    @li \link func(int,Args*... args) Fifth overload\endlink
 *    @li \link func(int,Args**... args) Sixth overload\endlink
 *    @li \link func(int,const Args*... args) Seventh overload\endlink
 *    @li \link func(int,const Args**... args) Eighth overload\endlink
 *    @li \link func(int,Args...) Ninth overload\endlink
 *
 *  The followings are interpreted the same:
 *    @li \link func(int,const Args&... args) without template argument\endlink
 *    @li \link func<Args...>(int,const Args&... args) with template argument\endlink
 *
 *  See the \link Test test\endlink class.
 */

/** A function
 */
void func(int p);

/** A variadic template function overload
 */
template <typename... Args>
void func(int p, Args&... args);

/** A variadic template function overload
 */
template <typename... Args>
void func(int p, Args&&... args);

/** A variadic template function overload
 */
template <typename... Args>
void func(int p, const Args&... args);

/** A variadic template function overload
 */
template <typename... Args>
void func(int p, const Args&&... args);

/** A variadic template function overload
 */
template <typename... Args>
void func(int p, Args*... args);

/** A variadic template function overload
 */
template <typename... Args>
void func(int p, Args**... args);

/** A variadic template function overload
 */
template <typename... Args>
void func(int p, const Args*... args);

/** A variadic template function overload
 */
template <typename... Args>
void func(int p, const Args**... args);

/** A variadic template function overload
 */
template <typename... Args>
void func(int p, Args... args);

/** A test */
class Test
{
 public:
  /** A variadic template method
   */
  template <typename... Args>
  void func(int p, Args... args) const;
};