On Wednesday, 10 May 2017 at 14:27:46 UTC, Stanislav Blinov wrote:
On Wednesday, 10 May 2017 at 13:27:17 UTC, k-five wrote:

Thanks, but I know about what are you saying. The user_apply[4] has so many possibilities and I cannot use if-else

That doesn't sound right. Either you've already handled all the possible cases and thus expect the to! to not throw (can specify that i.e. via std.exception.assumeWontThrow), or, as you're saying, it's much more than an if-else, but in that case exception will be thrown on invalid input.

------------------------------------------------------------------

I know. But I am saying that I do not want to take care of any exceptions.
I just wanted to write:

int variable = to!int( string-type );

In fact something like using "no throw" is a function:
void init( ... ) nothrow {
    ...
    int variable = to!int( string-type );
    ...
}

but this is not valid.

Thanks anyway and I will test: Function std.exception.assumeWontThrow at this link:
https://dlang.org/library/std/exception/assume_wont_throw.html

Reply via email to