module documentation

The C++ language domain.

Unknown Field: copyright
Copyright 2007-2022 by the Sphinx team, see AUTHORS.
Unknown Field: license
BSD, see LICENSE for details.
Constant T Important note on ids ----------------------------------------------------------------------------
Variable logger Undocumented
Variable udl​_identifier​_re Undocumented
Class _​Duplicate​Symbol​Error Undocumented
Class ​Alias​Node Undocumented
Class ​Alias​Transform Undocumented
Class ​ASTAlignof​Expr Undocumented
Class ​ASTArray Undocumented
Class ​ASTAssignment​Expr Undocumented
Class ​ASTBase Undocumented
Class ​ASTBase​Class Undocumented
Class ​ASTBin​Op​Expr Undocumented
Class ​ASTBoolean​Literal Undocumented
Class ​ASTBraced​Init​List Undocumented
Class ​ASTCast​Expr Undocumented
Class ​ASTChar​Literal Undocumented
Class ​ASTClass Undocumented
Class ​ASTComma​Expr Undocumented
Class ​ASTConcept Undocumented
Class ​ASTDeclaration Undocumented
Class ​ASTDeclarator Undocumented
Class ​ASTDeclarator​Mem​Ptr Undocumented
Class ​ASTDeclarator​Name​Bit​Field Undocumented
Class ​ASTDeclarator​Name​Param​Qual Undocumented
Class ​ASTDeclarator​Param​Pack Undocumented
Class ​ASTDeclarator​Paren Undocumented
Class ​ASTDeclarator​Ptr Undocumented
Class ​ASTDeclarator​Ref Undocumented
Class ​ASTDecl​Specs Undocumented
Class ​ASTDecl​Specs​Simple Undocumented
Class ​ASTDelete​Expr Undocumented
Class ​ASTEnum Undocumented
Class ​ASTEnumerator Undocumented
Class ​ASTExplicit​Cast Undocumented
Class ​ASTExplicit​Spec Undocumented
Class ​ASTExpression Undocumented
Class ​ASTFallback​Expr Undocumented
Class ​ASTFold​Expr Undocumented
Class ​ASTFunction​Parameter Undocumented
Class ​ASTIdentifier Undocumented
Class ​ASTId​Expression Undocumented
Class ​ASTInitializer Undocumented
Class ​ASTLiteral Undocumented
Class ​ASTNamespace Undocumented
Class ​ASTNested​Name Undocumented
Class ​ASTNested​Name​Element Undocumented
Class ​ASTNew​Expr Undocumented
Class ​ASTNoexcept​Expr Undocumented
Class ​ASTNoexcept​Spec Undocumented
Class ​ASTNumber​Literal Undocumented
Class ​ASTOperator No class docstring; 1/5 method documented
Class ​ASTOperator​Build​In Undocumented
Class ​ASTOperator​Literal Undocumented
Class ​ASTOperator​Type Undocumented
Class ​ASTPack​Expansion​Expr Undocumented
Class ​ASTParameters​Qualifiers Undocumented
Class ​ASTParen​Expr Undocumented
Class ​ASTParen​Expr​List Undocumented
Class ​ASTPointer​Literal Undocumented
Class ​ASTPostfix​Array Undocumented
Class ​ASTPostfix​Call​Expr Undocumented
Class ​ASTPostfix​Dec Undocumented
Class ​ASTPostfix​Expr Undocumented
Class ​ASTPostfix​Inc Undocumented
Class ​ASTPostfix​Member Undocumented
Class ​ASTPostfix​Member​Of​Pointer Undocumented
Class ​ASTPostfix​Op Undocumented
Class ​ASTRequires​Clause Undocumented
Class ​ASTSizeof​Expr Undocumented
Class ​ASTSizeof​Param​Pack Undocumented
Class ​ASTSizeof​Type Undocumented
Class ​ASTString​Literal Undocumented
Class ​ASTTemplate​Arg​Constant Undocumented
Class ​ASTTemplate​Args Undocumented
Class ​ASTTemplate​Declaration​Prefix Undocumented
Class ​ASTTemplate​Introduction Undocumented
Class ​ASTTemplate​Introduction​Parameter Undocumented
Class ​ASTTemplate​Key​Param​Pack​Id​Default Undocumented
Class ​ASTTemplate​Param Undocumented
Class ​ASTTemplate​Param​Constrained​Type​With​Init Undocumented
Class ​ASTTemplate​Param​Non​Type Undocumented
Class ​ASTTemplate​Params Undocumented
Class ​ASTTemplate​Param​Template​Type Undocumented
Class ​ASTTemplate​Param​Type Undocumented
Class ​ASTThis​Literal Undocumented
Class ​ASTTrailing​Type​Spec Undocumented
Class ​ASTTrailing​Type​Spec​Decltype Undocumented
Class ​ASTTrailing​Type​Spec​Decltype​Auto Undocumented
Class ​ASTTrailing​Type​Spec​Fundamental Undocumented
Class ​ASTTrailing​Type​Spec​Name Undocumented
Class ​ASTType Undocumented
Class ​ASTType​Id Undocumented
Class ​ASTType​Using Undocumented
Class ​ASTType​With​Init Undocumented
Class ​ASTUnary​Op​Expr Undocumented
Class ​ASTUnion Undocumented
Class ​ASTUser​Defined​Literal Undocumented
Class ​CPPAlias​Object No class docstring; 0/3 instance variable, 0/1 class variable, 1/1 method documented
Class ​CPPClass​Object Undocumented
Class ​CPPConcept​Object Undocumented
Class ​CPPDomain C++ language domain.
Class ​CPPEnumerator​Object Undocumented
Class ​CPPEnum​Object Undocumented
Class ​CPPExpr​Role Undocumented
Class ​CPPFunction​Object Undocumented
Class ​CPPMember​Object Undocumented
Class ​CPPNamespace​Object This directive is just to tell Sphinx that we're documenting stuff in namespace foo.
Class ​CPPNamespace​Pop​Object Undocumented
Class ​CPPNamespace​Push​Object Undocumented
Class ​CPPObject Description of a C++ language object.
Class ​CPPType​Object Undocumented
Class ​CPPUnion​Object Undocumented
Class ​CPPXRef​Role Undocumented
Class ​Definition​Parser No class docstring; 0/3 property, 0/1 instance variable, 2/47 methods documented
Class ​Lookup​Key Undocumented
Class ​Symbol Undocumented
Class ​Symbol​Lookup​Result Undocumented
Function ​_make​_phony​_error​_name Undocumented
Function setup Undocumented
Variable ​_expression​_assignment​_ops Undocumented
Variable ​_expression​_bin​_ops Undocumented
Variable ​_expression​_unary​_ops Undocumented
Variable ​_fold​_operator​_re Undocumented
Variable ​_id​_char​_from​_prefix Undocumented
Variable ​_id​_explicit​_cast Undocumented
Variable ​_id​_fundamental​_v1 Undocumented
Variable ​_id​_fundamental​_v2 Undocumented
Variable ​_id​_operator​_unary​_v2 Undocumented
Variable ​_id​_operator​_v1 Undocumented
Variable ​_id​_operator​_v2 Undocumented
Variable ​_id​_prefix Undocumented
Variable ​_id​_shorthands​_v1 Undocumented
Variable ​_keywords Undocumented
Variable ​_max​_id Undocumented
Variable ​_operator​_re Undocumented
Variable ​_simple​_type​_specifiers​_re Undocumented
Variable ​_string​_re Undocumented
Variable ​_visibility​_re Undocumented
T =

Important note on ids

Multiple id generation schemes are used due to backwards compatibility. - v1: 1.2.3 <= version < 1.3

The style used before the rewrite. It is not the actual old code, but a replication of the behaviour.

All versions are generated and attached to elements. The newest is used for the index. All of the versions should work as permalinks.

Signature Nodes and Tagnames

Each signature is in a desc_signature node, where all children are desc_signature_line nodes. Each of these lines will have the attribute 'sphinx_line_type' set to one of the following (prioritized): - 'declarator', if the line contains the name of the declared object. - 'templateParams', if the line starts a template parameter list, - 'templateParams', if the line has template parameters

Note: such lines might get a new tag in the future.
  • 'templateIntroduction, if the line is on the form 'conceptName{...}'

No other desc_signature nodes should exist (so far).

Grammar

See https://www.nongnu.org/hcb/ for the grammar, and https://github.com/cplusplus/draft/blob/master/source/grammar.tex, and https://github.com/cplusplus/concepts-ts for the newest grammar.

common grammar things:
template-declaration ->
"template" "<" template-parameter-list ">" declaration
template-parameter-list ->
template-parameter
template-parameter-list "," template-parameter
template-parameter ->
type-parameter
parameter-declaration # i.e., same as a function argument
type-parameter ->
"class" "..."[opt] identifier[opt]
"class" identifier[opt] "=" type-id
"typename" "..."[opt] identifier[opt]
"typename" identifier[opt] "=" type-id
"template" "<" template-parameter-list ">" "class" "..."[opt] identifier[opt]
"template" "<" template-parameter-list ">" "class" identifier[opt] "=" id-expression

# also, from C++17 we can have "typename" in template templates

templateDeclPrefix ->
"template" "<" template-parameter-list ">"
simple-declaration ->
attribute-specifier-seq[opt] decl-specifier-seq[opt]
init-declarator-list[opt] ;

# Make the semicolon optional. # For now: drop the attributes (TODO). # Use at most 1 init-declarator. -> decl-specifier-seq init-declarator -> decl-specifier-seq declarator initializer

decl-specifier ->
storage-class-specifier ->
( "static" (only for member_object and function_object)
"extern" (only for member_object and function_object)
"register"

) thread_local[opt] (only for member_object)

(it can also appear before the others)
type-specifier -> trailing-type-specifier
function-specifier -> "inline" | "virtual" | "explicit" (only for function_object)
"friend" (only for function_object)
"constexpr" (only for member_object and function_object)
trailing-type-specifier ->
simple-type-specifier
elaborated-type-specifier
typename-specifier
cv-qualifier -> "const" | "volatile"

stricter grammar for decl-specifier-seq (with everything, each object uses a subset):

visibility storage-class-specifier function-specifier "friend" "constexpr" "volatile" "const" trailing-type-specifier # where trailing-type-specifier can no be cv-qualifier

# Inside e.g., template parameters a strict subset is used # (see type-specifier-seq) trailing-type-specifier ->

simple-type-specifier ->
::[opt] nested-name-specifier[opt] type-name
::[opt] nested-name-specifier "template" simple-template-id
"char" | "bool" | etc.
decltype-specifier
elaborated-type-specifier -> class-key attribute-specifier-seq[opt] ::[opt] nested-name-specifier[opt] identifier | class-key ::[opt] nested-name-specifier[opt] template[opt] simple-template-id | "enum" ::[opt] nested-name-specifier[opt] identifier
typename-specifier -> "typename" ::[opt] nested-name-specifier identifier | "typename" ::[opt] nested-name-specifier template[opt] simple-template-id

class-key -> "class" | "struct" | "union" type-name ->* identifier | simple-template-id # ignoring attributes and decltype, and then some left-factoring trailing-type-specifier ->

rest-of-trailing ("class" | "struct" | "union" | "typename") rest-of-trailing built-in -> "char" | "bool" | etc. decltype-specifier
rest-of-trailing -> (with some simplification)
"::"[opt] list-of-elements-separated-by-:
element ->
"template"[opt] identifier ("<" template-argument-list ">")[opt]
template-argument-list ->
template-argument "..."[opt]
template-argument-list "," template-argument "..."[opt]
template-argument ->
constant-expression
type-specifier-seq abstract-declarator
id-expression
declarator ->
ptr-declarator
noptr-declarator parameters-and-qualifiers trailing-return-type
ptr-declarator ->
noptr-declarator
ptr-operator ptr-declarator
noptr-declarator ->
declarator-id attribute-specifier-seq[opt] ->
"..."[opt] id-expression
rest-of-trailing
noptr-declarator parameters-and-qualifiers
noptr-declarator "[" constant-expression[opt] "]" attribute-specifier-seq[opt]
"(" ptr-declarator ")"
ptr-operator ->
"*" attribute-specifier-seq[opt] cv-qualifier-seq[opt]
"& attribute-specifier-seq[opt]
"&&" attribute-specifier-seq[opt]
"::"[opt] nested-name-specifier "*" attribute-specifier-seq[opt] cv-qualifier-seq[opt]

# function_object must use a parameters-and-qualifiers, the others may # use it (e.g., function pointers) parameters-and-qualifiers ->

"(" parameter-clause ")" attribute-specifier-seq[opt] cv-qualifier-seq[opt] ref-qualifier[opt] exception-specification[opt]

ref-qualifier -> "&" | "&&" exception-specification ->

"noexcept" ("(" constant-expression ")")[opt] "throw" ("(" type-id-list ")")[opt]

# TODO: we don't implement attributes # member functions can have initializers, but we fold them into here memberFunctionInit -> "=" "0" # (note: only "0" is allowed as the value, according to the standard, # right?)

enum-head ->
enum-key attribute-specifier-seq[opt] nested-name-specifier[opt]
identifier enum-base[opt]

enum-key -> "enum" | "enum struct" | "enum class" enum-base ->

":" type
enumerator-definition ->
identifier
identifier "=" constant-expression

We additionally add the possibility for specifying the visibility as the first thing.

concept_object:
goal:
just a declaration of the name (for now)
grammar: only a single template parameter list, and the nested name

may not have any template argument lists

"template" "<" template-parameter-list ">" nested-name-specifier

type_object:
goal:
either a single type (e.g., "MyClass:Something_T" or a typedef-like thing (e.g. "Something Something_T" or "int I_arr[]"

grammar, single type: based on a type in a function parameter, but without a name:

parameter-declaration
-> attribute-specifier-seq[opt] decl-specifier-seq
abstract-declarator[opt]

# Drop the attributes -> decl-specifier-seq abstract-declarator[opt]

grammar, typedef-like: no initilizer
decl-specifier-seq declarator

Can start with a templateDeclPrefix.

member_object:

goal: as a type_object which must have a declarator, and optionally with a initializer grammar:

decl-specifier-seq declarator initializer

Can start with a templateDeclPrefix.

function_object:

goal: a function declaration, TODO: what about templates? for now: skip grammar: no initializer

decl-specifier-seq declarator

Can start with a templateDeclPrefix.

class_object:

goal: a class declaration, but with specification of a base class grammar:

nested-name "final"[opt] (":" base-specifier-list)[opt]
base-specifier-list ->
base-specifier "..."[opt]
base-specifier-list, base-specifier "..."[opt]
base-specifier ->
base-type-specifier
"virtual" access-spe"cifier[opt] base-type-specifier
access-specifier[opt] "virtual"[opt] base-type-specifier

Can start with a templateDeclPrefix.

enum_object:
goal: an unscoped enum or a scoped enum, optionally with the underlying
type specified
grammar:
("class" | "struct")[opt] visibility[opt] nested-name (":" type)[opt]
enumerator_object:
goal: an element in a scoped or unscoped enum. The name should be
injected according to the scopedness.
grammar:
nested-name ("=" constant-expression)
namespace_object:

goal: a directive to put all following declarations in a specific scope grammar:

nested-name
Value
TypeVar('T')
logger =

Undocumented

udl_identifier_re =

Undocumented

def _make_phony_error_name():

Undocumented

Returns
ASTNestedNameUndocumented
def setup(app):

Undocumented

Parameters
app:SphinxUndocumented
Returns
Dict[str, Any]Undocumented
_expression_assignment_ops: list[str] =

Undocumented

_expression_bin_ops: list =

Undocumented

_expression_unary_ops: list[str] =

Undocumented

_fold_operator_re =

Undocumented

_id_char_from_prefix: Dict[Optional[str], str] =

Undocumented

_id_explicit_cast: dict[str, str] =

Undocumented

_id_fundamental_v1: dict[str, str] =

Undocumented

_id_fundamental_v2: dict[str, str] =

Undocumented

_id_operator_unary_v2: dict[str, str] =

Undocumented

_id_operator_v1: dict[str, str] =

Undocumented

_id_operator_v2: dict[str, str] =

Undocumented

_id_prefix: list =

Undocumented

_id_shorthands_v1: dict[str, str] =

Undocumented

_keywords: list[str] =

Undocumented

_max_id: int =

Undocumented

_operator_re =

Undocumented

_simple_type_specifiers_re =

Undocumented

_string_re =

Undocumented

_visibility_re =

Undocumented