Sfoglia il codice sorgente

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

Michele Caini 1 anno fa
parent
commit
965a7ba4f0
1 ha cambiato i file con 5 aggiunte e 1 eliminazioni
  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;