
AMDG Emil Dotchevski wrote:
On Wed, Aug 19, 2009 at 5:14 AM, Adam Badura<abadura@o2.pl> wrote:
This is especially strange because operator << can be used to add data to a const exception object so I don't see reason for not being able to get modifiable data back (at least from non-const exception object).
Adding error info is supported for const exceptions because it isn't stored in the exception object itself, it's stored in a separate object the exception points to. This arrangement can't be just an implementation detail because the copy constructor is required to be nothrow.
The other reason is to support the throw foo() << my_Info() syntax.
If operator<< is defined as a member function then it can take an rvalue exception and still be non-const. In Christ, Steven Watanabe