Can I overload throw or return?

A

Atlas

It's said I can't throw an ostream object, so maybe I can overload "throw"
for my basic_ostream derived class?
 
O

ox

With the exception of a few special cases, you can "throw" any object
that you can "return".
 
R

Ron Natalie

Atlas said:
It's said I can't throw an ostream object, so maybe I can overload "throw"
for my basic_ostream derived class?
You can't throw ostreams because you can't copy them. The object
you throw must have valid copy semantics.
 

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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top