Template¶
Breathe has support for class and function templates. They are output as follows. For a class with a single template parameter:
.. doxygenclass:: templateclass
:project: template_class
:members:
It renders as:
- template <typename T>
-
class
templateclass
¶ a class with a template parameter
- Template Parameters
T
: this is the template parameter
Public Functions
-
templateclass
templateclass
()¶ default constructor
-
templateclass
templateclass
(T const &m)¶ constructor with template argument
- Parameters
m
: the argument
-
T templateclass
method
(T const &t)¶ member accepting template argument and returning template argument
- Return
- returns value of type T
- Parameters
t
: argument of type T
With multiple template parameters it renders as:
- template <typename T, typename U, int N>
-
class
anothertemplateclass
¶ a class with three template parameters
- Template Parameters
T
: this is the first template parameterU
: this is the second template parameterN
: this is the third template parameter, it is a non-type parameter
Public Functions
-
anothertemplateclass
anothertemplateclass
()¶ default constructor
-
anothertemplateclass
anothertemplateclass
(T const &m1, U const &m2)¶ constructor with two template argument
- Parameters
m1
: first argumentm2
: second argument
-
U anothertemplateclass
method
(T const &t)¶ member accepting template argument and returning template argument
- Return
- returns value of type U
- Parameters
t
: argument
A function with single template parameter renders as:
- template <typename T>
-
T
function1
(T arg1)¶ a function with one template arguments
- Return
- return value of type T
- Template Parameters
T
: this is the template parameter
- Parameters
arg1
: argument of type T
With multiple template parameters it renders as:
- template <typename T, typename U, int N>
-
T
function2
(T arg1, U arg2)¶ a function with three template arguments
- Return
- return value of type T
- Template Parameters
T
: this is the first template parameterU
: this is the second template parameterN
: this is the third template parameter, it is a non-type parameter
- Parameters
arg1
: first argument of type Targ2
: second argument of type U