less<TYPE>

template <typename T,typename F=less<T>>
int compare(const T &v1,const T &v2,F f=F())
{

}

I can't understand "F f=F()",because the return_type of less<T> is bool,so why a bool can be given to f ,its rerutn_type is typename less<T>.
Last edited on
F() - an anonymous temporary object of type F (which is value initialised)
http://en.cppreference.com/w/cpp/language/value_initialization
Last edited on
Topic archived. No new replies allowed.