Namespaces
Variants
Views
Actions

Difference between revisions of "Template:rl/doc"

From cppreference.com
m (Decorated links: +'_')
m (+doc for {{lst}}, updated doc for {{lsd}} and {{lsi}}.)
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
===This is one of templates used to make links===
+
This is one of templates used to make links.
  
====Absolute links====
+
===Absolute links===
{{tl|lt|''path''|{{spar optional|title}}}} - creates a link to a page using absolute path. The default title is only the last part of the path. The link appears in normal font.
+
====Normal font====
 +
{{tl params|lt|path,title?}} - creates a link to a page using absolute path. The default title is only the last part of the path.
 
: Example: {{tt|1={{lt{{!}}cpp/language/statements}}}} results in the link: {{lt|cpp/language/statements}}.
 
: Example: {{tt|1={{lt{{!}}cpp/language/statements}}}} results in the link: {{lt|cpp/language/statements}}.
 
: Example: {{tt|1={{lt{{!}}cpp/language/statements|Labeled statements}}}} results in the link: {{lt|cpp/language/statements|Labeled statements}}.
 
: Example: {{tt|1={{lt{{!}}cpp/language/statements|Labeled statements}}}} results in the link: {{lt|cpp/language/statements|Labeled statements}}.
Line 8: Line 9:
 
: {{tt|[}}{{tt|1=[cpp/language/statements{{!}}Labeled statements}}{{tt|1=]]}}, which also results in [[cpp/language/statements|Labeled statements]].
 
: {{tt|[}}{{tt|1=[cpp/language/statements{{!}}Labeled statements}}{{tt|1=]]}}, which also results in [[cpp/language/statements|Labeled statements]].
  
{{tl|ls|''path''|''section''|{{spar optional|title}}}} - creates a link to a ''section'' (or an anchor) in the page given by absolute ''path''. If ''title'' is not provided (which is the primary usage scenario), the ''section'' text is used as the title. The link appears in normal font.
+
{{tl params|ls|2=path#section}} - makes a link to a ''section'' (anchor) on a page given by absolute ''path''. The ''section'' text is also used as the title. To create a link on the same page the ''path'' part should be empty.
: Example: {{tt|1={{ls{{!}}cpp/language/function template{{!}}Abbreviated function template}}}} results in the link: {{ls|cpp/language/function template|Abbreviated function template}}.
+
: Example: {{tt|1={{ls{{!}}cpp/language/lambda#Syntax}}}} results in the link: {{ls|cpp/language/lambda#Syntax}}.
: Example: {{tt|1={{ls{{!}}cpp/language/function template{{!}}Abbreviated function template{{!}}AFT}}}} results in the link: {{ls|cpp/language/function template|Abbreviated function template|AFT}}.
+
: To create a link to a section/anchor within the current page the ''path'' part should be omitted.
 +
: Example: {{tt|1={{ls{{!}}#Relative links}}}} results in the link: {{ls|#Relative links}} (i.e. a link to the section in this page).
  
{{tl|ltt|''path''|{{spar optional|title}}}} - creates a link to a page using absolute path. The default title is only the last part of the path. Link font is {{tt|teletype}}.
+
{{tl params|lsd|path#Section}} ("lsd" stands for "Link to Section De-capitalized") - almost the same as {{tl|ls}} except it de-capitalizes the first letter of displayed section name. To create a link on the same page the ''path'' part should be empty.
 +
: Example: {{tt|1={{lsd{{!}}cpp/language/array#Arrays of unknown bound}}}} results in the link: {{lsd|cpp/language/array#Arrays of unknown bound}}.
 +
: Example: {{tt|1={{lsd{{!}}#Relative links}}}} results in the link: {{lsd|#Relative links}} (i.e. a link to the section in this page).
 +
 
 +
====Teletype font====
 +
{{tl params|ltt|path,title?}} - creates a link to a page using absolute path. The default title is only the last part of the path.
 
: Example: {{tt|1={{ltt{{!}}cpp/language/switch}}}} results in the link: {{ltt|cpp/language/switch}}.
 
: Example: {{tt|1={{ltt{{!}}cpp/language/switch}}}} results in the link: {{ltt|cpp/language/switch}}.
 
: Example: {{tt|1={{ltt{{!}}cpp/language/switch|switch(expr)}}}} results in the link: {{ltt|cpp/language/switch|switch(expr)}}.
 
: Example: {{tt|1={{ltt{{!}}cpp/language/switch|switch(expr)}}}} results in the link: {{ltt|cpp/language/switch|switch(expr)}}.
  
{{tl|lti|''path''|{{spar optional|title}}}} - creates a link to a page using absolute path. The default title is only the last part of the path. Link font is {{tt|teletype}} in ''italic''.
+
{{tl params|ltf|2=path,title?,args=arguments?}} - creates a link to a page using absolute path. The default title is only the last part of the path. Parentheses indicating ''function'' are appended, which enclose the optional ''arguments''.
: Example: {{tt|1={{lti{{!}}cpp/concepts/boolean-testable}}}} results in the link: {{lti|cpp/concepts/boolean-testable}}.
+
 
+
{{tl|ltf|''path''|{{spar optional|title}}|args{{=}}{{spar optional|arguments}}}} - creates a link to a page using absolute path. The default title is only the last part of the path. Link font is {{tt|teletype}}. Parentheses indicating ''function'' are appended, which enclose the optional ''arguments''.
+
 
: Example: {{tt|1={{ltf{{!}}cpp/error/terminate}}}} results in the link: {{ltf|cpp/error/terminate}}.
 
: Example: {{tt|1={{ltf{{!}}cpp/error/terminate}}}} results in the link: {{ltf|cpp/error/terminate}}.
 
: Example: {{tt|1={{ltf{{!}}cpp/error/terminate|std::terminate}}}} results in the link: {{ltf|cpp/error/terminate|std::terminate}}.
 
: Example: {{tt|1={{ltf{{!}}cpp/error/terminate|std::terminate}}}} results in the link: {{ltf|cpp/error/terminate|std::terminate}}.
 
: Example: {{tt|1={{ltf{{!}}cpp/error/set_terminate|std::set_terminate|args=nullptr}}}} results in the link: {{ltf|cpp/error/set_terminate|std::set_terminate|args=nullptr}}.
 
: Example: {{tt|1={{ltf{{!}}cpp/error/set_terminate|std::set_terminate|args=nullptr}}}} results in the link: {{ltf|cpp/error/set_terminate|std::set_terminate|args=nullptr}}.
  
{{tl|ltp|''path''|{{spar optional|title}}|targs{{=}}{{spar optional|template arguments}}}} - creates a link to a page using absolute path. The default title is only the last part of the path. Link font is {{tt|teletype}}. Angle brackets indicating ''template'' are appended, which enclose the optional ''template arguments''.
+
{{tl params|ltp|2=path,title?,targs=template arguments?}} - creates a link to a page using absolute path. The default title is only the last part of the path. Angle brackets indicating ''template'' are appended, which enclose the optional ''template arguments''.
 
: Example: {{tt|1={{ltp{{!}}cpp/container/vector}}}} results in the link: {{ltp|cpp/container/vector}}.
 
: Example: {{tt|1={{ltp{{!}}cpp/container/vector}}}} results in the link: {{ltp|cpp/container/vector}}.
 
: Example: {{tt|1={{ltp{{!}}cpp/container/vector|targs=int}}}} results in the link: {{ltp|cpp/container/vector|targs=int}}.
 
: Example: {{tt|1={{ltp{{!}}cpp/container/vector|targs=int}}}} results in the link: {{ltp|cpp/container/vector|targs=int}}.
 
: Example: {{tt|1={{ltp{{!}}cpp/container/vector|targs=std::size_t}}}} results in the link: {{ltp|cpp/container/vector|targs=std::size_t}}.
 
: Example: {{tt|1={{ltp{{!}}cpp/container/vector|targs=std::size_t}}}} results in the link: {{ltp|cpp/container/vector|targs=std::size_t}}.
  
{{tl|ltpi|''path''|{{spar optional|title}}|targs{{=}}{{spar optional|template arguments}}}} - creates a link to a page using absolute path. The default title is only the last part of the path. Link font is {{tt|teletype}}, and the template name is in ''italic''. Angle brackets indicating ''template'' are appended, which enclose the optional ''template arguments''.
+
{{tl params|ltpf|2=path,title?,targs=template arguments?,args=arguments?}} - creates a link to a page using absolute path. The default title is only the last part of the path. Angle brackets indicating ''template'' are appended, which enclose the optional ''template arguments''. After that, parentheses indicating ''function'' are appended, which enclose the optional ''arguments''.
: Example: {{tt|1={{ltpi{{!}}cpp/concepts/boolean-testable}}}} results in the link: {{ltpi|cpp/concepts/boolean-testable}}.
+
: Example: {{tt|1={{ltpi{{!}}cpp/concepts/boolean-testable|targs=int}}}} results in the link: {{ltpi|cpp/concepts/boolean-testable|targs=int}}.
+
 
+
{{tl|ltpf|''path''|{{spar optional|title}}|targs{{=}}{{spar optional|template arguments}}|args{{=}}{{spar optional|arguments}}}} - creates a link to a page using absolute path. The default title is only the last part of the path. Link font is {{tt|teletype}}. Angle brackets indicating ''template'' are appended, which enclose the optional ''template arguments''. After that, parentheses indicating ''function'' are appended, which enclose the optional ''arguments''.
+
 
: Example: {{tt|1={{ltpf{{!}}cpp/container/vector/vector|targs=int|args=5}}}} results in the link: {{ltpf|cpp/container/vector/vector|targs=int|args=5}}.
 
: Example: {{tt|1={{ltpf{{!}}cpp/container/vector/vector|targs=int|args=5}}}} results in the link: {{ltpf|cpp/container/vector/vector|targs=int|args=5}}.
 
: Example: {{tt|1={{ltpf{{!}}cpp/locale/use_facet|targs=Facet|args=loc}}}} results in the link: {{ltpf|cpp/locale/use_facet|targs=Facet|args=loc}}.
 
: Example: {{tt|1={{ltpf{{!}}cpp/locale/use_facet|targs=Facet|args=loc}}}} results in the link: {{ltpf|cpp/locale/use_facet|targs=Facet|args=loc}}.
  
{{tl|l2tt|''page''|{{spar optional|title1}}|{{spar optional|title2}}}} - creates a link to a page using absolute path. The title is formed from the two last parts of the path with {{ttb|::}} be inserted between them. Each of these parts can be overridden by ''title1'' and ''title2''.  Link font is {{tt|teletype}}.
+
{{tl params|lst|2=path#section}} - makes a link to a ''section'' (anchor) on a page given by absolute ''path''. The ''section'' text is also used as the title. To create a link on the same page the ''path'' part should be empty.
 +
: Example: {{tt|1={{lst{{!}}cpp/ranges#maybe-const}}}} results in the link: {{lst|cpp/ranges#maybe-const}}.
 +
: Example: {{tt|1={{lst{{!}}#top}}}} results in the link: {{lst|#top}}.
 +
: Example: {{tt|1={{lst{{!}}#top_}}}} results in the link: {{lst|#top_}} {{small|(note that the trailing underscore character of the link is automatically trimmed)}}.
 +
 
 +
{{tl params|l2tt|page,title1?,title2?}} - creates a link to a page using absolute path. The title is formed from the two last parts of the path with {{ttb|::}} be inserted between them. Each of these parts can be overridden by ''title1'' and ''title2''.
 
: Example: {{tt|1={{l2tt{{!}}cpp/container/vector/size}}}} results in the link: {{l2tt|cpp/container/vector/size}}.
 
: Example: {{tt|1={{l2tt{{!}}cpp/container/vector/size}}}} results in the link: {{l2tt|cpp/container/vector/size}}.
 
: Example: {{tt|1={{l2tt{{!}}cpp/container/vector/size|size() const}}}} results in the link: {{l2tt|cpp/container/vector/size|size() const}}.
 
: Example: {{tt|1={{l2tt{{!}}cpp/container/vector/size|size() const}}}} results in the link: {{l2tt|cpp/container/vector/size|size() const}}.
 
: Example: {{tt|1={{l2tt{{!}}cpp/container/vector/size|size()|std::vector<T>}}}} results in the link: {{l2tt|cpp/container/vector/size|size()|std::vector<T>}}.
 
: Example: {{tt|1={{l2tt{{!}}cpp/container/vector/size|size()|std::vector<T>}}}} results in the link: {{l2tt|cpp/container/vector/size|size()|std::vector<T>}}.
  
{{tl|l2tf|''page''|{{spar optional|title1}}|{{spar optional|title2}}|args{{=}}{{spar optional|arguments}}|suffix{{=}}{{spar optional|suffix}}}} - creates a link to a page using absolute path. The title is formed from the two last parts of the path with {{ttb|::}} be inserted between them. Each of these parts can be overridden by ''title1'' and ''title2''.  Link font is {{tt|teletype}}. Parentheses indicating ''function'' are appended, which enclose the optional ''arguments'' and are followed by the optional ''suffix''.
+
{{tl params|l2tf|2=page,title1?,title2?,args=arguments?,suffix=suffix?}} - creates a link to a page using absolute path. The title is formed from the two last parts of the path with {{ttb|::}} be inserted between them. Each of these parts can be overridden by ''title1'' and ''title2''. Parentheses indicating ''function'' are appended, which enclose the optional ''arguments'' and are followed by the optional ''suffix''.
 
: Example: {{tt|1={{l2tf{{!}}cpp/container/vector/size}}}} results in the link: {{l2tf|cpp/container/vector/size}}.
 
: Example: {{tt|1={{l2tf{{!}}cpp/container/vector/size}}}} results in the link: {{l2tf|cpp/container/vector/size}}.
 
: Example: {{tt|1={{l2tf{{!}}cpp/container/vector/size|suffix=const}}}} results in the link: {{l2tf|cpp/container/vector/size|suffix=const}}.
 
: Example: {{tt|1={{l2tf{{!}}cpp/container/vector/size|suffix=const}}}} results in the link: {{l2tf|cpp/container/vector/size|suffix=const}}.
 
: Example: {{tt|1={{l2tf{{!}}cpp/container/vector/size|size|std::vector<T>}}}} results in the link: {{l2tf|cpp/container/vector/size|size|std::vector<T>}}.
 
: Example: {{tt|1={{l2tf{{!}}cpp/container/vector/size|size|std::vector<T>}}}} results in the link: {{l2tf|cpp/container/vector/size|size|std::vector<T>}}.
  
====Absolute links with prefix {{co|std::}}====
+
====Italic teletype font====
The following convenience templates generate links whose titles begin with {{tt|std::}}. They can be used in places where {{tl|lc}} fails to generate a link.
+
{{tl params|lti|path,title?}} - creates a link to a page using absolute path. The default title is only the last part of the path.
 +
: Example: {{tt|1={{lti{{!}}cpp/concepts/boolean-testable}}}} results in the link: {{lti|cpp/concepts/boolean-testable}}.
 +
 
 +
{{tl params|ltpi|2=path,title?,targs=template arguments?}} - creates a link to a page using absolute path. The default title is only the last part of the path. Angle brackets indicating ''template'' are appended, which enclose the optional ''template arguments''.
 +
: Example: {{tt|1={{ltpi{{!}}cpp/concepts/boolean-testable}}}} results in the link: {{ltpi|cpp/concepts/boolean-testable}}.
 +
: Example: {{tt|1={{ltpi{{!}}cpp/concepts/boolean-testable|targs=int}}}} results in the link: {{ltpi|cpp/concepts/boolean-testable|targs=int}}.
 +
 
 +
{{tl params|lsi|2=path#section}} - makes a link to a ''section'' (anchor) on a page given by absolute ''path''. The ''section'' text is also used as the title. To create a link on the same page the ''path'' part should be empty.
 +
: Example: {{tt|1={{lsi{{!}}cpp/ranges#maybe-const}}}} results in the link: {{lsi|cpp/ranges#maybe-const}}.
 +
: Example: {{tt|1={{lsi{{!}}#top}}}} results in the link: {{lsi|#top}}.
 +
: Example: {{tt|1={{lsi{{!}}#top_}}}} results in the link: {{lsi|#top_}} {{small|(note that the trailing underscore character of the link is automatically trimmed)}}.
 +
 
 +
===Absolute links with prefix {{co|std::}}===
 +
The following convenience templates generate links whose titles begin with {{tt|std::}}. They can be used in places where {{tl|lc}} fails to generate a link. All links appear in teletype font.
  
{{tl|ltt std|''path''}} - link to a page using absolute path. The title is {{tt|std::}} followed by the last part of the path. Link font is {{tt|teletype}}.
+
{{tl params|ltt std|path}} - link to a page using absolute path. The title is {{tt|std::}} followed by the last part of the path.
 
: Example: {{tt|1={{ltt std{{!}}cpp/container/mdspan}}}} results in the link: {{ltt std|cpp/container/mdspan}}.
 
: Example: {{tt|1={{ltt std{{!}}cpp/container/mdspan}}}} results in the link: {{ltt std|cpp/container/mdspan}}.
  
{{tl|ltf std|''path''}} - link to a page using absolute path. The title is {{tt|std::}} followed by the last part of the path and parentheses indicating ''function''. Link font is {{tt|teletype}}.
+
{{tl params|ltf std|path}} - link to a page using absolute path. The title is {{tt|std::}} followed by the last part of the path and parentheses indicating ''function''.
 
: Example: {{tt|1={{ltf std{{!}}cpp/io/print}}}} results in the link: {{ltf std|cpp/io/print}}.
 
: Example: {{tt|1={{ltf std{{!}}cpp/io/print}}}} results in the link: {{ltf std|cpp/io/print}}.
  
{{tl|l2tt std|''path''}} - link to a page using absolute path. The title is {{tt|std::}} followed by the last two parts of the path joined by {{tt|::}}. Link font is {{tt|teletype}}.
+
{{tl params|l2tt std|path}} - link to a page using absolute path. The title is {{tt|std::}} followed by the last two parts of the path joined by {{tt|::}}.
 
: Example: {{tt|1={{l2tt std{{!}}cpp/utility/basic_stacktrace/current}}}} results in the link: {{l2tt std|cpp/utility/basic_stacktrace/current}}.
 
: Example: {{tt|1={{l2tt std{{!}}cpp/utility/basic_stacktrace/current}}}} results in the link: {{l2tt std|cpp/utility/basic_stacktrace/current}}.
  
{{tl|l2tf std|''path''}} - link to a page using absolute path. The title is {{tt|std::}} followed by the last two parts of the path joined by {{tt|::}} and parentheses indicating ''function''. Link font is {{tt|teletype}}.
+
{{tl params|l2tf std|path}} - link to a page using absolute path. The title is {{tt|std::}} followed by the last two parts of the path joined by {{tt|::}} and parentheses indicating ''function''.
 
: Example: {{tt|1={{l2tf std{{!}}cpp/utility/expected/value}}}} results in the link: {{l2tf std|cpp/utility/expected/value}}.
 
: Example: {{tt|1={{l2tf std{{!}}cpp/utility/expected/value}}}} results in the link: {{l2tf std|cpp/utility/expected/value}}.
  
====Relative links====
+
===Relative links===
{{tl|rl|''page''|{{spar optional|title}}}} - makes a link to a page relative to this page. The link appears in normal font.
+
====Normal font====
 +
{{tl params|rl|page,title?}} - makes a link to a page relative to this page (i.e. to a sub-page).
  
{{tl|rlt|''page''|{{spar optional|title}}}} - makes a link to a page relative to this page. The link appears in {{tt|teletype}} font.
+
{{tl params|rlp|page,title?}} - makes a link to a page relative to the parent page.
  
{{tl|rli|''page''|{{spar optional|title}}}} - makes a link to a page relative to this page. The link appears in {{tt|teletype}} font in ''italic''.
+
{{tl params|rlp|/,title}} - makes a link to the parent page.
  
{{tl|rlp|''page''|{{spar optional|title}}}} - makes a link to a page relative to the parent page. The link appears in normal font.
+
{{tl params|rlps|page&#35;section}} - makes a link to a ''section'' (anchor) on a page relative to the parent page. The title of the generated link is the section name.
  
{{tl|rlp|/|''title''}} - makes a link to the parent page. The link appears in normal font.
+
{{tl params|rlpsd|page&#35;Section}} - makes a link to a ''section'' (anchor) on a page relative to the parent page. The title of the generated link is the section name with the first letter de-capitalized.
  
{{tl|rlpt|''page''|{{spar optional|title}}}} - makes a link to a page relative to the parent page. The link appears in {{tt|teletype}} font.
+
====Teletype font====
 +
{{tl params|rlt|page,title?}} - makes a link to a page relative to this page (i.e. to a sub-page).
  
{{tl|rlpt|/|''title''}} - makes a link to the parent page. The link appears in {{tt|teletype}} font.
+
{{tl params|rlpt|page,title?}} - makes a link to a page relative to the parent page.
  
{{tl|rlpi|''page''|{{spar optional|title}}}} - makes a link to a page relative to the parent page. The link appears in {{tt|teletype}} font in ''italic''.
+
{{tl params|rlpt|/,title}} - makes a link to the parent page.
  
{{tl|rlpi|/|''title''}} - makes a link to the parent page. The link appears in {{tt|teletype}} font in ''italic''.
+
{{tl params|rlpf|2=page,title?,args=arguments?}} - makes a link to a page relative to the parent page. Parentheses indicating ''function'' are appended, which enclose the optional ''arguments''.
  
{{tl|rlpf|''page''|{{spar optional|title}}|args{{=}}{{spar optional|arguments}}}} - makes a link to a page relative to the parent page. The link appears in {{tt|teletype}} font. Parentheses indicating ''function'' are appended, which enclose the optional ''arguments''.
+
{{tl params|rlpst|page&#35;section}} - makes a link to a ''section'' (anchor) on a page relative to the parent page. The title of the generated link is the section name.
  
{{tl|ttt|''identifier''}} - makes a link to the current page (via the [[#top|#top]] link). The ''identifier'' appears in {{tt|teletype}} font.
+
{{tl params|ttt|identifier}} - makes a link to the current page (via the [[#top|#top]] link).
 
: Example: {{tl|ttt|this_page}} results in {{ttt|this_page}}.
 
: Example: {{tl|ttt|this_page}} results in {{ttt|this_page}}.
  
====Decorated links====
+
====Italic teletype font====
{{tl|attr|1{{=}}''attribute''|2{{=}}{{spar optional|title}}|3{{=}}{{spar optional|additional_title}}|{{spar optional|lang}}{{=}}{{spar|get_lang}}}}
+
{{tl params|rli|page,title?}} - makes a link to a page relative to this page (i.e. to a sub-page).
 +
 
 +
{{tl params|rlpi|page,title?}} - makes a link to a page relative to the parent page.
 +
 
 +
{{tl params|rlpi|/,title}} - makes a link to the parent page.
 +
 
 +
{{tl params|rlpsi|page&#35;section}} - makes a link to a ''section'' (anchor) on a page relative to the parent page. The title of the generated link is the section name.
 +
 
 +
===Decorated links===
 +
{{tl params|attr|2=attribute,title?,additional title?,lang=language?}}
  
 
: Used to create a link to [[c/language/attributes|C]]/[[cpp/language/attributes|C++]] language attribute specifier description. Parameters:
 
: Used to create a link to [[c/language/attributes|C]]/[[cpp/language/attributes|C++]] language attribute specifier description. Parameters:
* Nameless param 1 - an attribute specifier name.
+
* ''attribute'' - an attribute specifier name.
* Nameless param 2 {{mark optional}} - an attribute specifier title.
+
* ''title'' - an attribute specifier title.
* Nameless param 3 {{mark optional}} - additional elements after the title.
+
* ''additional title'' - additional elements after the title.
* Param {{spar optional|lang}} - language: ''cpp'' or ''c''. If ''lang'' is not given, {{tl|get lang}} is used.
+
* ''language'' - ''cpp'' or ''c''. If ''language'' is not given, {{tl|get lang}} is used.
  
 
: Example: {{tlc|attr|assume}} results in {{attr|assume}}.
 
: Example: {{tlc|attr|assume}} results in {{attr|assume}}.
 
: Example: {{tlc|attr|noreturn|_Noreturn|lang{{=}}c}} results in {{attr|noreturn|_Noreturn|lang=c}}.
 
: Example: {{tlc|attr|noreturn|_Noreturn|lang{{=}}c}} results in {{attr|noreturn|_Noreturn|lang=c}}.
 
: Example: {{tlc|attr|deprecated|3{{=}}("''because''")}} results in {{attr|deprecated|3=("''because''")}}.
 
: Example: {{tlc|attr|deprecated|3{{=}}("''because''")}} results in {{attr|deprecated|3=("''because''")}}.

Latest revision as of 15:04, 1 October 2024

This is one of templates used to make links.

Contents

[edit] Absolute links

[edit] Normal font

{{lt|path |title (optional)}} - creates a link to a page using absolute path. The default title is only the last part of the path.

Example: {{lt|cpp/language/statements}} results in the link: statements.
Example: {{lt|cpp/language/statements|Labeled statements}} results in the link: Labeled statements.
Note: the previous example is just another way to create the same link using the standard template
[[cpp/language/statements|Labeled statements]], which also results in Labeled statements.

{{ls|path#section }} - makes a link to a section (anchor) on a page given by absolute path. The section text is also used as the title. To create a link on the same page the path part should be empty.

Example: {{ls|cpp/language/lambda#Syntax}} results in the link: Syntax.
To create a link to a section/anchor within the current page the path part should be omitted.
Example: {{ls|#Relative links}} results in the link: Relative links (i.e. a link to the section in this page).

{{lsd|path#Section }} ("lsd" stands for "Link to Section De-capitalized") - almost the same as {{ls}} except it de-capitalizes the first letter of displayed section name. To create a link on the same page the path part should be empty.

Example: {{lsd|cpp/language/array#Arrays of unknown bound}} results in the link: arrays of unknown bound.
Example: {{lsd|#Relative links}} results in the link: relative links (i.e. a link to the section in this page).

[edit] Teletype font

{{ltt|path |title (optional)}} - creates a link to a page using absolute path. The default title is only the last part of the path.

Example: {{ltt|cpp/language/switch}} results in the link: switch.
Example: {{ltt|cpp/language/switch|switch(expr)}} results in the link: switch(expr).

{{ltf|path |title (optional)|args=arguments (optional)}} - creates a link to a page using absolute path. The default title is only the last part of the path. Parentheses indicating function are appended, which enclose the optional arguments.

Example: {{ltf|cpp/error/terminate}} results in the link: terminate().
Example: {{ltf|cpp/error/terminate|std::terminate}} results in the link: std::terminate().
Example: {{ltf|cpp/error/set_terminate|std::set_terminate|args=nullptr}} results in the link: std::set_terminate(nullptr).

{{ltp|path |title (optional)|targs=template arguments (optional)}} - creates a link to a page using absolute path. The default title is only the last part of the path. Angle brackets indicating template are appended, which enclose the optional template arguments.

Example: {{ltp|cpp/container/vector}} results in the link: vector<>.
Example: {{ltp|cpp/container/vector|targs=int}} results in the link: vector<int>.
Example: {{ltp|cpp/container/vector|targs=std::size_t}} results in the link: vector<std::size_t>.

{{ltpf|path |title (optional)|targs=template arguments (optional)|args=arguments (optional)}} - creates a link to a page using absolute path. The default title is only the last part of the path. Angle brackets indicating template are appended, which enclose the optional template arguments. After that, parentheses indicating function are appended, which enclose the optional arguments.

Example: {{ltpf|cpp/container/vector/vector|targs=int|args=5}} results in the link: vector<int>(5).
Example: {{ltpf|cpp/locale/use_facet|targs=Facet|args=loc}} results in the link: use_facet<Facet>(loc).

{{lst|path#section }} - makes a link to a section (anchor) on a page given by absolute path. The section text is also used as the title. To create a link on the same page the path part should be empty.

Example: {{lst|cpp/ranges#maybe-const}} results in the link: maybe-const.
Example: {{lst|#top}} results in the link: top.
Example: {{lst|#top_}} results in the link: top_ (note that the trailing underscore character of the link is automatically trimmed).

{{l2tt|page |title1 (optional)|title2 (optional)}} - creates a link to a page using absolute path. The title is formed from the two last parts of the path with :: be inserted between them. Each of these parts can be overridden by title1 and title2.

Example: {{l2tt|cpp/container/vector/size}} results in the link: vector::size.
Example: {{l2tt|cpp/container/vector/size|size() const}} results in the link: vector::size() const.
Example: {{l2tt|cpp/container/vector/size|size()|std::vector<T>}} results in the link: std::vector<T>::size().

{{l2tf|page |title1 (optional)|title2 (optional)|args=arguments (optional)|suffix=suffix (optional)}} - creates a link to a page using absolute path. The title is formed from the two last parts of the path with :: be inserted between them. Each of these parts can be overridden by title1 and title2. Parentheses indicating function are appended, which enclose the optional arguments and are followed by the optional suffix.

Example: {{l2tf|cpp/container/vector/size}} results in the link: vector::size().
Example: {{l2tf|cpp/container/vector/size|suffix=const}} results in the link: vector::size() const.
Example: {{l2tf|cpp/container/vector/size|size|std::vector<T>}} results in the link: std::vector<T>::size().

[edit] Italic teletype font

{{lti|path |title (optional)}} - creates a link to a page using absolute path. The default title is only the last part of the path.

Example: {{lti|cpp/concepts/boolean-testable}} results in the link: boolean-testable.

{{ltpi|path |title (optional)|targs=template arguments (optional)}} - creates a link to a page using absolute path. The default title is only the last part of the path. Angle brackets indicating template are appended, which enclose the optional template arguments.

Example: {{ltpi|cpp/concepts/boolean-testable}} results in the link: boolean-testable <>.
Example: {{ltpi|cpp/concepts/boolean-testable|targs=int}} results in the link: boolean-testable <int>.

{{lsi|path#section }} - makes a link to a section (anchor) on a page given by absolute path. The section text is also used as the title. To create a link on the same page the path part should be empty.

Example: {{lsi|cpp/ranges#maybe-const}} results in the link: maybe-const.
Example: {{lsi|#top}} results in the link: top.
Example: {{lsi|#top_}} results in the link: top_ (note that the trailing underscore character of the link is automatically trimmed).

[edit] Absolute links with prefix std::

The following convenience templates generate links whose titles begin with std::. They can be used in places where {{lc}} fails to generate a link. All links appear in teletype font.

{{ltt std|path }} - link to a page using absolute path. The title is std:: followed by the last part of the path.

Example: {{ltt std|cpp/container/mdspan}} results in the link: std::mdspan.

{{ltf std|path }} - link to a page using absolute path. The title is std:: followed by the last part of the path and parentheses indicating function.

Example: {{ltf std|cpp/io/print}} results in the link: std::print().

{{l2tt std|path }} - link to a page using absolute path. The title is std:: followed by the last two parts of the path joined by ::.

Example: {{l2tt std|cpp/utility/basic_stacktrace/current}} results in the link: std::basic_stacktrace::current.

{{l2tf std|path }} - link to a page using absolute path. The title is std:: followed by the last two parts of the path joined by :: and parentheses indicating function.

Example: {{l2tf std|cpp/utility/expected/value}} results in the link: std::expected::value().

[edit] Relative links

[edit] Normal font

{{rl|page |title (optional)}} - makes a link to a page relative to this page (i.e. to a sub-page).

{{rlp|page |title (optional)}} - makes a link to a page relative to the parent page.

{{rlp|/ |title }} - makes a link to the parent page.

{{rlps|page#section }} - makes a link to a section (anchor) on a page relative to the parent page. The title of the generated link is the section name.

{{rlpsd|page#Section }} - makes a link to a section (anchor) on a page relative to the parent page. The title of the generated link is the section name with the first letter de-capitalized.

[edit] Teletype font

{{rlt|page |title (optional)}} - makes a link to a page relative to this page (i.e. to a sub-page).

{{rlpt|page |title (optional)}} - makes a link to a page relative to the parent page.

{{rlpt|/ |title }} - makes a link to the parent page.

{{rlpf|page |title (optional)|args=arguments (optional)}} - makes a link to a page relative to the parent page. Parentheses indicating function are appended, which enclose the optional arguments.

{{rlpst|page#section }} - makes a link to a section (anchor) on a page relative to the parent page. The title of the generated link is the section name.

{{ttt|identifier }} - makes a link to the current page (via the #top link).

Example: {{ttt|this_page}} results in this_page.

[edit] Italic teletype font

{{rli|page |title (optional)}} - makes a link to a page relative to this page (i.e. to a sub-page).

{{rlpi|page |title (optional)}} - makes a link to a page relative to the parent page.

{{rlpi|/ |title }} - makes a link to the parent page.

{{rlpsi|page#section }} - makes a link to a section (anchor) on a page relative to the parent page. The title of the generated link is the section name.

[edit] Decorated links

{{attr|attribute |title (optional)|additional title (optional)|lang=language (optional)}}

Used to create a link to C/C++ language attribute specifier description. Parameters:
  • attribute - an attribute specifier name.
  • title - an attribute specifier title.
  • additional title - additional elements after the title.
  • language - cpp or c. If language is not given, {{get lang}} is used.
Example: {{attr|assume}} results in [[assume]].
Example: {{attr|noreturn|_Noreturn|lang=c}} results in [[_Noreturn]].
Example: {{attr|deprecated|3=("because")}} results in [[deprecated("because")]].