greater是class template,内部重载了运算符operator()。另外,函数对象的定义如下function objects are instances of a class with member operator() defined. this member function allows the object to be used with the same syntax as a function call.所以,greater的对象是函数对象。greater<string>(),调用了的默认构造函数,生成一个临时对象。
意思是
greater<string>()
返回一个调用默认构造函数构造的函数对象greater是class template,内部重载了运算符operator()。另外,函数对象的定义如下function objects are instances of a class with member operator() defined. this member function allows the object to be used with the same syntax as a function call.所以,greater的对象是函数对象。greater<string>(),调用了的默认构造函数,生成一个临时对象。