Stl set iterator returned by insert

I could not understand how ret=s.insert(10) worked.
Does s.insert(10) returns something. Please explain

hello @subhamjaiswal885

insert function of set returns a pair .

here is the detail about that pair->

a pair with its member pair::first set to an iterator pointing to either the newly inserted element or to the equivalent element already in the set. The pair::second element in the pair is set to true if a new element was inserted or false if an equivalent element already existed.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.