File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -126,12 +126,15 @@ template<typename... Args>
126
126
typename basic_storage<Args...>::entity_type to_entity (const basic_storage<Args...> &storage, const typename basic_storage<Args...>::value_type &instance) {
127
127
using traits_type = component_traits<typename basic_storage<Args...>::value_type, typename basic_storage<Args...>::entity_type>;
128
128
static_assert (traits_type::page_size != 0u , " Unexpected page size" );
129
- const typename basic_storage<Args...>::base_type &base = storage;
129
+
130
+
131
+
132
+
130
133
const auto *page = storage.raw ();
131
134
132
135
for (std::size_t pos{}, count = storage.size (); pos < count; pos += traits_type::page_size, ++page) {
133
136
if (const auto dist = (std::addressof (instance) - *page); dist >= 0 && dist < static_cast <decltype (dist)>(traits_type::page_size)) {
134
- return *(base .rbegin () + static_cast <decltype (dist)>(pos) + dist);
137
+ return *(static_cast < const typename basic_storage<Args...>::base_type &>(storage) .rbegin () + static_cast <decltype (dist)>(pos) + dist);
135
138
}
136
139
}
137
140
You can’t perform that action at this time.
0 commit comments