I don't understand the meaning of F f=F()
[...]
This is how you provide default argument to function parameter in C++. Just like we do, any normal functions; let's say
void func1(int i = 2) {/*do something with i*/}
// ^^^^^^^^^
void func2(int i = int()) {/*do something with i*/}
// ^^^^^^^^^^^^^
void func3(int i = {}) {/*do something with i*/}
// ^^^^^^^^^^
Which allows the above functions to be called, with the argument
func1(1); //---> i will be initialized to 1
func1(2); //---> i will be initialized to 2
func1(3); //---> i will be initialized to 3
or without the argument provided.
func1(); //---> i will be initialized to 2
func2(); //---> i will be initializedto 0
func3(); //---> i will be initialized to 0
Similar manner compare
can be called without the third parameter like
compare(arg1, arg2) // ---> f will be `std::less<T>` here, which is the default argument
or with the third parameter
compare(arg1, arg2, [](const auto& lhs, const auto& rhs){ return /*comparison*/;});
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ some comparison function here