Namespaces
Variants
Actions

Template:dcl

From cppreference.com

<tr class="t-dcl ">

<td class="t-dcl-nopad">
 
</td>

<td class="t-dcl-nopad"> </td> <td class="t-dcl-nopad"> </td> </tr>

[edit] [{{purge}}] Template documentation

This is one of the family of templates used for creation of declaration lists.

List template families

  • dsc **** : For creation of member variable/function lists.
  • dcl **** : For creation of detailed declaration lists (those including actual declaration code)
  • sdsc **** : For creation of lists representing various syntaxes of a language feature. Used in subpages of cpp/language
  • par **** : For creation of lists explaining function parameters.
  • spar **** : For creation of lists explaining syntax parameters.
  • nv **** : For creation of feature lists in navbars.

{{dcl begin}}

starts the declaration list

{{dcl end}}

ends the declaration list. This template automatically adds {{dcl sep}} above the item.

{{dcl rev begin| num=num}}

starts versioned declaration list. The num parameter is optional and may be used for numbering purposes (overrides the num parameter of the {{dcl}} templates used within the versioned list (i.e., until {{dcl rev end}}).

{{dcl rev end}}

ends versioned declaration list.

{{dcl header}}

adds explanation which header the feature comes from

{{dcl sep}}

adds a separator

{{dcl h| heading}}

adds a small heading. Useful to split and describe large groups of related declarations.

{{dcl| notes=notes| num=num| since=since-std| until=until-std| declaration}}

adds an item to the declaration list. The notes parameter is optional and may be used to add notes about the feature. The num parameter is also optional and may be used for numbering purposes. declaration is the declaration of the feature. This template automatically adds {{dcl sep}} above the item.
until specifies the first standard the definition appears in, until specifies the first standard that does not include this definition.

Example

 
    {{dcl header | abcd.h}}
    {{dcl | notes=Faster than {{c|foo_slow}} | num=1 |
    int foo( char a );
    }}
    {{dcl | since=c++11 | num=2 |
    int foo( char a, int b );
    }}
    {{dcl rev begin | num=3}}
    {{dcl | until=c++11 | 1=
    int foo( char a, char b = 'a' );
    }}
    {{dcl | since=c++11 | until=c++14 | 1=
    int foo( char a, char b = 'b' );
    }}
    {{dcl | since=c++14 | 1=
    int foo( char a, char b = 'c' );
    }}
    {{dcl rev end}}
    {{dcl rev begin}}
    {{dcl | until=c++11 | num=4 | 1=
    int foo( char a, char b = 'a' );
    }}
    {{dcl | since=c++11 | until=c++14 | num=5 | 1=
    int foo( char a, char b = 'b' );
    }}
    {{dcl | since=c++14 | num=6 | 1=
    int foo( char a, char b = 'c' );
    }}
    {{dcl rev end}}
  

The above results in the following:

Defined in header <abcd.h>
int foo( char a );
(1) Faster than foo_slow
int foo( char a, int b );
(2) (since C++11)
(3)
int foo( char a, char b = 'a' );
(until C++11)
int foo( char a, char b = 'b' );
(since C++11)
(until C++14)
int foo( char a, char b = 'c' );
(since C++14)
int foo( char a, char b = 'a' );
(4) (until C++11)
int foo( char a, char b = 'b' );
(5) (since C++11)
(until C++14)
int foo( char a, char b = 'c' );
(6) (since C++14)