The routines in this group provide access information in the ASTs specific to C++ language features. More...
The routines in this group provide access information in the ASTs specific to C++ language features.
Determine if a C++ constructor is a converting constructor.
Determine if a C++ constructor is a copy constructor.
References CINDEX_LINKAGE.
Determine if a C++ constructor is the default constructor.
References CINDEX_LINKAGE.
Determine if a C++ constructor is a move constructor.
References CINDEX_LINKAGE.
Determine if a C++ field is declared 'mutable'.
References CINDEX_LINKAGE.
Determine if a C++ member function or member function template is declared 'const'.
References CINDEX_LINKAGE.
Determine if a C++ member function is a copy-assignment operator, returning 1 if such is the case and 0 otherwise.
A copy-assignment operator X::operator= is a non-static, non-template member function of class X with exactly one parameter of type X, X&, const X&, volatile X& or const volatile X&.
That is, for example, the operator= in:
class Foo { bool operator=(const volatile Foo&); };
Is a copy-assignment operator, while the operator= in:
class Bar { bool operator=(const int&); };
Is not.
References CINDEX_LINKAGE.
Determine if a C++ method is declared '= default'.
References CINDEX_LINKAGE.
Determine if a C++ method is declared '= delete'.
References CINDEX_LINKAGE.
Determines if a C++ constructor or conversion function was declared explicit, returning 1 if such is the case and 0 otherwise.
Constructors or conversion functions are declared explicit through the use of the explicit specifier.
For example, the following constructor and conversion function are not explicit as they lack the explicit specifier:
class Foo { Foo(); operator int(); };
While the following constructor and conversion function are explicit as they are declared with the explicit specifier.
class Foo { explicit Foo(); explicit operator int(); };
This function will return 0 when given a cursor pointing to one of the former declarations and it will return 1 for a cursor pointing to the latter declarations.
The explicit specifier allows the user to specify a conditional compile-time expression whose value decides whether the marked element is explicit or not.
For example:
constexpr bool foo(int i) { return i % 2 == 0; } class Foo { explicit(foo(1)) Foo(); explicit(foo(2)) operator int(); }
This function will return 0 for the constructor and 1 for the conversion function.
References CINDEX_LINKAGE.
Determine if a C++ member function is a move-assignment operator, returning 1 if such is the case and 0 otherwise.
A move-assignment operator X::operator= is a non-static, non-template member function of class X with exactly one parameter of type X&&, const X&&, volatile X&& or const volatile X&&.
That is, for example, the operator= in:
class Foo { bool operator=(const volatile Foo&&); };
Is a move-assignment operator, while the operator= in:
class Bar { bool operator=(const int&&); };
Is not.
References CINDEX_LINKAGE.
Determine if a C++ member function or member function template is pure virtual.
References CINDEX_LINKAGE.
Determine if a C++ member function or member function template is declared 'static'.
References CINDEX_LINKAGE.
Determine if a C++ member function or member function template is explicitly declared 'virtual' or if it overrides a virtual method from one of the base classes.
References CINDEX_LINKAGE.
Determine if a C++ record is abstract, i.e.
whether a class or struct has a pure virtual member function.
References CINDEX_LINKAGE.
Determine if an enum declaration refers to a scoped enum.
References CINDEX_LINKAGE.
Given a cursor that references something else, return the source range covering that reference.
References CINDEX_LINKAGE.
Given a cursor that may represent a specialization or instantiation of a template, retrieve the cursor that represents the template that it specializes or from which it was instantiated.
This routine determines the template involved both for explicit specializations of templates and for implicit instantiations of the template, both of which are referred to as "specializations". For a class template specialization (e.g., std::vector<bool>
), this routine will return either the primary template (std::vector
) or, if the specialization was instantiated from a class template partial specialization, the class template partial specialization. For a class template partial specialization and a function template specialization (including instantiations), this this routine will return the specialized template.
For members of a class template (e.g., member functions, member classes, or static data members), returns the specialized or instantiated member. Although not strictly "templates" in the C++ language, members of class templates have the same notions of specializations and instantiations that templates do, so this routine treats them similarly.
References CINDEX_LINKAGE.
Given a cursor that represents a template, determine the cursor kind of the specializations would be generated by instantiating the template.
This routine can be used to determine what flavor of function template, class template, or class template partial specialization is stored in the cursor. For example, it can describe whether a class template cursor is declared with "struct", "class" or "union".
C
. If C
is not a template, returns CXCursor_NoDeclFound
. References CINDEX_LINKAGE.