From b7996ff5fec7c3b4020c3b93e982364c4a428873 Mon Sep 17 00:00:00 2001 From: Robert Kloefkorn Date: Thu, 6 Aug 2015 13:11:51 +0200 Subject: [PATCH] added operator << and >> for __float128. --- ewoms/aux/compatibility.hh | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/ewoms/aux/compatibility.hh b/ewoms/aux/compatibility.hh index 63821aac9..a9d0f7c9b 100644 --- a/ewoms/aux/compatibility.hh +++ b/ewoms/aux/compatibility.hh @@ -4,6 +4,7 @@ #if HAVE_DUNE_FEM #include #include +#include namespace Dune { @@ -22,6 +23,11 @@ namespace Dune namespace Fem { + //////////////////////////////////////////////////////////// + // + // make_entity for CpGrid entities + // + //////////////////////////////////////////////////////////// template inline Dune::cpgrid::Entity< codim > make_entity ( const Dune::cpgrid::EntityPointer< codim >& entityPointer ) { @@ -34,6 +40,11 @@ namespace Dune return std::move( entity ); } + //////////////////////////////////////////////////////////// + // + // GridEntityAccess for CpGrid entities + // + //////////////////////////////////////////////////////////// template< int codim > struct GridEntityAccess< Dune::cpgrid::Entity< codim > > { @@ -47,6 +58,34 @@ namespace Dune } }; + //////////////////////////////////////////////////////////// + // + // operator << and operator >> for __float128 + // + //////////////////////////////////////////////////////////// +#if HAVE_QUAD + template< class Traits > + inline OutStreamInterface< Traits > & + operator<< ( OutStreamInterface< Traits > &out, + const __float128 value ) + { + double val = double( value ); + out.writeDouble( val ); + return out; + } + + template< class Traits > + inline InStreamInterface< Traits > & + operator>> ( InStreamInterface< Traits > &in, + __float128& value ) + { + double val; + in.readDouble( val ); + value = val; + return in; + } +#endif + } // namespace Fem } // end namespace Dune