Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nils-Arne Dreier
dune-common
Commits
2c78bf88
Commit
2c78bf88
authored
9 years ago
by
Christoph Grüninger
Browse files
Options
Downloads
Patches
Plain Diff
Derive Dune::Exception from std::exception.
parent
5539cdd4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/common/exceptions.hh
+7
-4
7 additions, 4 deletions
dune/common/exceptions.hh
with
7 additions
and
4 deletions
dune/common/exceptions.hh
+
7
−
4
View file @
2c78bf88
...
...
@@ -4,6 +4,7 @@
#ifndef DUNE_EXCEPTIONS_HH
#define DUNE_EXCEPTIONS_HH
#include
<exception>
#include
<string>
#include
<sstream>
...
...
@@ -88,11 +89,13 @@ namespace Dune {
\see DUNE_THROW, IOError, MathError
*/
class
Exception
{
class
Exception
:
public
std
::
exception
{
public:
Exception
();
void
message
(
const
std
::
string
&
msg
);
//!< store string in internal message buffer
const
std
::
string
&
what
()
const
;
//!< output internal message buffer
const
char
*
what
()
const
noexcept
;
//!< output internal message buffer
static
void
registerHook
(
ExceptionHook
*
hook
);
//!< add a functor which is called before a Dune::Exception is emitted (see Dune::ExceptionHook) \see Dune::ExceptionHook
static
void
clearHook
();
//!< remove all hooks
private:
...
...
@@ -196,9 +199,9 @@ namespace Dune {
_message
=
msg
;
}
inline
const
std
::
string
&
Exception
::
what
()
const
inline
const
char
*
Exception
::
what
()
const
noexcept
{
return
_message
;
return
_message
.
data
()
;
}
inline
std
::
ostream
&
operator
<<
(
std
::
ostream
&
stream
,
const
Exception
&
e
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment