[Issue 24307] [std.meta] weak values/alias for default values

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Dec 30 00:04:47 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=24307

Basile-z <b2.temp at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |b2.temp at gmx.com

--- Comment #1 from Basile-z <b2.temp at gmx.com> ---
There are language tricks that can be used too, for example "uniform
construction syntax"

```d
auto lerp(F = double, I)(I a,I b,F per=F(.5)){}
struct myfloat{double v;}
void main(){
    lerp(1,10,myfloat());
    lerp(1,10);
    lerp!(myfloat)(1,10);
}
```

But at some point the fact that D does no implicit construction will still be a
limitation.

--


More information about the Digitalmars-d-bugs mailing list