cmakepp_lang/types/type_of

cmakepp_lang/types/type_of.cpp_type_of(result obj)

Returns the type literal for the provided object.

This function encapsulates the process of determining the type of an object. It is capable of determining the type of intrinsic CMake objects (integers, booleans, etc.), intrinsic CMakePP objects (Object, Class, and Map), and user-defined classes.

Parameters:
  • result (desc) – Name for the variable which will hold the result.

  • obj (str) – The object we want the type of.

Returns:

result will be set to the type literal corresponding to obj’s type.

Return type:

type

Error Checking

cpp_type_of will ensure that the caller has provided only 2 arguments and, if the caller has provided a different amount, will raise an error.