@@ -167,7 +167,7 @@ class Registry {
167167 /* *
168168 * The iterator type is only visible to friends.
169169 */
170- using registry_iterator_type = registry_list_type::iterator;
170+ using registry_iterator_type = typename registry_list_type::iterator;
171171
172172 /* *
173173 * List of entries with this registry
@@ -200,7 +200,7 @@ class Registry {
200200 /* *
201201 * The return type of `size()` is forwarded from its underlying container.
202202 */
203- using size_type = registry_list_type::size_type;
203+ using size_type = typename registry_list_type::size_type;
204204
205205 /* *
206206 * The handle type. A registered class should have a member variable of this
@@ -218,7 +218,7 @@ class Registry {
218218 const registry_handle_type register_item (value_type& item) {
219219 lock_guard_type lg (m_);
220220 registry_list_.emplace_back (item, *this );
221- cv_.notify_all (); // `emplace_back` adds one to the registry size
221+ cv_.notify_all (); // `emplace_back` adds one to the registry size
222222 /*
223223 * `emplace_back` returns a reference to the list member, not its iterator.
224224 * We have to construct an iterator instead.
@@ -261,27 +261,23 @@ class Registry {
261261 * @param f A callable object of type F
262262 */
263263 template <class F >
264- void for_each (F f) const
265- {
264+ void for_each (F f) const {
266265 lock_guard_type lg (m_);
267266 /*
268267 * We iterate over entries, but apply the function to valid items. Thus we
269268 * need to provide `for_each` with an adapter.
270269 */
271- auto g{
272- [&f](const RegistryEntry<T>& entry) -> void {
273- /*
274- * We can only iterate over items that have registered `shared_ptr`.
275- * Otherwise we might iterate over a dangling reference.
276- */
277- auto item_ptr{entry.item_ptr_ .lock ()};
278- if (item_ptr) {
279- f (*item_ptr);
280- }
281- }
282- };
283- std::for_each (
284- registry_list_.begin (), registry_list_.end (), g);
270+ auto g{[&f](const RegistryEntry<T>& entry) -> void {
271+ /*
272+ * We can only iterate over items that have registered `shared_ptr`.
273+ * Otherwise we might iterate over a dangling reference.
274+ */
275+ auto item_ptr{entry.item_ptr_ .lock ()};
276+ if (item_ptr) {
277+ f (*item_ptr);
278+ }
279+ }};
280+ std::for_each (registry_list_.begin (), registry_list_.end (), g);
285281 }
286282
287283 private:
@@ -301,7 +297,7 @@ class Registry {
301297 void deregister (registry_iterator_type& iter) {
302298 lock_guard_type lg (m_);
303299 registry_list_.erase (iter);
304- cv_.notify_all (); // `erase` subtracts one from the registry size
300+ cv_.notify_all (); // `erase` subtracts one from the registry size
305301 }
306302};
307303
@@ -340,7 +336,7 @@ class RegistryHandle {
340336 * immediate erasure of the entry; there's no separate index or other
341337 * secondary structure required.
342338 */
343- using referential_type = Registry<T>::registry_iterator_type;
339+ using referential_type = typename Registry<T>::registry_iterator_type;
344340
345341 /* *
346342 * The iterator that comprises the underlying data of this handle.
@@ -478,6 +474,6 @@ class RegistryHandle {
478474 }
479475};
480476
481- } // namespace tiledb::sm
477+ } // namespace tiledb::common
482478
483479#endif // TILEDB_REGISTRY_H
0 commit comments