Exceptions Questions

It appears that the what() function is a member of the <exception> class. I have seen several other exceptions classes simply inherits the exeception class and then overrides the what() as virtual what().
But I have seen  the docs of the std. <exception> template functions and I do not see a what() there.
Anyone knows if what() is really a member of the <exception> OR is it inherits from some other class?.

I am coming from a Java background and writing some C++ code. One thing....Nothing to beat Javadocs style Java documemtation. C++ is no where near. Sorry. I am not bashing.

I home someone will point me to some place on the web or throw his/her two cents on this.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The what function is a member of the std::exception class declared in the <exception> header file.  This is specified in section 18.6.1 of the C++ standard.  The function is declared like this:

virtual const char* what() const throw();

You can read about it in this tutorial:


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
> Nothing to beat Javadocs style Java documemtation

Agreed. C++ has a poor cousin of Javadoc called Doxygen, but I've yet to see it applied to the standard libraries. If it was adopted in the drafting of the C++ standard, it might be more widley used in standard library implementations and indeed 3rd party libraries, but the standard was drafted by a committee and it took long enough to draft without needing to reach a concensus about documentation.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.