diff --git a/dumux/discretization/basegridgeometry.hh b/dumux/discretization/basegridgeometry.hh
index 48fe392a9e92a9ce8949080ab439641c16c60189..40de731121ee629d8ea65d3ef148ed42326ef1a6 100644
--- a/dumux/discretization/basegridgeometry.hh
+++ b/dumux/discretization/basegridgeometry.hh
@@ -194,7 +194,7 @@ private:
     //! Return an instance of the element mapper
     ElementMapper makeElementMapper_(const GridView& gridView) const
     {
-        if constexpr (std::is_same_v<ElementMapper, Dune::MultipleCodimMultipleGeomTypeMapper<GridView>>)
+        if constexpr (std::is_constructible<ElementMapper, GridView, Dune::MCMGLayout>())
             return ElementMapper(gridView, Dune::mcmgElementLayout());
         else
             return ElementMapper(gridView);
@@ -203,7 +203,7 @@ private:
     //! Return an instance of the vertex mapper
     VertexMapper makeVertexMapper_(const GridView& gridView) const
     {
-        if constexpr (std::is_same_v<VertexMapper, Dune::MultipleCodimMultipleGeomTypeMapper<GridView>>)
+        if constexpr (std::is_constructible<VertexMapper, GridView, Dune::MCMGLayout>())
             return VertexMapper(gridView, Dune::mcmgVertexLayout());
         else
             return VertexMapper(gridView);