Unique pointers can change in value, but as with reference pointers, they do not cause aliasing of data — that is, the data that is accessible through the pointer is not accessible through any other name in the remote operation. This constraint saves a significant amount of processing.
The pointer itself can change from a null to a non-null value or from a non-null to a null value during the call. In the following example, the pointer is null before the call and points to a valid string after the call:
By default, the unique pointer attribute is applied to all pointers that are not parameters. In Microsoft-extensions mode, this default setting can be changed with the pointer_default attribute.
A unique pointer has the following characteristics: