Can I write code that extracts the type of the first parameter of a lambda like the one above? I would like to distinguish it from say this other lambda:
This would only be possible for non-polymorphic lambdas (such as the ones you are showing), since otherwise there is no specific type to extract. For a non-polymorphic lambda, you can make a pointer to its call operator, and decompose that pointer's type. For example, using the old boost facilities: using p1 = at<parameter_types<decltype(&decltype(selectViaCategory)::operator())>, int_<1>>::type;, or using something less cumbersome, but it's rare that this kind of decomposition is actually needed. What exactly needs to distinguish these lambdas?
Now the type date::day_point is also the first parameter of the lambda selectViaDate. So it is redundant and could lead to inconsistencies if I use a different type (by mistake). If I could figure out the first parameter of the passed lambda I have a more foolproof design and better code... So I want to be able to call:
"decltype(selectViaCategory)::operator()" is effectively "T::m", where m is non-static member function. The standard prohibits this (5.1.4[expr.prim.id]): you can decltype a non-static data member, but not a non-static member function.
For processingObj.filter, why not make that filter decide? It seems you want a function object that can be called with string/date, not specifically a monomorphic lambda whose first parameter is string/date.