|
Than Ngo |
b7bcaa |
// objective: test \ref command with a variadic template function
|
|
Than Ngo |
b7bcaa |
// check: 070__ref__variadic__template_8cpp.xml
|
|
Than Ngo |
b7bcaa |
|
|
Than Ngo |
b7bcaa |
/** \file
|
|
Than Ngo |
b7bcaa |
*
|
|
Than Ngo |
b7bcaa |
* @attention
|
|
Than Ngo |
b7bcaa |
* @parblock
|
|
Than Ngo |
b7bcaa |
* At the time of writing, the part between \<\> is totally ignored:
|
|
Than Ngo |
b7bcaa |
* %func<Args...>(Args... args) is interpreted as %func(Args... args).
|
|
Than Ngo |
b7bcaa |
*
|
|
Than Ngo |
b7bcaa |
* Beware that a function parameter with either a \& or \* operator,
|
|
Than Ngo |
b7bcaa |
* e.g. 'const Args&... args', requires \\link and \\ref to specify
|
|
Than Ngo |
b7bcaa |
* such parameter as verbatim, i.e. 'const Args&... args'. At the
|
|
Than Ngo |
b7bcaa |
* time of writing, the form %func(const Args&...) will fail, unless
|
|
Than Ngo |
b7bcaa |
* the function parameter was declared just as 'const Args&...'.
|
|
Than Ngo |
b7bcaa |
* @endparblock
|
|
Than Ngo |
b7bcaa |
*
|
|
Than Ngo |
b7bcaa |
* \ref Test::func(int,Args...)const "variadic template method"
|
|
Than Ngo |
b7bcaa |
*
|
|
Than Ngo |
b7bcaa |
* References to the variadic template function overloads:
|
|
Than Ngo |
b7bcaa |
* @li \ref func(int,Args&... args) "First overload"
|
|
Than Ngo |
b7bcaa |
* @li \ref func(int,Args&&... args) "Second overload"
|
|
Than Ngo |
b7bcaa |
* @li \ref func(int,const Args&... args) "Third overload"
|
|
Than Ngo |
b7bcaa |
* @li \ref func(int,const Args&&... args) "Fourth overload"
|
|
Than Ngo |
b7bcaa |
* @li \ref func(int,Args*... args) "Fifth overload"
|
|
Than Ngo |
b7bcaa |
* @li \ref func(int,Args**... args) "Sixth overload"
|
|
Than Ngo |
b7bcaa |
* @li \ref func(int,const Args*... args) "Seventh overload"
|
|
Than Ngo |
b7bcaa |
* @li \ref func(int,const Args**... args) "Eighth overload"
|
|
Than Ngo |
b7bcaa |
* @li \ref func(int,Args...) "Ninth overload"
|
|
Than Ngo |
b7bcaa |
*
|
|
Than Ngo |
b7bcaa |
* The followings are interpreted the same:
|
|
Than Ngo |
b7bcaa |
* @li \ref func(int,const Args&... args) "without template argument"
|
|
Than Ngo |
b7bcaa |
* @li \ref func<Args...>(int,const Args&... args) "with template argument"
|
|
Than Ngo |
b7bcaa |
*
|
|
Than Ngo |
b7bcaa |
* See the \ref Test "test" class.
|
|
Than Ngo |
b7bcaa |
*/
|
|
Than Ngo |
b7bcaa |
|
|
Than Ngo |
b7bcaa |
/** A function
|
|
Than Ngo |
b7bcaa |
*/
|
|
Than Ngo |
b7bcaa |
void func(int p);
|
|
Than Ngo |
b7bcaa |
|
|
Than Ngo |
b7bcaa |
/** A variadic template function overload
|
|
Than Ngo |
b7bcaa |
*/
|
|
Than Ngo |
b7bcaa |
template <typename... Args>
|
|
Than Ngo |
b7bcaa |
void func(int p, Args&... args);
|
|
Than Ngo |
b7bcaa |
|
|
Than Ngo |
b7bcaa |
/** A variadic template function overload
|
|
Than Ngo |
b7bcaa |
*/
|
|
Than Ngo |
b7bcaa |
template <typename... Args>
|
|
Than Ngo |
b7bcaa |
void func(int p, Args&&... args);
|
|
Than Ngo |
b7bcaa |
|
|
Than Ngo |
b7bcaa |
/** A variadic template function overload
|
|
Than Ngo |
b7bcaa |
*/
|
|
Than Ngo |
b7bcaa |
template <typename... Args>
|
|
Than Ngo |
b7bcaa |
void func(int p, const Args&... args);
|
|
Than Ngo |
b7bcaa |
|
|
Than Ngo |
b7bcaa |
/** A variadic template function overload
|
|
Than Ngo |
b7bcaa |
*/
|
|
Than Ngo |
b7bcaa |
template <typename... Args>
|
|
Than Ngo |
b7bcaa |
void func(int p, const Args&&... args);
|
|
Than Ngo |
b7bcaa |
|
|
Than Ngo |
b7bcaa |
/** A variadic template function overload
|
|
Than Ngo |
b7bcaa |
*/
|
|
Than Ngo |
b7bcaa |
template <typename... Args>
|
|
Than Ngo |
b7bcaa |
void func(int p, Args*... args);
|
|
Than Ngo |
b7bcaa |
|
|
Than Ngo |
b7bcaa |
/** A variadic template function overload
|
|
Than Ngo |
b7bcaa |
*/
|
|
Than Ngo |
b7bcaa |
template <typename... Args>
|
|
Than Ngo |
b7bcaa |
void func(int p, Args**... args);
|
|
Than Ngo |
b7bcaa |
|
|
Than Ngo |
b7bcaa |
/** A variadic template function overload
|
|
Than Ngo |
b7bcaa |
*/
|
|
Than Ngo |
b7bcaa |
template <typename... Args>
|
|
Than Ngo |
b7bcaa |
void func(int p, const Args*... args);
|
|
Than Ngo |
b7bcaa |
|
|
Than Ngo |
b7bcaa |
/** A variadic template function overload
|
|
Than Ngo |
b7bcaa |
*/
|
|
Than Ngo |
b7bcaa |
template <typename... Args>
|
|
Than Ngo |
b7bcaa |
void func(int p, const Args**... args);
|
|
Than Ngo |
b7bcaa |
|
|
Than Ngo |
b7bcaa |
/** A variadic template function overload
|
|
Than Ngo |
b7bcaa |
*/
|
|
Than Ngo |
b7bcaa |
template <typename... Args>
|
|
Than Ngo |
b7bcaa |
void func(int p, Args... args);
|
|
Than Ngo |
b7bcaa |
|
|
Than Ngo |
b7bcaa |
/** A test */
|
|
Than Ngo |
b7bcaa |
class Test
|
|
Than Ngo |
b7bcaa |
{
|
|
Than Ngo |
b7bcaa |
public:
|
|
Than Ngo |
b7bcaa |
/** A variadic template method
|
|
Than Ngo |
b7bcaa |
*/
|
|
Than Ngo |
b7bcaa |
template <typename... Args>
|
|
Than Ngo |
b7bcaa |
void func(int p, Args... args) const;
|
|
Than Ngo |
b7bcaa |
};
|