map takes lambda as a template parameter and so does filter and many other functions. Sometimes they take something other than lambda as a template parameter. Eg. In case of to!int("5") int is a type and hence might need it as a template parameter but why does map and others take it as template parameter.

Adam D Ruppe pointed out in IRC it helps in inlining and optimization. Is there a thumb rule to decide this so that my functions too can benefit the performance and hence I could structure and understand my code better.

Reply via email to