Explicit Template InstanceExplicit template instances for types, functions and variables. For example: Code Block |
---|
template <typename T> void func(){}
template void func<int>(); // Explicit Template Instance
template <typename T> class C { T m1; };
template class C <int>; // Explicit Template Instance |
FriendFriend function declaration. For example: Code Block |
---|
void friendFunc();
class Foo {
public:
friend void friendFunc(); // Friend
}; |
FunctionsFunction declarations. This includes Global and Member functions.. Global FunctionGlobal function declaration. For example: Code Block |
---|
void globalFunc1();
// Global Function, IsDecl is true
// IsImplementation is false
// HasVoid is true
void globalFunc2() { }
// Global Function, IsDecl is true
// IsImplementation is true
// HasEllipsis is true |
Member FunctionMember function declaration. For example: Code Block |
---|
class Foo {
public:
Foo () {}; // Member Function, IsDefaultConstructor is true
void func(); // Member Function
}; |
ParameterParameters include parameter and this. ParameterFunction parameter declaration. For example: void func(int i); // i is parameter whose type is int
ThisParameter usage. For example: Code Block |
---|
class T{
T* func(T t){return this; } //this parameter
} |
Anchor |
---|
| static_assert |
---|
| static_assert |
---|
| static_assert Static assertion declaration. For example: Code Block |
---|
static_assert(sizeof(int) == 8, "Incorrect size of int type");
// Condition property points to: sizeof(int) == 8
// Message property points to: "Incorrect size of int type" |
VariablesVariables include global, local, and member variables. Global VariableGlobal Variable. For example: Code Block |
---|
int global; // Global Variable, IsDecl is true
global = 3; // Global Variable, IsDecl is false |
Local VariableLocal Variable. For example: Code Block |
---|
void func() {
int local; // Local Variable, IsDecl is true
local = 3; // Local Variable, IsDecl is false
} |
Member VariableMember Variable. For example: Code Block |
---|
class Foo {
public:
Foo() : member(0) { } // Member Variable, IsDecl is false
private:
int member; // Member Variable, IsDecl is true
}; |
|