|
@@ -2,6 +2,7 @@
|
|
|
#define ENTT_CORE_ITERATOR_HPP
|
|
#define ENTT_CORE_ITERATOR_HPP
|
|
|
|
|
|
|
|
#include <memory>
|
|
#include <memory>
|
|
|
|
|
+#include <utility>
|
|
|
#include "../config/config.h"
|
|
#include "../config/config.h"
|
|
|
|
|
|
|
|
namespace entt {
|
|
namespace entt {
|
|
@@ -11,19 +12,40 @@ namespace entt {
|
|
|
* @tparam Type of wrapped value.
|
|
* @tparam Type of wrapped value.
|
|
|
*/
|
|
*/
|
|
|
template<typename Type>
|
|
template<typename Type>
|
|
|
-struct input_iterator_proxy {
|
|
|
|
|
|
|
+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 from a given value.
|
|
|
|
|
|
|
+ * @brief Constructs a proxy object by move.
|
|
|
* @param val Value to use to initialize the proxy object.
|
|
* @param val Value to use to initialize the proxy object.
|
|
|
*/
|
|
*/
|
|
|
- input_iterator_proxy(Type &&val)
|
|
|
|
|
- : value{std::forward<Type>(val)} {}
|
|
|
|
|
|
|
+ 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.
|
|
* @brief Access operator for accessing wrapped values.
|
|
|
* @return A pointer to the wrapped value.
|
|
* @return A pointer to the wrapped value.
|
|
|
*/
|
|
*/
|
|
|
- [[nodiscard]] Type *operator->() ENTT_NOEXCEPT {
|
|
|
|
|
|
|
+ [[nodiscard]] pointer operator->() ENTT_NOEXCEPT {
|
|
|
return std::addressof(value);
|
|
return std::addressof(value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -31,13 +53,6 @@ private:
|
|
|
Type value;
|
|
Type value;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/**
|
|
|
|
|
- * @brief Deduction guide.
|
|
|
|
|
- * @tparam Type Type of wrapped value.
|
|
|
|
|
- */
|
|
|
|
|
-template<typename Type>
|
|
|
|
|
-input_iterator_proxy(Type &&) -> input_iterator_proxy<Type>;
|
|
|
|
|
-
|
|
|
|
|
} // namespace entt
|
|
} // namespace entt
|
|
|
|
|
|
|
|
#endif
|
|
#endif
|