constOf( typePattern )

Coverity Documentation

Version
latest

Matches types that have a const qualification.

The pattern produced by this function matches various forms of const qualification of the type described by the typePattern field, including the following kinds of constants:

  • An explicit const against a simple type (for example, const int)
  • An alias defined against a const-qualified type (for example, using cint = const int;)

Parameters and return value

Name Type Description
typePattern pattern(type) -> Result A pattern matching some simple type
return value pattern(type) -> Result A pattern that matches a const-qualified variation of the given type

Example

Assuming that the following type definition appears in your C# source:


C# code follows
const int ci;

... then the use of this CodeXM pattern:


CXM code follows
constOf(int);

... matches the actual type const int in your source code.