diff --git a/dune/gfe/productmanifold.hh b/dune/gfe/productmanifold.hh index 52f2a848e8fbed74a6fd376d4c4820f8ee27ab3b..c22f35d08d172859f18688c05d0cbc95bd603585 100644 --- a/dune/gfe/productmanifold.hh +++ b/dune/gfe/productmanifold.hh @@ -441,8 +441,13 @@ namespace Dune::GFE return numTS; } - template<class... TargetSpaces2> - friend std::ostream& operator<<(std::ostream& s, const ProductManifold<TargetSpaces2 ...>& c); + friend std::ostream& operator<<(std::ostream& s, const ProductManifold<TargetSpaces ...>& c) + { + Dune::Hybrid::forEach(Dune::Hybrid::integralRange(Dune::index_constant<ProductManifold<TargetSpaces ...>::numTS>()), [&](auto&& i) { + s<<Dune::className<decltype(c[i])>()<<" "<< c[i]<<"\n"; + }); + return s; + } private: /** @@ -479,14 +484,5 @@ namespace Dune::GFE std::tuple<TargetSpaces ...> data_; }; - - template<typename ... TargetSpaces> - std::ostream& operator<<(std::ostream& s, const ProductManifold<TargetSpaces ...>& c) - { - Dune::Hybrid::forEach(Dune::Hybrid::integralRange(Dune::index_constant<ProductManifold<TargetSpaces ...>::numTS>()), [&](auto&& i) { - s<<Dune::className<decltype(c[i])>()<<" "<< c[i]<<"\n"; - }); - return s; - } } #endif diff --git a/test/targetspacetest.cc b/test/targetspacetest.cc index 8302b86d9cc924bc883034b51fbb749e25c18edf..765a46c9ba38b9df6d2b45111fb3db9fc4e52fea 100644 --- a/test/targetspacetest.cc +++ b/test/targetspacetest.cc @@ -337,6 +337,22 @@ void testDerivativesOfDistanceSquared(const TargetSpace& a, const TargetSpace& b } +// The class ProductManifold had a bug that lead to a build failure +// when using std::cout in the namespace Dune::GFE. +// +// See https://gitlab.mn.tu-dresden.de/osander/dune-gfe/-/merge_requests/114 +// +// The following method is here to make sure that this bug does not +// come back. +namespace Dune::GFE +{ + void testUsingIOStream() + { + std::cout << "dummy text" << std::endl; + } +} + + template <class TargetSpace> void test() {