70template <
size_t vsize >
74 template <
typename IN ,
typename OUT >
75 void eval (
const IN & in , OUT & out )
const
77 std::cout <<
"call to grokkee_type::eval, in = " << in ;
79 std::cout <<
", out = " << out << std::endl ;
85template <
typename T >
86void twice (
const T & in , T & out )
88 std::cout <<
"call to twice, in = " << in ;
90 std::cout <<
", out = " << out << std::endl ;
96template <
size_t vsize >
99 std::cout <<
"testing grok_type with vsize " <<
vsize << std::endl ;
105 grok_t gk ( grokkee ) ;
109 std::cout << x << std::endl <<
" -> " << gk ( x ) << std::endl ;
111 typedef typename grok_t::in_v argtype ;
115 std::cout << xx << std::endl <<
" -> " << gk ( xx ) << std::endl ;
118int main (
int argc ,
char * argv[] )
129 typedef gk1_t::eval_type ev_t ;
130 ev_t ev = & twice<double> ;
133 std::cout <<
"calling grok_type with vsize 1" << std::endl ;
142 typedef gk8_t::v_eval_type v_ev_t ;
143 typedef gk8_t::in_v v8_t ;
145 v_ev_t vev = & twice<v8_t> ;
151 std::cout <<
"calling grok_type using vector code" << std::endl ;
152 gk8a ( v_t ( 1.23 ) ) ;
153 std::cout <<
"calling grok_type using broadcasting" << std::endl ;
154 gk8b ( v_t ( 1.23 ) ) ;
int main(int argc, char *argv[])
void test()
test 'groks' a grokkee_type object 'grokkee' as a vspline::grok_type and calls the resulting object,...
void twice(const T &in, T &out)
'regular' function template doing the same
grokkee_type is a vspline::unary_functor returning twice it's input
void eval(const IN &in, OUT &out) const
class grok_type is a helper class wrapping a vspline::unary_functor so that it's type becomes opaque ...
class unary_functor provides a functor object which offers a system of types for concrete unary funct...
includes all headers from vspline (most of them indirectly)