btw for my immediate needs i replace second delegate with value
i.e. remove "lazy" from declaration and remove "()" in return
so ifThrown loose some generity
```d
nothrow
CommonType!(T1, T2) ifThrown(E : Throwable = Exception, T1, T2)
(lazy scope T1 expression, scope
On Friday, 30 April 2021 at 13:42:49 UTC, Steven Schveighoffer
wrote:
On 4/30/21 9:24 AM, Meta wrote:
My point is that I think marking the *function* nothrow is not
correct, it's the second parameter that dictates the throwing
of the result.
And you can probably fix the second parameter to b
On Thursday, 29 April 2021 at 20:00:23 UTC, novice2 wrote:
i dont understand why (templates too dificult for me yet),
but if i comment "lazy" from T2,
then compiler allow add "nothrow" to "ifThrown"
```d
CommonType!(T1, T2) ifThrown(E : Throwable = Exception, T1,
T2)(lazy scope T1 expression, /
On 4/30/21 9:24 AM, Meta wrote:
On Friday, 30 April 2021 at 13:05:00 UTC, Steven Schveighoffer wrote:
On 4/29/21 1:50 PM, Meta wrote:
The reason for this, apparently, is in the definition of `ifThrown`:
```
CommonType!(T1, T2) ifThrown(E : Throwable = Exception, T1, T2)(lazy
scope T1 express
On Friday, 30 April 2021 at 13:05:00 UTC, Steven Schveighoffer
wrote:
On 4/29/21 1:50 PM, Meta wrote:
The reason for this, apparently, is in the definition of
`ifThrown`:
```
CommonType!(T1, T2) ifThrown(E : Throwable = Exception, T1,
T2)(lazy scope T1 expression, lazy scope T2 errorHandler
On 4/29/21 1:50 PM, Meta wrote:
The reason for this, apparently, is in the definition of `ifThrown`:
```
CommonType!(T1, T2) ifThrown(E : Throwable = Exception, T1, T2)(lazy
scope T1 expression, lazy scope T2 errorHandler) nothrow
```
It's not marked as `nothrow` in the function's definition
Thank you Imperatron, Ali
both variants
```d
scope(failure) assert(0);
```
```d
collectException
```
works!
Thank Meta
The reason for this, apparently, is in the definition of
`ifThrown`
i tried to modify ifThrown adding nothrow,
but compiler dont understand, that second parameter cant thr
On 4/29/21 9:02 AM, novice2 wrote:
> format() can throw.
In order to throw for an int, I added a foo(x) expression to prove that
the code works.
> I don't want embrace format into try..catch block,
> and i found elegant std.exception.ifThrown.
There are collectException and collectExceptionM
On Thursday, 29 April 2021 at 16:02:20 UTC, novice2 wrote:
Hello.
I need use std.format.format() in nothrow function.
format() can throw.
For this case i have special default string.
I don't want embrace format into try..catch block,
and i found elegant std.exception.ifThrown.
But DMD say "ifThro
On Thursday, 29 April 2021 at 16:02:20 UTC, novice2 wrote:
Hello.
I need use std.format.format() in nothrow function.
format() can throw.
For this case i have special default string.
I don't want embrace format into try..catch block,
and i found elegant std.exception.ifThrown.
But DMD say "ifThro
Hello.
I need use std.format.format() in nothrow function.
format() can throw.
For this case i have special default string.
I don't want embrace format into try..catch block,
and i found elegant std.exception.ifThrown.
But DMD say "ifThrown not nothrow"
https://run.dlang.io/is/kXtt5q
```d
nothrow
11 matches
Mail list logo