cmakepp_lang/utilities/unique_id
- cmakepp_lang/utilities/unique_id.cpp_unique_id(id)
Generates a unique identifier.
This function will create a unique identifier which can be used, for example, as the “this” pointer for an object. The uniqueness of the identifier relies on mangling the time (with second resolution) and a random string. Thus the result should be unique so long as the same random string is not generated during the same second. No check for uniqueness is currently present although one could be added.
- Parameters:
id (desc) – The name for the variable which will hold the result.
- Returns:
id
will be set to the generated unique id.- Return type:
desc
- Variables:
CMAKEPP_LANG_DEBUG_MODE (bool) – Used to determine if CMakePP is being run in debug mode or not.
Error Checking
If CMakePP is run in debug mode
cpp_unique_id
will ensure that it was passed only one argument and that that argument is of typedesc
.