Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions listings/listing_6.11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ class threadsafe_lookup_table
bucket_data data;
mutable std::shared_mutex mutex;

bucket_iterator find_entry_for(Key const& key) const
bucket_iterator find_entry_for(Key const& key)
{
return std::find_if(data.begin(),data.end(),
[&](bucket_value const& item)
{return item.first==key;});
}
public:
Value value_for(Key const& key,Value const& default_value) const
Value value_for(Key const& key,Value const& default_value)
{
std::shared_lock<std::shared_mutex> lock(mutex);
bucket_iterator const found_entry=find_entry_for(key);
Expand Down