|
| constexpr | Optional () noexcept |
| | デフォルトコンストラクタ
|
| |
| constexpr | Optional (NulloptT) |
| | 無効値として構築
|
| |
| template<typename U, typename std::enable_if< std::is_constructible< ValueType, U >::value, std::nullptr_t >::type = nullptr> |
| | Optional (U &&value) noexcept(std::is_nothrow_constructible< ValueType >::value) |
| | 値から構築
|
| |
| template<typename U, typename std::enable_if< std::is_constructible< ValueType, const U & >::value, std::nullptr_t >::type = nullptr> |
| | Optional (const Optional< U > &other) noexcept(std::is_nothrow_constructible< ValueType, U >::value) |
| | コピーコンストラクタ
|
| |
| template<typename U, typename std::enable_if< std::is_constructible< ValueType, U && >::value, std::nullptr_t >::type = nullptr> |
| | Optional (Optional< U > &&other) noexcept(std::is_nothrow_constructible< ValueType, U >::value) |
| | ムーブコンストラクタ
|
| |
| | ~Optional () noexcept |
| | デストラクタ
|
| |
| Optional & | operator= (NulloptT) noexcept |
| | 無効値代入演算子
|
| |
| template<typename U, typename std::enable_if< std::is_constructible< ValueType, U >::value and std::is_assignable< ValueType, U >::value, std::nullptr_t >::type = nullptr> |
| Optional & | operator= (U &&value) noexcept(std::is_nothrow_constructible< ValueType, U >::value and std::is_nothrow_assignable< ValueType, U >::value) |
| | 値代入演算子
|
| |
| template<typename U, typename std::enable_if< std::is_constructible< ValueType, const U & >::value and std::is_assignable< ValueType, const U & >::value, std::nullptr_t >::type = nullptr> |
| Optional & | operator= (const Optional< U > &other) noexcept(std::is_nothrow_constructible< ValueType, U >::value and std::is_nothrow_assignable< ValueType, U >::value) |
| | コピー代入演算子
|
| |
| template<typename U, typename std::enable_if< std::is_constructible< ValueType, U && >::value and std::is_assignable< ValueType, U && >::value, std::nullptr_t >::type = nullptr> |
| Optional & | operator= (Optional< U > &&other) noexcept(std::is_nothrow_constructible< ValueType, U >::value and std::is_nothrow_assignable< ValueType, U >::value) |
| | ムーブ代入演算子
|
| |
| constexpr | operator bool () const noexcept |
| | 値が有効か
|
| |
| constexpr bool | hasValue () const noexcept |
| | 値が有効か
|
| |
| ValueType & | value () & |
| | 値を取得
|
| |
| const ValueType & | value () const & |
| | 値を取得
|
| |
| ValueType && | value () && |
| | 値を取得
|
| |
| const ValueType && | value () const && |
| | 値を取得
|
| |
| ValueType & | operator* () & |
| | 値を取得
|
| |
| const ValueType & | operator* () const & |
| | 値を取得
|
| |
| ValueType && | operator* () && |
| | 値を取得
|
| |
| const ValueType && | operator* () const && |
| | 値を取得
|
| |
| ValueType * | operator-> () |
| |
| const ValueType * | operator-> () const |
| |
| template<typename U> |
| constexpr ValueType | valueOr (U &&defaultValue) const & |
| | 有効であれば自身を、無効であればデフォルト値を取得する
|
| |
| template<typename U> |
| constexpr ValueType | valueOr (U &&defaultValue) && |
| | 有効であれば自身を、無効であればデフォルト値を取得する
|
| |
| template<typename Visitor> |
| constexpr auto | transform (Visitor &&visitor) &-> Optional< Traits::RemoveCVRefT< typename std::result_of< Visitor(ValueType &)>::type > > |
| | 値を変換
|
| |
| template<typename Visitor> |
| constexpr auto | transform (Visitor &&visitor) const &-> Optional< Traits::RemoveCVRefT< typename std::result_of< Visitor(const ValueType &)>::type > > |
| | 値を変換
|
| |
| template<typename Visitor> |
| constexpr auto | transform (Visitor &&visitor) &&-> Optional< Traits::RemoveCVRefT< typename std::result_of< Visitor(ValueType)>::type > > |
| | 値を変換
|
| |
| void | swap (Optional &other) noexcept(/*std::is_nothrow_swappable< ValueType >::value and */std::is_nothrow_move_assignable< ValueType >::value) |
| | 他のOptionalと値を交換する
|
| |
| template<typename U = ValueType, typename std::enable_if< std::is_trivially_destructible< U >::value, std::nullptr_t >::type = nullptr> |
| void | reset () noexcept(std::is_nothrow_destructible< ValueType >::value) |
| | 無効状態にする (トリビアルな型)
|
| |
| template<typename U = ValueType, typename std::enable_if< not std::is_trivially_destructible< U >::value, std::nullptr_t >::type = nullptr> |
| void | reset () noexcept(std::is_nothrow_destructible< ValueType >::value) |
| | 無効状態にする (非トリビアルな型)
|
| |
| void | show () const noexcept |
| | 値を表示
|
| |
template<typename T>
class Udon::Optional< T >
オプショナル型
- 覚え書き
- C++17のstd::optionalの模倣
- テンプレート引数
-