Yes, make clear difference in your mind about what is type what is
variable what is function and what is function call.
> I also wonder why the following does not compile
> map<string, string> myMap(_1<_2)
Where it is written that you can define such variable?:
std::less<std::string> c = _1 < _2;
You can't. C++ is not voo-doo shamanism of dark wizards. It is clear,
strongly-typed programming language.
> I suspect that most probably the 3-rd template parameter is difficult to
> deduce and a compiler just gives up. Am I right ?
How? Now you mix up function templates and class templates. C++ does not
deduce type of class by constructor arguments. You will be wrong for
several years to come if you try to deduce what a line of code does by
looking at it and philosophizing what it "most probably" does.
Instead look into specification of 'std::map':
template < class Key, // map::key_type
class T, // map::mapped_type
class Compare = less<Key>, // map::key_compare
class Alloc // map::allocator_type
= allocator<pair<const Key,T> >
> class map;
What is the trick that it allows you to declare?:
map<string, string> x;
What is fully written out type of 'x' on above line?