c++ - typedef std::runtime_error MyError vs class MyError : public std::runtime_error -


I am currently implementing some custom exceptions to a project and for my exceptions to be typed or a new exception Are interested in prospective pros and cons of each category and if one is better?

Professionals are easy to find their own class: You can call it hold Can be transmitted in the handler.

If you decide not to apply your own class, then I still doubt that you need this typeface: What are you thinking? You can also use plain std :: runtime_error .

In addition, you may be interested in articles about exception handling and applying your own exception class.

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -