I understand the basic concept of using the recursive nature of the parameters of a variational template and a specific instance of a template to sort βeatβ my path through the list of parameters one by one.
I understand that lambdas can be written to take certain types and then return certain types. Keep in mind that I'm still learning C ++ 14 and C ++ 11, so I have not mastered one or the other.
Here is my attempt after looking at other stack overflow questions :
// For std::string
Coliru: http://coliru.stacked-crooked.com/a/5df2919ccf9e99a6
What am I conceptually missing here? Other answers may briefly answer this problem at face value, but I am looking for an explanation of why the answer eludes my thinking. If I understand what I need to do using F::operator() to inherit the operators, and I correctly assert that the return types and parameters are different, what else needs to be done to make this work?
Here is my train of thought:
- Create a common varadic template base class.
- Create a specific template case to overload a specific lambda
operator() . - Create a helper function to take the argument list of the variational pattern and then use it to create the overload class.
- Make sure the types are unambiguous.
source share