Static Public Member Functions | |
static T | Sum (WeightTracker< T > const &, DataTracker< Power, T > const &sums) |
The "extractor" is just a C++ trick to replace a statement like:
(N == 0)? weight.Weights(): sums.template SumN<N>()
where N is a constexpr number. The problem is that SumN<0> is not valid (in our case, it raises a static assertion). The analysis of the full statement shows that it would not be a problem, since the compiler could remove the ternary operator since it always knows whether N is 0 or not. Matter of fact, the compiler can also choose to be dumb and compile the whole thing, including a SumN<0>.
The trick is in the form of a class that gets specialized for N = 0. A long list of limitations in C++ (up to 2014 at least) forces the implementation in a struct.
Definition at line 57 of file SimpleFits.h.
|
inlinestatic |
Definition at line 59 of file SimpleFits.h.