ソースを参照

table: make table iterators friends to allow non-const to const conversions

Michele Caini 1 年間 前
コミット
965a7ba4f0
1 ファイル変更5 行追加1 行削除
  1. 5 1
      src/entt/entity/table.hpp

+ 5 - 1
src/entt/entity/table.hpp

@@ -26,7 +26,11 @@ struct basic_common_table {
 };
 };
 
 
 template<typename... It>
 template<typename... It>
-struct table_iterator {
+class table_iterator {
+    template<typename...>
+    friend class table_iterator;
+
+public:
     using value_type = decltype(std::forward_as_tuple(*std::declval<It>()...));
     using value_type = decltype(std::forward_as_tuple(*std::declval<It>()...));
     using pointer = input_iterator_pointer<value_type>;
     using pointer = input_iterator_pointer<value_type>;
     using reference = value_type;
     using reference = value_type;