On Tuesday, 14 August 2012 at 23:13:07 UTC, Mehrdad wrote:
On Monday, 13 August 2012 at 15:32:45 UTC, Dmitry Olshansky wrote:
So (*yawn*) tell what kind of exception specification the following function should have:

auto joiner(RoR, Separator)(RoR r, Separator sep);



auto joiner(RoR, Separator)(RoR r, Separator sep)
        throws(?);


Or even better:

auto joiner(RoR, Separator)(RoR r, Separator sep)
        throws(auto);


That way it's easy enough for the programmer to make the compiler shut up (it's certainly easier than swallowing the exception), while allowing him to write functions that are perfectly transparent toward exceptions, and which would be allowed to throw/catch as they would in any other exception-unchecked language.


IMO it would work well in practice.

Reply via email to