August 3rd, 2015, 8:24 pm
QuoteOriginally posted by: lballabioQuoteOriginally posted by: CuchulainnQuote(Also, after a while I realized that for most classes I didn't really need CRTP, templates were enough. Oh well.)For good or bad, software styles are driven by developer preferences (and prejudices.) It is not Theology. Yes, but there are constraints. Assuming you don't want virtual functions, if a method defined in the base class needs to call a method defined in the derived class (so basically, the Template Method pattern) you'll need CRTP. If not, ordinary templates are enough.What I meant with that quotation was that I thought I was in the first case, and only afterwards I realized I was in the second instead.I agree 100%. The TMP and CRTP is super-tight ship.BTW I did a TMP using C++14. BUT the 'final' main algorithm must be virtual, which sees odd.