cmakepp_lang/asserts/type

cmakepp_lang/asserts/type.cpp_assert_type(type obj)

Tests that the provided object can be implicitly cast to the provided type.

If CMakePP is run in debug mode, this function will throw an error if the provided object is not implicitly convertible to the provided type. If CMakePP is not being run in debug mode, then this function is a no-op.

Parameters:
  • type (type) – The type that the type of the object must be implicitly convertible to.

  • obj (str) – The object whose type must be implicitly convertible to type.

Variables:

CMAKEPP_LANG_DEBUG_MODE (bool) – Used to determine if CMakePP is being run in debug mode

Error Checking

In addition to asserting that the provided object’s type is implicitly convertible to the provided type. This function will also ensure that the caller has only provided two arguments and that type is actually a type. These additional error checks are also only done when CMakePP is run in debug mode.