Not able to get const use

why did sir use " const" keyword during function and in argument and why not simply writing as normal??
why was it creating error when he did not use const?

@varu those are comparator functions and only compares two objects, it cannot modify the data, so using const keyword makes sure that no data is modified accidentally.

but we are also only comparing data and not even modifying in code then why to write additionly const

hi @mayankA47 but still const keyword needs to be added so there’s no chance of even accidentally modifying the data