const what () const throw

E

EasyVoip

Hello,

I have a hard time understanding what is going on here. This looks
like a normal function definition, but what const throw is doing on
the same line?

Thanks for your help!!!!

const char * what () const throw ()
{
return(std::invalid_argument::what());
};
 
R

red floyd

Hello,

I have a hard time understanding what is going on here. This looks
like a normal function definition, but what const throw is doing on
the same line?

Thanks for your help!!!!

const char * what () const throw ()
{
return(std::invalid_argument::what());
};

It's a member function of an exception class. The const after the
parens says that it's a const member function (can be called on a const
object), and the throw() is an exception specification indicating that
it is guaranteed not to throw any exceptions.
 
S

Serge

Thanks


It's a member function of an exception class. The const after the
parens says that it's a const member function (can be called on a const
object), and the throw() is an exception specification indicating that
it is guaranteed not to throw any exceptions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,199
Messages
2,571,045
Members
47,643
Latest member
ashutoshjha_1101

Latest Threads

Top