I have a question regarding partial specialisation of templated member functions.
Background: The goal is to compute descriptive statistics of larg
push_impl
can be made either an inner class template (if you use c++11) or a friend class template of your accumulator class (this seems like a good case for using friend declarations, since push_impl
is essentially an integral part of your accumulator class implementation, separated purely for language reasons). Then you can use your option #3 (passing this
to static methods of push_impl
), but without making accumulator members public.
Option #4 doesn't seem too bad either (since it avoids code duplication), but as you mentioned the performance impacts would need to be measured.