Swarm-NG
1.1
|
Template object function to choose the appropriate instantiation of a function at compile time. More...
#include <helpers.hpp>
Template object function to choose the appropriate instantiation of a function at compile time.
Suppose that you define T as:
and you want to instantiate T for a finite set of values of N like 1,2,3,4. and you want to call the appropriate T at runtime based on n that is provided at runtime. You will write: B b = choose< T, 1, 4, B, P>( n, p ); This will try to instantiate T for values 1 to 4 and calls T::choose with p for appropriate value of n at runtime. Note that if n is not in range then it returns B().
Definition at line 98 of file helpers.hpp.