I'm trying to implement a class which wraps an arbitrary type and a mutex. To access the wrapped data, one needs to pass a functor as parameter of the locked method. The wrapper class will then pass the wrapped data as parameter to the functor.
I need to know the exact number of arguments that a lambda has. I do not care for their types, I just need a count.
Here's what I want to do; posting the whole code because it's not too long and also to demonstrate the specific task I'm trying to solve. Basically, I need a way to iterate values from parameter pack by index (the index part is important, even though it's not required in...
Suppose you have a function that takes a std::vector of any type and processes it in some way:Since C++14, we are able to achieve the same thing with lambdas. In this case, we call them generic lambdas, since we introduce a template-like deduction to them: