Skip to content

Commit

Permalink
initialize in constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
gonuke committed Feb 28, 2019
1 parent 7b986cd commit 503119a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,16 @@ namespace pyne {
~FileNotFound () throw () {};

/// constructor with the filename \a fname.
FileNotFound(std::string fname)
FileNotFound(std::string fname) : FNF_message("File not found")
{
filename = fname;
};

/// Creates a helpful error message.
virtual const char* what() const throw()
{
FNF_message = "File not found: ";
if (!filename.empty())
FNF_message += filename;
FNF_message += ": " + filename;

return (const char *) FNF_message.c_str();
};
Expand Down

0 comments on commit 503119a

Please sign in to comment.