cmakepp_lang/object/singleton

cmakepp_lang/object/singleton._cpp_object_singleton(this)

Note

This is a macro, and so does not introduce a new scope.

Returns a new default constructed Object instance.

This function creates a new default constructed Object instance. This instance is only an Object instance (contrast this with derived class instances created using _cpp_object_ctor). All instances of the Object class have identical state and thus for efficiency reasons it makes sense to have a single Object instance that all derived class instances alias.

Parameters:

this (desc) – Name for the variable which will hold the new instance.

Returns:

this will be set to the newly created Object instance.

Return type:

obj

Variables:

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

Note

This command is a macro so that the member function definitions permeate into the caller’s scope.

Error Checking

If CMakePP is run in debug mode (and only if CMakePP is run in debug mode) this function will ensure that it was called with exactly one argument and that the one argument is of type desc. If either of these asserts fails an error will be raised.