Developer documentation

texp_hasfunction.hpp
Go to the documentation of this file.
1 #ifndef realroot_ARITHM_TRAITS_HASFUNCTION_H
2 #define realroot_ARITHM_TRAITS_HASFUNCTION_H
3 
4 
5 namespace mmx {
6 
7 #define simple_trait(name,default)\
8 template< typename X > struct name##_ { typedef default T; };\
9 template< typename X > struct name { typedef typename name##_< typename texp::ucstref<X>::T >::T T; };\
10 
11 namespace texp {
12 
13  simple_trait(hasgcd,false_t);
14  simple_trait(hassqrt,false_t);
15  simple_trait(hasisqrt,false_t);
16 
17  template< typename X >
18  struct hasfunction
19  {
20  typedef typename hasgcd < typename texp::ucstref<X>::T >::T gcd;
21  typedef typename hassqrt < typename texp::ucstref<X>::T >::T sqrt;
22  typedef typename hasisqrt< typename texp::ucstref<X>::T >::T isqrt;
23  };
24 }
25 
26 }// end namespace mmx
27 
28 #endif
29 
Definition: texp_hasfunction.hpp:18
simple_trait(hasgcd, false_t)
hassqrt< typename texp::ucstref< X >::T >::T sqrt
Definition: texp_hasfunction.hpp:21
hasisqrt< typename texp::ucstref< X >::T >::T isqrt
Definition: texp_hasfunction.hpp:22
hasgcd< typename texp::ucstref< X >::T >::T gcd
Definition: texp_hasfunction.hpp:20
Definition: array.hpp:12
Home