helpertemplates.hh

Go to the documentation of this file.
00001 // $Id: helpertemplates.hh 5780 2009-12-13 23:31:00Z christi $
00002 
00003 #ifndef DUNE_COMMON_HELPERTEMPLATES
00004 #define DUNE_COMMON_HELPERTEMPLATES
00005 
00006 // deprecated in dune 2.0
00007 #warning Header file dune/common/helpertemplates.hh is deprecated
00008 
00014 namespace Dune {
00015 
00025 template<class T, class B> struct Derived_from {
00026     static void constraints(T* p) { B* pb = p; }
00027     Derived_from() { void(*p)(T*) = constraints; }
00028 };
00029 
00031 template<class T1, class T2> struct Can_copy {
00032     static void constraints(T1 a, T2 b) { T2 c = a; b = a; }
00033     Can_copy() { void(*p)(T1,T2) = constraints; }
00034 };
00035 
00037 template<class T1, class T2 = T1> struct Can_compare {
00038     static void constraints(T1 a, T2 b) { a==b; a!=b; a<b; }
00039     Can_compare() { void(*p)(T1,T2) = constraints; }
00040 };
00041 
00043 template<class T1, class T2, class T3 = T1> struct Can_multiply {
00044     static void constraints(T1 a, T2 b, T3 c) { c = a*b; }
00045     Can_multiply() { void(*p)(T1,T2,T3) = constraints; }
00046 };
00047 
00048 } // namespace Dune
00049 
00050 #endif
Generated on Mon Apr 26 10:45:21 2010 for dune-common by  doxygen 1.6.3