Corrade::Utility::Fatal class

Warning output handler.

Equivalent to Error, but exits with defined exit code on destruction. So instead of this:

if(stuff.broken()) {
    Utility::Error{} << "Everything's broken, exiting.";
    std::exit(42);
}

You can write just this:

if(stuff.broken())
    Utility::Fatal{42} << "Everything's broken, exiting.";

Base classes

class Error
Error output handler.

Constructors, destructors, conversion operators

Fatal(int exitCode = 1, Flags flags = {})
Constructor.
Fatal(Flags flags)
Fatal(std::ostream* output, int exitCode = 1, Flags flags = {})
Constructor.
Fatal(std::ostream* output, Flags flags = {})
~Fatal()
Destructor.

Function documentation

Corrade::Utility::Fatal::Fatal(int exitCode = 1, Flags flags = {})

Constructor.

Parameters
exitCode Application exit code to be used on destruction
flags Output flags

Sets output to std::cerr. The exitCode is passed to std::exit() on destruction.

Corrade::Utility::Fatal::Fatal(Flags flags)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Corrade::Utility::Fatal::Fatal(std::ostream* output, int exitCode = 1, Flags flags = {})

Constructor.

Parameters
output Stream where to put debug output. If set to nullptr, no debug output will be written anywhere.
exitCode Application exit code to be used on destruction
flags Output flags

Corrade::Utility::Fatal::Fatal(std::ostream* output, Flags flags = {})

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Corrade::Utility::Fatal::~Fatal()

Destructor.

Exits the application with exit code specified in constructor.