Re: Out parameters and the strong exception guarantee

2010-06-13 Thread FeepingCreature
On 08.06.2010 14:28, Michel Fortin wrote: The strong exception guarantee guaranties that if an exception is thrown, the function will have no side effect. I think that guarantee is too constraining for too little payoff.

Re: Out parameters and the strong exception guarantee

2010-06-09 Thread Justin Johansson
bearophile wrote: Michel Fortin: But if one of your function has an 'out' parameter, it's impossible to implement the strong guarantee, as illustrated by this trivial example: void testOut(out int a) { throw new Exception(hello!); } void main() {

Re: Out parameters and the strong exception guarantee

2010-06-09 Thread Nick Sabalausky
Justin Johansson n...@spam.com wrote in message news:huo7rk$9a...@digitalmars.com... I re-read that recent post of yours in the context of this new post and I must say that I agree with you. The ability to return mutiple return values, as a tuple of sorts, is a good idea. Short of this a

Out parameters and the strong exception guarantee

2010-06-08 Thread Michel Fortin
The strong exception guarantee guaranties that if an exception is thrown, the function will have no side effect. Of course, not all function can support this (a file I/O error in the middle of writing will have side effects), but often it can and it's generally good practice to offer the

Re: Out parameters and the strong exception guarantee

2010-06-08 Thread bearophile
Michel Fortin: But if one of your function has an 'out' parameter, it's impossible to implement the strong guarantee, as illustrated by this trivial example: void testOut(out int a) { throw new Exception(hello!); } void main() { int a = 2;