-
首页
-
C4D R23.110 C++ SDK
Opt< T & > Class Template Reference
#include <optional.h>
详细描述
template<typename T>
class maxon::Opt< T & >
Specialization to store lvalue references, which only uses a single pointer internally. This can be used to treat pointers that may be null as optional references for more descriptive interfaces.
Member Typedef Documentation
◆
ValueType
◆
ResultFunctions
构造函数 & 析构函数文档编制
◆
Opt()
[1/5]
Default constructor. Creates an Optional with no value.
◆
Opt()
[2/5]
Explicit construction with NO_VALUE. Has the same effect as the default constructor.
◆
Opt()
[3/5]
Opt
|
(
|
const
Opt
< T & > &
|
src
|
)
|
|
Copy constructor.
◆
Opt()
[4/5]
Constructs from reference.
◆
Opt()
[5/5]
Constructs from raw pointer.
成员函数文档编制
◆
operator=()
[1/3]
Opt
& operator=
|
(
|
const
Opt
< T & > &
|
src
|
)
|
|
Copy assignment.
◆
operator=()
[2/3]
Opt
& operator=
|
(
|
T &
|
value
|
)
|
|
Assign from reference.
◆
operator=()
[3/3]
Opt
& operator=
|
(
|
T *
|
valuePtr
|
)
|
|
Assign from raw pointer.
◆
HasValue()
Returns true if this object contains a value.
◆
operator Bool()
[1/2]
◆
operator Bool()
[2/2]
◆
GetValue()
Result
<T&> GetValue
|
(
|
|
)
|
const
|
Returns the contained value, or IllegalState error if object contained no value.
◆
GetValueOr()
T& GetValueOr
|
(
|
T &
|
defaultValue
|
)
|
const
|
Returns the contained value, or a default value if object contained no value.
◆
operator->()
[1/2]
const T* operator->
|
(
|
|
)
|
const
|
Returns a pointer to the contained value. Results in undefined behavior if object contained no value.
◆
operator->()
[2/2]
◆
operator*()
[1/2]
const T& operator*
|
(
|
|
)
|
const
|
Returns a reference to the contained value. Results in undefined behavior if object contained no value.
◆
operator*()
[2/2]
◆
ToPointer()
[1/2]
◆
ToPointer()
[2/2]
const T* ToPointer
|
(
|
|
)
|
const
|
◆
operator T*()
Converts the optional reference to a raw pointer. This is supported for interoperability with legacy code.
◆
operator const T *()
◆
CheckValue()
Member Data Documentation
◆
_dataPtr