Multiset stl data structure

how we are using operator overloading in custom comparator in multiset?? how this is working??

@shampblocks
Please see this https://www.geeksforgeeks.org/multiset-key_comp-function-in-c-stl/
We’re overlaoding key_comparator() function in mutliset by sending custom comparator

If your doubt is resolved please close it

But in sort function we were only using function comparator but in this case operator overloading is done how to identify what to di when!??

@shampblocks
Custom comparator is called each time you insert or delete an element in multiset. while adding the new element compare is called by multiset class to determine where to place the element in mutliset.

So whenever I am using conparator if it’s conparator of class then I should do overloading??

@shampblocks
If you need to change the default comparator to your own logic of comparison then you need to use it. If your doubt is resolved please close it.

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.