invalid use of non-static member function [duplicate]
The simplest fix is to make the comparator function be static: static int comparator (const Bar & first, const Bar & second); ^^^^^^ When invoking it in Count, its name will be Foo::comparator. The way you have it now, it does not make sense to be a non-static member function because it does not use … Read more