[Dune-devel] [Dune-Commit] [Commit] dune-istl - 23d94ff: [tests] Catch Dune exceptions to ease identifying problems.

Christian Engwer christian.engwer at uni-muenster.de
Fri Oct 23 08:50:10 CEST 2015


> I like the idea of making Dune::Exception a std::exception. But we have
> our Dune::Exception::what() returning a std::string& and not a char*.
> Can we easily change this without braking all code using our exceptions?

that should not the the big deal, as users never use the what
explicitly, but just to output it.

> And would we get rid of DUNE_THROW? That would be an argument for me to
> break code.

No we don't get of DUNE_THROW. Actually you don't _have_ to use it,
but composing the error message is horrible otherwise. We can't (or at
least didn't succeed) dervive from std::stringstream, but in order to
allow to use something like

throw myexception() << "Hallo " << 123;

we'd have to derive the exception class fomr some type of ostream,
which doesn't work, as ostream has a deleted copy constructor. To
circuvent these problems we came up with the idea of first writing to
a stringstream and the copying the string to the exception class.

Christian

> Shall I open a flyspray task to discuss this more widely? Or is this no
> consideration?
> 
> Bye
> Christoph
> 
> -- 
> A mathematician is a scientist who can figure out anything, except
> such simple things as squaring the circle and trisecting an angle.
> [Evan Esar (1899-1995), Esar's Comic Dictionary]
> 



> _______________________________________________
> Dune-devel mailing list
> Dune-devel at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-devel


-- 
Prof. Dr. Christian Engwer 
Institut für Numerische und Angewandte Mathematik
Fachbereich Mathematik und Informatik der Universität Münster
Einsteinstrasse 62
48149 Münster

E-Mail  christian.engwer at uni-muenster.de
Telefon +49 251 83-35067
FAX     +49 251 83-32729




More information about the Dune-devel mailing list