Просмотр исходного кода

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

Michele Caini 1 год назад
Родитель
Сommit
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>
-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 pointer = input_iterator_pointer<value_type>;
     using reference = value_type;