clang  16.0.0git
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
clang::TemplateParmPosition Class Reference

Defines the position of a template parameter within a template parameter list. More...

#include "clang/AST/DeclTemplate.h"

Inheritance diagram for clang::TemplateParmPosition:
Inheritance graph
[legend]
Collaboration diagram for clang::TemplateParmPosition:
Collaboration graph
[legend]

Public Member Functions

 TemplateParmPosition ()=delete
 
unsigned getDepth () const
 Get the nesting depth of the template parameter. More...
 
void setDepth (unsigned D)
 
unsigned getPosition () const
 Get the position of the template parameter within its parameter list. More...
 
void setPosition (unsigned P)
 
unsigned getIndex () const
 Get the index of the template parameter within its parameter list. More...
 

Protected Types

enum  { DepthWidth = 20, PositionWidth = 12 }
 

Protected Member Functions

 TemplateParmPosition (unsigned D, unsigned P)
 

Protected Attributes

unsigned Depth: DepthWidth
 
unsigned Position: PositionWidth
 

Static Protected Attributes

static constexpr unsigned MaxDepth = (1U << DepthWidth) - 1
 
static constexpr unsigned MaxPosition = (1U << PositionWidth) - 1
 

Detailed Description

Defines the position of a template parameter within a template parameter list.

Because template parameter can be listed sequentially for out-of-line template members, each template parameter is given a Depth - the nesting of template parameter scopes - and a Position - the occurrence within the parameter list. This class is inheritedly privately by different kinds of template parameters and is not part of the Decl hierarchy. Just a facility.

Definition at line 1158 of file DeclTemplate.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
DepthWidth 
PositionWidth 

Definition at line 1160 of file DeclTemplate.h.

Constructor & Destructor Documentation

◆ TemplateParmPosition() [1/2]

clang::TemplateParmPosition::TemplateParmPosition ( unsigned  D,
unsigned  P 
)
inlineprotected

Definition at line 1167 of file DeclTemplate.h.

References MaxDepth, MaxPosition, and P.

◆ TemplateParmPosition() [2/2]

clang::TemplateParmPosition::TemplateParmPosition ( )
delete

Member Function Documentation

◆ getDepth()

unsigned clang::TemplateParmPosition::getDepth ( ) const
inline

Get the nesting depth of the template parameter.

Definition at line 1180 of file DeclTemplate.h.

References Depth.

◆ getIndex()

unsigned clang::TemplateParmPosition::getIndex ( ) const
inline

Get the index of the template parameter within its parameter list.

Definition at line 1196 of file DeclTemplate.h.

References Position.

◆ getPosition()

unsigned clang::TemplateParmPosition::getPosition ( ) const
inline

Get the position of the template parameter within its parameter list.

Definition at line 1188 of file DeclTemplate.h.

References Position.

◆ setDepth()

void clang::TemplateParmPosition::setDepth ( unsigned  D)
inline

Definition at line 1181 of file DeclTemplate.h.

References Depth, and MaxDepth.

◆ setPosition()

void clang::TemplateParmPosition::setPosition ( unsigned  P)
inline

Definition at line 1189 of file DeclTemplate.h.

References MaxPosition, P, and Position.

Member Data Documentation

◆ Depth

unsigned clang::TemplateParmPosition::Depth
protected

Definition at line 1161 of file DeclTemplate.h.

Referenced by getDepth(), and setDepth().

◆ MaxDepth

constexpr unsigned clang::TemplateParmPosition::MaxDepth = (1U << DepthWidth) - 1
staticconstexprprotected

Definition at line 1164 of file DeclTemplate.h.

Referenced by setDepth(), and TemplateParmPosition().

◆ MaxPosition

constexpr unsigned clang::TemplateParmPosition::MaxPosition = (1U << PositionWidth) - 1
staticconstexprprotected

Definition at line 1165 of file DeclTemplate.h.

Referenced by setPosition(), and TemplateParmPosition().

◆ Position

unsigned clang::TemplateParmPosition::Position
protected

Definition at line 1162 of file DeclTemplate.h.

Referenced by getIndex(), getPosition(), and setPosition().


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