Namespaces
Variants
Actions

Template:dsc mem fun

From cppreference.com

|- class="t-dsc" | no member given |
(public member function) |-

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

This is one of the family of templates used for creation of description list. These templates should be used to design function, variable or type lists.

Contents

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.

{{dsc begin}}

starts the description list

{{dsc end}}

ends the description list

{{dsc h1| heading}}

adds heading to the description list (h3 level)

{{dsc h2| heading}}

adds sub-heading to the description list (h5 level)

{{dsc header}}

adds explanation which header the features come from

{{dsc namespace}}

adds explanation which namespace the features are in

{{dsc sep}}

adds a separator

{{dsc| name| explanation}}

adds a generic item to the description list. If explanation is omitted, the item spans through both columns.

{{dsc hitem| name| explanation}}

adds a highlighted item to the description list. If explanation is omitted, the item spans through both columns.

{{dsc inc| location| param1 (optional)| param2 (optional) ...}}

Sets dsc-list-template-name variable to location, includes the template from location and unsets the variable. Use this template whenever copying dsc items from a template; this will add an edit link to them. The unnamed parameters param1, param2, ... are passed to the template.

{{dsc break}}

breaks the columns. The width of the columns above does not depend on the content below and vice-versa.

{{dsc todo| reason}}

adds a todo item (similar to {{todo}})

Specialized templates

There are templates already specialized for most of the usage cases.

Classes

{{dsc class| link| title=link title(optional)| notes=link notes(optional)| explanation}}

adds an item linking to a description of a class.

{{dsc tclass| link| title=link title(optional)| notes=link notes(optional)| explanation}}

adds an item linking to a description of a class template.

{{dsc ptclass| link| title=link title(optional)| notes=link notes(optional)| explanation}}

adds an item linking to a description of a class template specialization.

{{dsc mem class| link| title=link title(optional)| notes=link notes(optional)| explanation}}

adds an item linking to a description of a member class.
Functions

{{dsc fun| link| title=link title(optional)| notes=link notes(optional)| explanation}}

adds an item linking to a description of a function

{{dsc tfun| link| title=link title(optional)| notes=link notes(optional)| explanation}}

adds an item linking to a description of a function template.

{{dsc mem fun| link| title=link title(optional)| notes=link notes(optional)| explanation}}

adds an item linking to a description of a public member function.

{{dsc prot mem fun| link| title=link title(optional)| notes=link notes(optional)| explanation}}

adds an item linking to a description of a protected member function template.

{{dsc mem ctor| link| notes=link notes(optional)| explanation}}

adds an item linking to a description of a public constructor.

{{dsc prot mem ctor| link| notes=link notes(optional)| explanation}}

adds an item linking to a description of a protected constructor.

{{dsc mem dtor| link| notes=link notes(optional)| explanation}}

adds an item linking to a description of a public destructor.

{{dsc prot mem dtor| link| notes=link notes(optional)| explanation}}

adds an item linking to a description of a protected destructor.

{{dsc mem vdtor| link| notes=link notes(optional)| explanation}}

adds an item linking to a description of a virtual public destructor.

{{dsc prot mem vdtor| link| notes=link notes(optional)| explanation}}

adds an item linking to a description of a virtual protected destructor.

{{dsc mem sfun| link| title=link title(optional)| notes=link notes(optional)| explanation}}

adds an item linking to a description of a static member function.

{{dsc mem vfun| link| title=link title(optional)| notes=link notes(optional)| explanation}}

adds an item linking to a description of a virtual public member function template.

{{dsc prot mem vfun| link| title=link title(optional)| notes=link notes(optional)| explanation}}

adds an item linking to a description of a virtual protected member function template.

{{dsc macro fun| link| title=link title(optional)| notes=link notes(optional)| explanation}} - adds an item linking to a description of a function macro.

Constants

{{dsc macro const| link| title=link title(optional)| notes=link notes(optional)| explanation}}

adds an item linking to a description of a macro constant.

{{dsc const| link| title=link title(optional)| notes=link notes(optional)| explanation}}

adds an item linking to a description of a global constant variable.

{{dsc mem const| link| title=link title(optional)| notes=link notes(optional)| explanation}}

adds an item linking to a description of a constant member variable.

{{dsc mem sconst| link| title=link title(optional)| notes=link notes(optional)| explanation}}

adds an item linking to a description of a static constant member variable.
Objects

{{dsc mem obj| link| title=link title(optional)| notes=link notes(optional)| explanation}}

adds an item linking to a description of a member object.

{{dsc prot mem obj| link| title=link title(optional)| notes=link notes(optional)| explanation}}

adds an item linking to a description of a protected member object.

{{dsc priv mem obj| link| title=link title(optional)| notes=link notes(optional)| explanation}}

adds an item linking to a description of a private member object.
Miscellaneous

{{dsc typedef| link| title=link title(optional)| notes=link notes(optional)| explanation}}

adds an item linking to a description of a typedef.

{{dsc enum| link| title=link title(optional)| notes=link notes(optional)| explanation}}

adds an item linking to a description of a enum or enum class.

{{dsc concept| link| title=link title(optional)| notes=link notes(optional)| explanation}}

adds an item linking to a description of a concept.
Parameters

link

this parameter controls the link target.

title=link title

this parameter overrides the link title

notes=link notes

this parameter adds text besides the link that is not the part of the link

explanation

the explanation of the feature.

All templates accept nolink=true parameter. In that case no link is made, the formatting is the same.

The templates for member objects accept inlinemem=true parameter. This should be used if the functionality is described inline in the page of the class.

See also templates

Used in see also lists.

{{dsc see cpp| location| nomono=true_if_serif (optional)| title1(optional)| title2(optional) ...}}

adds a link to C++ documentation of a feature.

{{dsc see c| location| nomono=true_if_serif (optional)| title1(optional)| title2(optional) ...}}

adds a link to C documentation of a feature.
Parameters

location

this parameter controls the link target.

nomono

true if serif font should be used for the title

title1, title2, ...

this parameter overrides the title (default the title is guessed from location). Commas are placed between titles if several of them are provided.

Example

 
  {{dsc begin}}
  {{dsc h1 | Magic creatures}}
  {{dsc h2 | Dragon}}
  {{dsc header | dragon.h}}
  {{dsc fun | cpp/dragon/call_dragon | calls the dragon}}
  {{dsc fun | cpp/dragon/receive_fire | receives the fire}}
  {{dsc end}}
  

The above results in the following:

Magic creatures

Dragon
Defined in header <dragon.h>
calls the dragon
(function)
receives the fire
(function)

Templates used in the implementation

{{dsc member}}

{{dsc member| page| title (optional)| nolink=true_if_nolink (optional)| nobold=true_if_nobold (optional)| notes=notes (optional)}}

Default title of the link is page. Custom title can be supplied via the second unnamed parameter or title parameter. If nolink is true, no link is produced.
Default font of the link is bold monospace. If nobold is true, the font is normal serif.
Additional notes to be placed in the right of the link can be passed through notes parameter.
Both title and notes can accept <br> tags without breaking the layout.

{{dsc mark mem}}

{{dsc mark mem| link| mark_class| nomem=true_if_nomem (optional)| inlinemem=true_if_inlinemem (optional)}}

Outputs {{mark mark_class}} potentially appending additional description of the class the function/class is member of.
Specifically, the template checks if the parent of the page linked to by link is a parent of the page the template is used in (i.e. they are siblings). For example, consider link = a/b/c and page the page the template is used in. Then the template would append the additional description if page equals to z/z/z, or a/z, or a/b/z/z, but not if page is a/b/z or a/b.
If nomem is true then additional description is never appended.
The template fetches information about the name of the parent class from a/b/title page.
If inlinemem is true then the name of the parent class is fetched from a/b/c/title template. This is used when a class includes descriptions of its members inline.

{{dsc editlink}}

{{dsc editlink}}

Outputs an [edit] text with a link pointing to a page for editing the template whose name is defined in dsc-list-template-name variable. At least one dummy parameter must be passed to this template, as Mediawiki software employs some optimizations that break the implementation.