On 2008-06-28 09:56, Chris Forone wrote:
hello group,
are there differences (run-time, ...) between the following two versions?
...
catch (std::ios_base::failure exception)
...
...
catch (const std::ios_base::failure& exception) // attend reference
...
Yes, the first version must create a copy of the failure object while
the second version uses the same object that was thrown. In some cases
this will not matter, but in others it will. If you do not know the
difference between passing by reference and passing by value you should
read up on it.
if not, what version do you prefer? thanks a lot!
The second version is the preferred one.
--
Erik Wikström