File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -220,13 +220,8 @@ class DenseMapBase : public DebugEpochBase {
220
220
// Return the entry with the specified key, or \p Default. This variant is
221
221
// useful, because `lookup` cannot be used with non-default-constructible
222
222
// values.
223
- ValueT lookup_or (const_arg_type_t <KeyT> Val, ValueT &&Default) const {
224
- if (const BucketT *Bucket = doFind (Val))
225
- return Bucket->getSecond ();
226
- return Default;
227
- }
228
-
229
- ValueT lookup_or (const_arg_type_t <KeyT> Val, const ValueT &Default) const {
223
+ template <typename U = std::remove_cv_t <ValueT>>
224
+ ValueT lookup_or (const_arg_type_t <KeyT> Val, U &&Default) const {
230
225
if (const BucketT *Bucket = doFind (Val))
231
226
return Bucket->getSecond ();
232
227
return Default;
You can’t perform that action at this time.
0 commit comments