I have my struct:
struct S{ int a; }; And i have class:
class Other{ //some fields }; I need write functor:
struct Comparator { bool operator()(S& l, S& r) { //some code, considered l,r and any object of class Other } }; In operator () should be considered any object of class Other. How to transfer object into functor? I use functor for priority_queue. Object of class Other can't be statical field.
Another ways for this purpose?