realroot_doc 0.1.1
/Users/mourrain/Devel/mmx/realroot/include/realroot/texp_hasfunction.hpp
Go to the documentation of this file.
00001 #ifndef realroot_ARITHM_TRAITS_HASFUNCTION_H
00002 #define realroot_ARITHM_TRAITS_HASFUNCTION_H
00003 
00004 
00005 namespace mmx {
00006 
00007 #define simple_trait(name,default)\
00008 template< typename X > struct name##_ { typedef default T; };\
00009 template< typename X > struct name { typedef typename name##_< typename texp::ucstref<X>::T >::T T; };\
00010 
00011 namespace texp {
00012   
00013   simple_trait(hasgcd,false_t);
00014   simple_trait(hassqrt,false_t);
00015   simple_trait(hasisqrt,false_t);
00016 
00017   template< typename X >
00018     struct hasfunction
00019     {
00020       typedef typename hasgcd  < typename texp::ucstref<X>::T >::T  gcd;
00021       typedef typename hassqrt < typename texp::ucstref<X>::T >::T  sqrt;
00022       typedef typename hasisqrt< typename texp::ucstref<X>::T >::T isqrt;
00023     }; 
00024 }
00025 
00026 }// end namespace mmx
00027 
00028 #endif
00029