I just understand how difficult it is to ask questions ... I hope I can give examples that are both accurate enough to demonstrate my problem and short enough not to damage everything ... At least there is the ability to edit.
So this is my situation at the moment. Of course, I changed this a bit in terms of logic / structure (and in terms of naming), trying to focus on the essence of my question:
At the moment, I prefer the opportunity1, because I do not need to mess with inheritance in Extractor for all MyType variants and the associated Extractor that I want to try in the future.
Extractors, on the other hand, may require complex code and several members (something like huge cards that map specific inputs to specific values). Thus, the use of patterns will not increase. In particular, using only the header file Extractors and, perhaps, even functors that need to be built in, is out of the question. It used to be a strong pointer to me that templating would only increase code complexity (the need to deal with instantiation, make life harder for client code, etc.), and that I should try to avoid this altogether.
Or is there a third possibility that I never thought of?
source share