In a recent discussion in comp.objects.corba
remarked that catching an exception by reference to const, e.g.
catch(const CORBA::SystemException &ex)
can sometimes avoid construction of a temporary that is created when youQuote:}
just catch a reference, e.g.
Unfortunately, Michi couldn't remember where he had read this, and soQuote:}
couldn't provide an example. Since this is a C++ issue, I figured I'd
consult the C++ gurus. Does anybody know if catching an exception by
reference to const (as opposed to just catching by reference) can save you
the construction of a temporary? Could someone give an example?
(P.S. I know that if you DON'T catch by reference, you'll create a
temporary, and slice off the derived part of the object if you catch it by a
base class. That isn't the question...)