Struct input_iterator_pointer

Synopsis

#include <src/entt/core/iterator.hpp>

template<typename Type>
struct input_iterator_pointer final

Description

Helper type to use as pointer with input iterators.

Template Parameters

Type - of wrapped value.

Methods

input_iterator_pointer overloadDefault copy constructor, deleted on purpose.
input_iterator_pointer overloadDefault move constructor.
input_iterator_pointer overloadConstructs a proxy object by move.
operator->Access operator for accessing wrapped values.
operator= overloadDefault copy assignment operator, deleted on purpose.
operator= overloadDefault move assignment operator.

Source

Lines 15-55 in src/entt/core/iterator.hpp.

template<typename Type>
struct input_iterator_pointer final {
    /*! @brief Pointer type. */
    using pointer = decltype(std::addressof(std::declval<Type &>()));

    /*! @brief Default copy constructor, deleted on purpose. */
    input_iterator_pointer(const input_iterator_pointer &) = delete;

    /*! @brief Default move constructor. */
    input_iterator_pointer(input_iterator_pointer &&) = default;

    /**
     * @brief Constructs a proxy object by move.
     * @param val Value to use to initialize the proxy object.
     */
    input_iterator_pointer(Type &&val)
        : value{std::move(val)} {}

    /**
     * @brief Default copy assignment operator, deleted on purpose.
     * @return This proxy object.
     */
    input_iterator_pointer &operator=(const input_iterator_pointer &) = delete;

    /**
     * @brief Default move assignment operator.
     * @return This proxy object.
     */
    input_iterator_pointer &operator=(input_iterator_pointer &&) = default;

    /**
     * @brief Access operator for accessing wrapped values.
     * @return A pointer to the wrapped value.
     */
    [[nodiscard]] pointer operator->() ENTT_NOEXCEPT {
        return std::addressof(value);
    }

private:
    Type value;
};





Add Discussion

Log in to comment