[Dune] [Dune-Commit] dune-grid r6653 - trunk/dune/grid/io/file/dgfparser

Jö Fahlke jorrit at jorrit.de
Mon Apr 26 17:55:08 CEST 2010


Am Mon, 26. Apr 2010, 13:51:54 +0200 schrieb dedner at dune-project.org:
> Log:
> this is what we wanted - make false depend on template argument so that the compiler does not just abort

There is a class AlwaysFalse expressly for this purpose
(http://www.dune-project.org/doc/doxygen/html/structDune_1_1AlwaysFalse.html).
It would not impreove the code much in this particular case, but I wanted to
mention it generally.

Jö.

> Modified: trunk/dune/grid/io/file/dgfparser/dgfparser.hh
> ===================================================================
> --- trunk/dune/grid/io/file/dgfparser/dgfparser.hh	2010-04-26 11:37:52 UTC (rev 6652)
> +++ trunk/dune/grid/io/file/dgfparser/dgfparser.hh	2010-04-26 11:51:54 UTC (rev 6653)
> @@ -169,9 +169,14 @@
>       *  \endcode
>       */
>      template< class GridType >
> -    class Impl
> +    struct Impl
>      {
> -      dune_static_assert( false,"dgf grid factory missing - did you forget to add the corresponding dgf header or dgfgridtype.hh ?");
> +      static GridType* generate(MacroGrid& mg,
> +                                const char* filename, MPICommunicatorType MPICOMM = MPIHelper::getCommunicator() )
> +      {
> +        // make assertion depend on the template argument but always evaluate to false
> +        dune_static_assert( GridType::dimension<0,"dgf grid factory missing - did you forget to add the corresponding dgf header or dgfgridtype.hh ?");
> +      }
>      };
>      
>      const char* filename_;
> 
> 
> _______________________________________________
> Dune-Commit mailing list
> Dune-Commit at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-commit
> 

-- 
Das Erststudium soll bis zum berufsqualifizierenden Abschluss
gebührenfrei bleiben, also bis zur Erlangung der Taxi-Lizenz.
-- Akrützel, Ausgabe vom 16.5.2002 (www.akruetzel.de)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20100426/45dd3d7e/attachment.pgp>


More information about the Dune mailing list