File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -2143,14 +2143,14 @@ class raw_hash_set {
21432143 return *slot_;
21442144 }
21452145
2146- // returns a pointer to the inserted value .
2147- // beware that the returned pointer is stable only for `node` hash map or sets. When using
2148- // a `flat` version, this pointer can be used immediately, but shouldn't be stored .
2146+ // returns a reference to the inserted `value_type` .
2147+ // beware that the returned reference is stable only for `node` hash map or sets. When using
2148+ // a `flat` version, this reference can be used immediately, but we shouldn't store a pointer to it .
21492149 template <class ... Args>
2150- slot_type* operator ()(Args&&... args) const {
2150+ const auto & operator ()(Args&&... args) const {
21512151 assert (*slot_);
21522152 PolicyTraits::construct (alloc_, *slot_, std::forward<Args>(args)...);
2153- return *slot_ ;
2153+ return PolicyTraits::element ( slot ()) ;
21542154 }
21552155
21562156 private:
You can’t perform that action at this time.
0 commit comments