Original Post
I have a exception class which I would want to be catch by ref only, so I declare the copy constructor private.
However, VC++ 6 refuses to compile, giving me an error an error that the exception object cannot be thrown because of an inaccessible copy constructor.
But upon checking, the copy constructor is only called when the exception object is caught by value
eg
catch(MyExceptionClass e) // only this needs the copy constructor
{}
catch(MyExceptionClass &e) // this doesn''t need the copy constructor
{}
So has anyone been able to ensure the exception object is to be catch by ref only, not value??