I want to replace an element in a set.After searching in Google, I came across this function replace
, but when I used it, it gave me an error
no member named 'replace' in
What are other ways of updating or replacing an element in set?
I want to replace an element in a set.After searching in Google, I came across this function replace
, but when I used it, it gave me an error
no member named 'replace' in
What are other ways of updating or replacing an element in set?
You have got to erase()
one element and insert()
the new one. replace
is not defined for std::set
. See http://www.cplusplus.com/reference/set/set/