On Saturday, 22 April 2017 at 12:14:26 UTC, Nordlöw wrote:
Have anyone tried to implement a variant of `std.conv.to` that
can be `nothrow @nogc` if the exception handling is replaced by
an extra second parameter (`defaultValue`) returned iff the
call to `to` throws?
There is common ifThrown
On Saturday, 22 April 2017 at 12:16:19 UTC, Nordlöw wrote:
On Saturday, 22 April 2017 at 12:14:26 UTC, Nordlöw wrote:
If I get this to work, I'm gonna try pushing it into std.conv.
Another bit to pick on is the return value.
auto x = toWithDefault!int("1", 0.0f);
typeof(x) will be float even
On Saturday, 22 April 2017 at 18:26:56 UTC, Dmitry Olshansky
wrote:
On 4/22/17 6:57 PM, Stanislav Blinov wrote:
On Saturday, 22 April 2017 at 16:41:00 UTC, Nordlöw wrote:
If defaultValue is not lazy, it's potentially wasteful.
What do you mean with "potentially wasteful"?
Excess calls to
On 4/22/17 6:57 PM, Stanislav Blinov wrote:
On Saturday, 22 April 2017 at 16:41:00 UTC, Nordlöw wrote:
If defaultValue is not lazy, it's potentially wasteful.
What do you mean with "potentially wasteful"?
Excess calls to copy constructors?
Evaluation of an expression the result of which
On Saturday, 22 April 2017 at 16:41:00 UTC, Nordlöw wrote:
If defaultValue is not lazy, it's potentially wasteful.
What do you mean with "potentially wasteful"?
Excess calls to copy constructors?
Evaluation of an expression the result of which might not be
used. defaultValue could be
On Saturday, 22 April 2017 at 15:36:56 UTC, Stanislav Blinov
wrote:
On Saturday, 22 April 2017 at 12:16:19 UTC, Nordlöw wrote:
On Saturday, 22 April 2017 at 12:14:26 UTC, Nordlöw wrote:
Is there any way I can make it `@nogc` without having to
modify the code in `std.conv`?
If I get this to
On Saturday, 22 April 2017 at 12:16:19 UTC, Nordlöw wrote:
On Saturday, 22 April 2017 at 12:14:26 UTC, Nordlöw wrote:
Is there any way I can make it `@nogc` without having to
modify the code in `std.conv`?
If I get this to work, I'm gonna try pushing it into std.conv.
If defaultValue is not
On Saturday, 22 April 2017 at 12:14:26 UTC, Nordlöw wrote:
if (haveCommonType!(T, U))
Defined as:
/// Is `true` iff `Types` all share a common type.
enum bool haveCommonType(Types...) = !is(CommonType!Types ==
void);
import std.traits : CommonType;
On Saturday, 22 April 2017 at 12:14:26 UTC, Nordlöw wrote:
Is there any way I can make it `@nogc` without having to modify
the code in `std.conv`?
If I get this to work, I'm gonna try pushing it into std.conv.
Have anyone tried to implement a variant of `std.conv.to` that
can be `nothrow @nogc` if the exception handling is replaced by
an extra second parameter (`defaultValue`) returned iff the call
to `to` throws?
I currently have a solution
10 matches
Mail list logo