diff --git a/dune/xt/functions/inverse.hh b/dune/xt/functions/inverse.hh
index b79280d2da2760cd389a576349dcc409f5315d3a..7ff5f40d8037b213ab73535836075a2550cc0e10 100644
--- a/dune/xt/functions/inverse.hh
+++ b/dune/xt/functions/inverse.hh
@@ -40,34 +40,18 @@ public:
   using DomainType = Dune::FieldVector<double, d>;
   using RangeReturnType = typename RangeTypeSelector<R, r, rC>::return_type;
 
-  template <size_t r_ = r, size_t rC_ = rC, bool anything = true>
-  struct dim_switch
-  {
-    static const constexpr bool available = false;
-  };
+public:
+  static const constexpr bool available = (FunctionType::rC == FunctionType::r);
 
-  template <bool anything>
-  struct dim_switch<1, 1, anything>
+  static RangeReturnType compute(const FunctionType& func, const DomainType& xx, const XT::Common::Parameter& param)
   {
-    static const constexpr bool available = true;
-
-    static RangeReturnType compute(const FunctionType& func, const DomainType& xx, const XT::Common::Parameter& param)
-    {
+    if constexpr (FunctionType::rC == 1 && FunctionType::r == 1) {
       auto value_to_invert = func.evaluate(xx, param);
       DUNE_THROW_IF(XT::Common::FloatCmp::eq(value_to_invert, 0.),
                     Exceptions::wrong_input_given,
                     "Scalar function value was not invertible!\n\nvalue_to_invert = " << value_to_invert);
       return 1. / value_to_invert;
-    }
-  };
-
-  template <size_t r_, bool anything>
-  struct dim_switch<r_, r_, anything>
-  {
-    static const constexpr bool available = true;
-
-    static RangeReturnType compute(const FunctionType& func, const DomainType& xx, const XT::Common::Parameter& param)
-    {
+    } else if constexpr (available) {
       auto matrix_to_invert = func.evaluate(xx, param);
       RangeReturnType inverse_matrix;
       try {
@@ -78,15 +62,9 @@ public:
                        << matrix_to_invert << "\n\nThis was the original error: " << ee.what());
       }
       return inverse_matrix;
+    } else {
+      static_assert(false, "compute not available");
     }
-  };
-
-public:
-  static const constexpr bool available = dim_switch<>::available;
-
-  static RangeReturnType compute(const FunctionType& func, const DomainType& xx, const XT::Common::Parameter& param)
-  {
-    return dim_switch<>::compute(func, xx, param);
   }
 }; // class InverseFunctionHelper