Skip to content

Commit 4ebc132

Browse files
authored
glz::async_map cbegin/cend (#1467)
1 parent 611c300 commit 4ebc132

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

include/glaze/thread/async_map.hpp

+12
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,18 @@ namespace glz
545545
auto shared_lock_ptr = std::make_shared<std::shared_lock<std::shared_mutex>>(mutex);
546546
return const_iterator(items.cend(), this, shared_lock_ptr);
547547
}
548+
549+
const_iterator cbegin() const
550+
{
551+
auto shared_lock_ptr = std::make_shared<std::shared_lock<std::shared_mutex>>(mutex);
552+
return const_iterator(items.cbegin(), this, shared_lock_ptr);
553+
}
554+
555+
const_iterator cend() const
556+
{
557+
auto shared_lock_ptr = std::make_shared<std::shared_lock<std::shared_mutex>>(mutex);
558+
return const_iterator(items.cend(), this, shared_lock_ptr);
559+
}
548560

549561
// Count the number of elements with the given key (0 or 1)
550562
size_t count(const K& key) const

0 commit comments

Comments
 (0)