Search Results for

    Show / Hide Table of Contents

    Struct Nullable<bool>

    Specialization of Nullable() for bool type.

    Assembly: FlaxEngine.dll
    File: Engine/Core/Types/Nullable.h
    Syntax
    public struct Nullable<bool>

    Constructors

    ~Nullable()

    Declaration
    public ~Nullable() = default

    Nullable()

    Initializes nullable boolean by setting the wrapped value to null.

    Declaration
    public Nullable() = default

    Nullable(const bool value)

    Initializes nullable boolean by implicitly casting a boolean value.

    Declaration
    public Nullable(const bool value) noexcept
    Parameters
    bool value

    Nullable(const Nullable& value)

    Initializes nullable boolean by copying another nullable boolean.

    Declaration
    public Nullable(const Nullable& value) = default
    Parameters
    Nullable value

    Nullable(Nullable&& value)

    Initializes nullable boolean by moving another nullable boolean.

    Declaration
    public Nullable(Nullable&& value) = default
    Parameters
    Nullable value

    operator bool()

    Deletes implicit conversion to bool to prevent ambiguous code.

    Implicit cast from nullable bool to a bool produces unacceptably ambiguous code. For template meta-programming use explicit instead.

    Declaration
    public operator bool() const =delete

    Methods

    GetAndReset(bool& value)

    Moves the wrapped value to the output parameter and sets the wrapped value to null. If the wrapped value is not valid, the behavior is undefined.

    Declaration
    public void GetAndReset(bool& value) noexcept
    Parameters
    bool value

    Returns
    void

    GetValue()

    Gets the wrapped boolean value. If the value is not valid, the behavior is undefined.

    Declaration
    public bool GetValue() const
    Returns
    bool

    GetValueOr(const bool defaultValue)

    Gets the wrapped boolean value. If the value is not valid, returns the default value.

    Declaration
    public bool GetValueOr(const bool defaultValue) const noexcept
    Parameters
    bool defaultValue

    Returns
    bool

    HasValue()

    Checks if wrapped bool has a valid value.

    Declaration
    public bool HasValue() const noexcept
    Returns
    bool

    IsFalse()

    Checks if the current object has a valid value and it's set to false. If the value is true or not valid, the method returns false.

    Declaration
    public bool IsFalse() const
    Returns
    bool

    IsTrue()

    Checks if the current object has a valid value and it's set to true. If the value is false or not valid, the method returns false.

    Declaration
    public bool IsTrue() const
    Returns
    bool

    operator=(const bool value)

    Reassigns the wrapped value by implicitly casting a boolean value.

    Declaration
    public Nullable operator=(const bool value) noexcept
    Parameters
    bool value

    Returns
    Nullable

    operator=(const Nullable& value)

    Reassigns the wrapped value by copying another nullable boolean.

    Declaration
    public Nullable operator=(const Nullable& value) = default
    Parameters
    Nullable value

    Returns
    Nullable

    operator=(Nullable&& value)

    Reassigns the wrapped value by moving another nullable boolean.

    Declaration
    public Nullable operator=(Nullable&& value) = default
    Parameters
    Nullable value

    Returns
    Nullable

    Reset()

    Sets the wrapped bool to null.

    Declaration
    public void Reset() noexcept
    Returns
    void

    SetValue(const bool value)

    Sets the wrapped value to a valid boolean.

    Declaration
    public void SetValue(const bool value) noexcept
    Parameters
    bool value

    Returns
    void

    TrySet(const bool value)

    If the wrapped value is not valid, sets it to a valid boolean.

    Declaration
    public bool TrySet(const bool value) noexcept
    Parameters
    bool value

    Returns
    bool

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat