diff --git a/include/spdlog/attributes.h b/include/spdlog/attributes.h index f3ce23a8..5b7fb141 100644 --- a/include/spdlog/attributes.h +++ b/include/spdlog/attributes.h @@ -52,11 +52,12 @@ public: return attrs.empty(); } + // return {true, iter} if found, {false, end} otherwise std::pair const get(key_t const& key) const { auto lck = lock(); auto value_it = attrs.find(key); - return std::make_pair(value_it == attrs.end(), value_it); + return std::make_pair(value_it != attrs.end(), value_it); } // provide a local copy of the attributes to be free of race issues