Go to the source code of this file.
◆ MR_std_function_void
Stores a functor of type: void(void). Possibly stateful. Supported MR_PassBy modes: MR_PassBy_DefaultConstruct, MR_PassBy_Copy, MR_PassBy_Move (and MR_PassBy_DefaultArgument and MR_PassBy_NoObject if supported by the callee).
◆ MR_protectedFunc()
returns a function, which executes protectedRun( unprotectedFunc ), logging a possible exception but always returning For example, executing in Release configuration the following line does not terminate the program: std::thread( protectedFunc( []() { throw std::runtime_error( "Ops" ); } ) ).join(); Generated from function MR::protectedFunc. Never returns null. Returns an instance allocated on the heap! Must call MR_std_function_void_Destroy() to free it when you're done using it.
◆ MR_protectedRun()
in Debug configuration: simply executes given task, returns no error; in Release configuration: executes given task inside C++ try-catch block, returns exception's info as error string; on Windows it also catches structured exceptions (SEH) Generated from function MR::protectedRun. Parameter task can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_expected_void_std_string_Destroy() to free it when you're done using it.