Please read this code and my explanation of the question after it:
1 2 3 4 5 6 7 8 9 10
auto lambda = [](unique_ptr<Shape>& ps)
{
ps->draw();
};
template<typename T>
using signature_t = void _cdecl(unique_ptr<T>&);
bool the_same = std::is_same<signature_t<Shape>, decltype(lambda)>::value;
decltype of lambda AND signature_t<Shape> should be the same type -- but decltype(lambda) prefixes the type with the word lambda. Other than that, they are operationally the same. How can I compare them ignoring the fact that one is a lambda while the other isn't? I want to be able to compare their signatures -- ignoring the implementation!
Each lambda expression has a class type which is unique. Also, lambdas might not have only one "signature" because their operator() can be a function template.
For example this lambda doesn't really have one "signature" because its operator() is a template which defines a family of different functions. [](auto x) { return x + 1; }
You can check whether it is possible to call the function object in the way you want: