1 #ifndef DUNE_APPLYIF_HH 2 #define DUNE_APPLYIF_HH 3 4 #include <type_traits> 5 6 namespace Dune 7 { 8 // DoNothing 9 struct DoNothing 10 { 11 template< typename ...Args > applyDune::DoNothing12 static void apply ( Args&... args ) 13 {} 14 }; 15 16 // ApplyIf 17 template< template< int > class Op, template< int > class Cond > 18 struct ApplyIf 19 { 20 template< int i > 21 struct Operation 22 : public std::conditional< Cond< i >::value, Op< i >, DoNothing >::type 23 {}; 24 }; 25 26 } // namespace Dune 27 28 #endif // #ifndef DUNE_APPLYIF_HH 29