isPureVirtual: Test if C++ method is constant or pure virtual.

View source: R/clangGen.R

isPureVirtualR Documentation

Test if C++ method is constant or pure virtual.

Description

These functions test whether a given C++ method is either constant, i.e., doesn't modify the object's state, or if it is a pure virtual method that must be overriden by one or more subclasses.

Usage

isPureVirtual(C)
isConst(C)

Arguments

C

a CXCursor representing a C++ method

Value

A scalar integer value.

Author(s)

Duncan Temple Lang

See Also

createTU

Examples

f = system.file("exampleCode", "classPure.cc", package = "RCIndex")
tu = createTU(f)
k = getCppClasses(tu)

bar1 = k$Foo@methods[[2]]

isPureVirtual(bar1)
isConst(bar1)

sapply(k$Foo@methods, isConst)
sapply(k$Foo@methods, isPureVirtual)


omegahat/RClangSimple documentation built on Aug. 17, 2024, 10:23 a.m.