Can lambda expressions be used as class template parameters? (Note this is a very different question than this one, which asks if a lambda expression itself can be
@Xeo gave you the reason, so I'll give you the work around.
Often times you do not wish to name a closure, in this case, you can use std::function, which is a type:
typedef std::unordered_map<
std::string,
std::string,
std::hash,
std::function
> map_type;
Note that it captures exactly the signature of the function, and no more.
Then you may simply write the lambda when building the map.
Note that with unordered_map, if you change the equality comparison, you'd better change the hash to match the behavior. Objects that compare equal shall have the same hash.