| 1 |
Template |
| 2 |
======== |
| 3 |
|
| 4 |
.. cpp:namespace:: @ex_template_first |
| 5 |
|
| 6 |
Breathe has support for class and function templates. They are output as |
| 7 |
follows. For a class with a single template parameter: |
| 8 |
|
| 9 |
.. code-block:: rst |
| 10 |
|
| 11 |
.. doxygenclass:: templateclass |
| 12 |
:project: template_class |
| 13 |
:members: |
| 14 |
|
| 15 |
It renders as: |
| 16 |
|
| 17 |
---- |
| 18 |
|
| 19 |
.. doxygenclass:: templateclass |
| 20 |
:project: template_class |
| 21 |
:members: |
| 22 |
|
| 23 |
---- |
| 24 |
|
| 25 |
.. cpp:namespace:: @ex_template_multiple |
| 26 |
|
| 27 |
With multiple template parameters it renders as: |
| 28 |
|
| 29 |
---- |
| 30 |
|
| 31 |
.. doxygenclass:: anothertemplateclass |
| 32 |
:project: template_class_non_type |
| 33 |
:members: |
| 34 |
|
| 35 |
---- |
| 36 |
|
| 37 |
.. cpp:namespace:: @ex_template_function_single |
| 38 |
|
| 39 |
A function with single template parameter renders as: |
| 40 |
|
| 41 |
---- |
| 42 |
|
| 43 |
.. doxygenfunction:: function1 |
| 44 |
:project: template_function |
| 45 |
|
| 46 |
---- |
| 47 |
|
| 48 |
.. cpp:namespace:: @ex_template_function_single_specialization |
| 49 |
|
| 50 |
If specialized for a given type it renders as: |
| 51 |
|
| 52 |
---- |
| 53 |
|
| 54 |
.. doxygenfunction:: function1< std::string > |
| 55 |
:project: template_function |
| 56 |
|
| 57 |
---- |
| 58 |
|
| 59 |
.. cpp:namespace:: @ex_template_function_multiple |
| 60 |
|
| 61 |
With multiple template parameters it renders as: |
| 62 |
|
| 63 |
---- |
| 64 |
|
| 65 |
.. doxygenfunction:: function2 |
| 66 |
:project: template_function |