This page contains guidelines for creating documents for various language or library entities.
The Behavior component gives highlight colors to its content, which could be used for emphasizing keywords related to program behaviors.
import Behavior from " @components/Behavior.astro " ;
It is < Behavior kind = " well-def " > well-defined </ Behavior > to do this.
It is < Behavior kind = " impl-def " > implementation-defined </ Behavior >
It is < Behavior kind = " unspec " > unspecified </ Behavior >
which function argument will be evaluated first.
The behavior is < Behavior kind = " undef " > undefined </ Behavior >
to add two signed integers that overflows the result.
It is < Behavior kind = " ill-formed " > ill-formed </ Behavior >
to use an undefined identifier.
< Behavior kind = " ifndr " > ill-formed no diagnostics required </ Behavior >
if it violates the one-definition rule.
Preview
It is well-defined to do this.
It is implementation-defined how this is achieved.
It is unspecified which function argument will be evaluated first.
The behavior is undefined to add two signed integers that overflows the result.
It is ill-formed to use an undefined identifier.
The program is ill-formed no diagnostics required if it violates the one-definition rule.
The DeclDoc component gives brief introduction to a C/C++ declaration.
import { Decl, DeclDoc } from " @components/decl-doc " ;
int main () { /* body */ }
A ` main ` function is the entry point of a program.
Preview
int main () { /* body */ }
A main function running independently of environment-provided arguments.
Expand
A DeclDoc component can contain multiple Decl as well:
import { Decl, DeclDoc } from " @components/decl-doc " ;
int main () { /* body */ }
int main ( int argc , char * argv []) { /* body */ }
A ` main ` function is the entry point of a program.
Preview
int main () { /* body */ }
int main ( int argc , char * argv []) { /* body */ }
A main function is the entry point of a program.
Expand
You could specify revisions for each declaration with the RevisionBlock component:
import { Decl, DeclDoc } from " @components/decl-doc " ;
import { RevisionBlock } from " @components/revision " ;
< DeclDoc autorevSince = " C++11 " >
< RevisionBlock since = " C++11 " until = " C++14 " noborder >
typename std::remove_reference<T>::type && move (T && t) noexcept ;
< RevisionBlock since = " C++14 " noborder >
constexpr std:: remove_reference_t <T> && move (T && t ) noexcept ;
` std::move ` is used to _ indicate _ that an object ` t ` may be "moved from", i.
e. allowing the efficient transfer of resources from ` t ` to another object.
Preview
typename std::remove_reference<T>::type && move (T && t) noexcept ;
constexpr std:: remove_reference_t <T> && move (T && t ) noexcept ;
std::move is used to indicate that an object t may be “moved from”, i.
e. allowing the efficient transfer of resources from t to another object.
Expand
The DescList component is a general component for displaying a list of items and their descriptions. It could be used for listing headers, functions, classes, members, etc. while giving each of them a brief introduction.
import { DescList, Desc } from " @components/desc-list " ;
< CHeader slot = " item " name = " assert " />
Conditionally compiled macro that compares its argument to zero
< CHeader slot = " item " name = " ctype " />
Functions to determine the type contained in character data
< CHeader slot = " item " name = " errno " />
Macros reporting error conditions
Preview
Conditionally compiled macro that compares its argument to zero
Functions to determine the type contained in character data
Macros reporting error conditions
You could attach revision information to each description list item with a combination of RevisionBlock and autorev attributes.
import { CHeader } from " @components/header " ;
import { Desc, DescList } from " @components/desc-list " ;
import { RevisionBlock } from " @components/revision " ;
< CHeader slot = " item " name = " assert " />
Conditionally compiled macro that compares its argument to zero
< Desc autorevSince = " C99 " >
< RevisionBlock slot = " item " noborder since = " C99 " vertical >
< CHeader name = " complex " />
Complex number arithmetic
< CHeader slot = " item " name = " ctype " />
Functions to determine the type contained in character data
Preview
Conditionally compiled macro that compares its argument to zero
Complex number arithmetic
Functions to determine the type contained in character data
The ParamDocList component can be used to document function or template parameters.
Non-negative value representing the number of arguments passed to the program.
Pointer to the first element of an array of ` argc + 1 ` pointers.
Preview
argc
-
Non-negative value representing the number of arguments passed to the program.
argv
-
Pointer to the first element of an array of argc + 1 pointers.
Each page could optionally associate itself with zero or more doc keys through its frontmatter.
keys : [ " cpp.library.utilities.move " ]
The DocLink component allows you to render an inline link to the page associated with the specified doc key. You can also specify the destination page by its absolute path.
import DocLink from " @components/DocLink.astro " ;
< DocLink src = " cpp.library.utilities.move " > this page </ DocLink >
for more information about ` std::move ` .
< DocLink src = " /cpp/library/utilities/move " > this page </ DocLink >
for more information about ` std::move ` .
Preview
Check out this page for detailed information about std::move.
Check out this page for more information about std::move.
The CHeader and the CppHeader component renders an inline link to the documentation page of a header file.
import { CHeader, CppHeader } from " @components/header " ;
< CHeader name = " stdio " /> is a C standard library header.
Entities in it can be used in a C++ program by including the header
< CppHeader name = " cstdio " /> .
< CppHeader name = " vector " /> is a C++ standard library header.
Preview
is a C standard library header. Entities in it can be used in a C++ program by including the header .
is a C++ standard library header.
The FeatureTestMacro component renders to a box that shows information about a feature test macro.
} from " @components/feature-test-macro " ;
< FeatureTestMacro name = " __cpp_consteval " >
< FeatureTestMacroValue value = " 201811L " since = " C++20 " >
< FeatureTestMacroValue value = " 202211L " since = " C++23 " >
Making ` consteval ` propagate up
Preview
Feature test macro __cpp_consteval Value Since Feature 201811L C++20 Immediate functions
202211L C++23 Making consteval propagate up
The DRList component shows a list of defect reports (DRs). Each defect report is rendered by a DR component.
import { DR, DRList } from " @components/defect-report " ;
< DR kind = " cwg " id = { 1003 } std = " C++98 " >
< Fragment slot = " behavior-published " >
supported parameter names of ` main ` were overly restricted
< Fragment slot = " correct-behavior " >
all valid parameter names are supported
< DR kind = " cwg " id = { 1886 } std = " C++98 " >
< Fragment slot = " behavior-published " >
the ` main ` function could be declared with a language linkage
< Fragment slot = " correct-behavior " >
< DR kind = " cwg " id = { 2479 } std = " C++20 " >
< Fragment slot = " behavior-published " >
the ` main ` function could be declared ` consteval `
< Fragment slot = " correct-behavior " >
Preview
CWG 1003 (C++98) CWG 1886 (C++98) CWG 2479 (C++20)
The Missing component could be used for marking content that is still missing.
import { Missing } from " @components/missing " ;
See < Missing > this page </ Missing > for more information.
Preview
See this page for more information.