CBMC
std_types.cpp File Reference

Pre-defined types. More...

#include "std_types.h"
#include "c_types.h"
#include "namespace.h"
#include "std_expr.h"
+ Include dependency graph for std_types.cpp:

Go to the source code of this file.

Functions

bool is_reference (const typet &type)
 Returns true if the type is a reference. More...
 
bool is_rvalue_reference (const typet &type)
 Returns if the type is an R value reference. More...
 
bool is_constant_or_has_constant_components (const typet &type, const namespacet &ns)
 Identify whether a given type is constant itself or contains constant components. More...
 

Detailed Description

Pre-defined types.

Definition in file std_types.cpp.

Function Documentation

◆ is_constant_or_has_constant_components()

bool is_constant_or_has_constant_components ( const typet type,
const namespacet ns 
)

Identify whether a given type is constant itself or contains constant components.

Examples include:

  • const int a;
  • struct contains_constant_pointer { int x; int * const p; };
  • const int b[3];
    Parameters
    typeThe type we want to query constness of.
    nsThe namespace, needed for resolution of symbols.
    Returns
    Whether passed in type is const or not.

Definition at line 186 of file std_types.cpp.

◆ is_reference()

bool is_reference ( const typet type)

Returns true if the type is a reference.

Definition at line 144 of file std_types.cpp.

◆ is_rvalue_reference()

bool is_rvalue_reference ( const typet type)

Returns if the type is an R value reference.

Definition at line 151 of file std_types.cpp.