Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
RelaxedTemplateDeclaration Struct Reference

#include <template_declaration.h>

Inheritance diagram for RelaxedTemplateDeclaration:
Collaboration diagram for RelaxedTemplateDeclaration:

Public Member Functions

std::size_t visibleParameterCount () const
 Returns the number of template parameters that are visible in rendered output — SFINAE-annotated parameters are excluded.
std::string to_std_string_for_rendering () const
 Returns a string representation that excludes SFINAE-annotated parameters.
QString to_qstring () const
QString to_qstring_multiline () const
QSet< QStringparameterNames () const
 Returns the set of all declared template parameter names.
QSet< QStringrequiredParameterNamesForFunctions () const
 Returns the set of template parameter names that are API-significant and should be documented for functions.
Public Member Functions inherited from TemplateDeclarationStorage
std::string to_std_string () const

Public Attributes

std::optional< std::string > requires_clause
Public Attributes inherited from TemplateDeclarationStorage
std::vector< RelaxedTemplateParameterparameters

Detailed Description

Definition at line 445 of file template_declaration.h.

Member Function Documentation

◆ parameterNames()

QSet< QString > RelaxedTemplateDeclaration::parameterNames ( ) const
inlinenodiscard

Returns the set of all declared template parameter names.

This extracts the name from each template parameter's valued_declaration. Parameters without names (such as unnamed template parameters) are not included in the returned set.

This is useful for documentation validation, allowing QDoc to verify that template parameters can be referenced using the \a command.

Definition at line 561 of file template_declaration.h.

◆ requiredParameterNamesForFunctions()

QSet< QString > RelaxedTemplateDeclaration::requiredParameterNamesForFunctions ( ) const
inlinenodiscard

Returns the set of template parameter names that are API-significant and should be documented for functions.

This includes only non-type template parameters (such as {int Size}) and template-template parameters, which carry meaning that isn't implied by function parameter types.

Type template parameters (such as {typename T}) are excluded because they typically serve to type function parameters, and documenting the function parameter implicitly covers the template parameter's role.

For class template parameters, use parameterNames() instead, as all template parameters are part of the class's primary API surface.

Definition at line 586 of file template_declaration.h.

◆ to_qstring()

QString RelaxedTemplateDeclaration::to_qstring ( ) const
inline

Definition at line 487 of file template_declaration.h.

References to_std_string_for_rendering().

Here is the call graph for this function:

◆ to_qstring_multiline()

QString RelaxedTemplateDeclaration::to_qstring_multiline ( ) const
inline

Definition at line 515 of file template_declaration.h.

◆ to_std_string_for_rendering()

std::string RelaxedTemplateDeclaration::to_std_string_for_rendering ( ) const
inlinenodiscard

Returns a string representation that excludes SFINAE-annotated parameters.

Used by to_qstring() and to_qstring_multiline() so that the rendered signature shows a clean requires clause.

The inherited to_std_string() retains all parameters (including SFINAE ones) for internal matching where parameter counts must agree between code-parsed and \fn-parsed declarations.

Definition at line 470 of file template_declaration.h.

Referenced by to_qstring().

Here is the caller graph for this function:

◆ visibleParameterCount()

std::size_t RelaxedTemplateDeclaration::visibleParameterCount ( ) const
inlinenodiscard

Returns the number of template parameters that are visible in rendered output — SFINAE-annotated parameters are excluded.

Definition at line 453 of file template_declaration.h.

Member Data Documentation

◆ requires_clause

std::optional<std::string> RelaxedTemplateDeclaration::requires_clause

Definition at line 447 of file template_declaration.h.


The documentation for this struct was generated from the following file: