Variants

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.
  • elink **** : For creation of External links lists.

{{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 (optional)}}

Starts versioned declaration list.
  • num (optional) 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|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|declaration |notes=notes (optional)|num=num (optional)|since=since-std (optional)|until=until-std (optional)|deprecated=deprecated-std (optional)|removed=removed-std (optional)}}

Adds an item to the declaration list. This template automatically adds {{dcl sep}} above the item.
  • declaration is the declaration of the feature.
  • notes (optional) may be used to add notes about the feature.
  • num (optional) may be used for numbering purposes.
  • since (optional) specifies the first standard the definition appears in
  • until (optional) specifies the first standard that does not include this definition
  • deprecated (optional) either specifies the first standard that deprecated this definition, or is equal to yes, in which case it specifies that the definition has always been deprecated.
  • removed (optional) can be used in one of two ways:
    • When until is specified, it specifies whether the "until" marker should be rendered as "removed in" instead, and can be either yes or no.
    • If missing, defaults to yes if deprecated is specified and no otherwise.
    • When until is not specified, removed=x is equivalent to until=x|removed=yes.

{{dcla|parameters of {{dcl}} |anchor=name|no (optional)|noexcept=noexcept-std (optional)|constexpr=constexpr-std (optional)|expos=yes (optional)}}

Same as {{dcl}}, with extended parameter set and with and additional ability to generate an internal HTML anchor.
  • anchor (optional)
    • When specified and its value is no – does nothing. Otherwise, inserts into the current row the anchor with provided name.
    • When not specified, the anchor is inserted only if the parameter num is specified. In such a case the anchor's name follows the pattern: "Version num" where num equals the num's value, e.g., if num=1 then the anchor's name is "Version 1". The dependency on num param simplifies the anchor/link connection when used together with e.g. {{vl}} or {{eq impl}} that also expect "Version n" link's name pattern.
  • noexcept (optional)
    • When specified, uses its value, e.g. c++11, to add the "noexcept"-revision tag (i.e. (noexcept since C++11) in this case), to the versioning area.
  • constexpr (optional)
    • When specified, uses its value, e.g. c++20, to add the "constexpr"-revision tag (i.e. (constexpr since C++20) in this case), to the versioning area.
  • expos (optional)
    • When specified with the value yes adds (exposition only*) note to the versioning area.

{{ddcl|header=header (optional)|parameters of {{dcl}} }}

A convenience shorthand for combination: {{dcl header}} + {{dcl begin}} + {{dcl ...}} + {{dcl end}} when only one declaration need to be described.

{{ddcla|header=header (optional)|parameters of {{dcla}} }}

A convenience shorthand for combination: {{dcl header}} + {{dcl begin}} + {{dcla ...}} + {{dcl end}} when only one declaration need to be described.

{{dcl rev multi|num=num (optional)|anchor=name|no (optional)|notes=notes (optional)|since1=since-std1 |until1=until-std1 |dcl1=declaration1 |... }}

Single-template versioned declaration list; up to 7 versions are supported. The default for sinceX is untilX-1 and the default for untilX is sinceX+1.
  • anchor (optional) – has the same behavior as the parameter anchor of the {{dcla}}.

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}} {{dcl rev multi | num=7 | dcl1= int foo( char a, char b = 'a' ); |since2=c++11 | dcl2= int foo( char a, char b = 'b' ); |since3=c++14 | dcl3= int foo( char a, char b = 'c' ); |since4=c++17 | dcl4= int foo( char a, char b = 'd' ); }} 

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)
(7)
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)
(until C++17)
int foo(char a, char b ='d');
(since C++17)

Example

 {{ddcl | header=mutex | since=c++11 | 1= template< class Lockable1, class Lockable2, class... LockableN > void lock( Lockable1& lock1, Lockable2& lock2, LockableN&... lockn ); }} 

The above results in the following:

Defined in header <mutex>
template<class Lockable1, class Lockable2, class... LockableN>
void lock( Lockable1& lock1, Lockable2& lock2, LockableN&... lockn);
(since C++11)
close