On this page:
IceUtil::Optional template provides constructors and assignment operators that allow you to initialize an instance using the element type or an existing optional value. The default constructor initializes an instance to an unset condition. The
get method and dereference operators retrieve the current value held by the instance, or throw
IceUtil::OptionalNotSetException if no value is currently set. Use the
! operators to test whether the instance has a value prior to dereferencing it. Finally, the
swap method exchanges the state of two instances.
The template includes a constructor and assignment operator that accept
NoneType. Ice defines an instance of this type,
IceUtil::None, that you can use to initialize (or reset) an
Optional instance to an unset condition:
You can pass
IceUtil::None anywhere an
IceUtil::Optional value is expected.