On Friday, 11 March 2022 at 12:53:56 UTC, Adam D Ruppe wrote:
On Friday, 11 March 2022 at 12:01:27 UTC, Andrey Zherikov wrote:
There is some inconsistency between templates and template
functions as this works as I want to:
Yeah, functions have the special feature of implicit
instantiation fr
On Friday, 11 March 2022 at 12:01:27 UTC, Andrey Zherikov wrote:
There is some inconsistency between templates and template
functions as this works as I want to:
Yeah, functions have the special feature of implicit
instantiation from the function arguments. No other template do,
if you want a
On 3/11/22 04:01, Andrey Zherikov wrote:
> There is some inconsistency between templates and template functions as
> this works as I want to:
> ```d
> import std.stdio;
>
> void f(int i=3)()
> {
> writeln(i);
> }
>
> void main()
> {
> f!1; // 1
> f!(); // 3
> f;// 3
> }
>
There is some inconsistency between templates and template
functions as this works as I want to:
```d
import std.stdio;
void f(int i=3)()
{
writeln(i);
}
void main()
{
f!1; // 1
f!(); // 3
f;// 3
}
```
On Friday, 11 March 2022 at 11:55:24 UTC, Andrey Zherikov wrote:
On Friday, 11 March 2022 at 07:06:15 UTC, bauss wrote:
Create an alias for T!() is the best you can do.
Ex.
```
alias t = T!();
```
There isn't really any better method as far as I know.
I'd like to preserve the name (`t` != `
On Friday, 11 March 2022 at 07:06:15 UTC, bauss wrote:
Create an alias for T!() is the best you can do.
Ex.
```
alias t = T!();
```
There isn't really any better method as far as I know.
I'd like to preserve the name (`t` != `T`) but `alias T = T!()`
gives me `Error: declaration `T` is alre
On Friday, 11 March 2022 at 04:41:40 UTC, Andrey Zherikov wrote:
I have simple template:
```d
template T(int i=3)
{
mixin template M(int m)
{
enum t = i;
}
}
{
mixin T!1.M!1;
pragma(msg, t); // 1
}
{
mixin T!().M!1;
pragma(msg, t); // 3
I have simple template:
```d
template T(int i=3)
{
mixin template M(int m)
{
enum t = i;
}
}
{
mixin T!1.M!1;
pragma(msg, t); // 1
}
{
mixin T!().M!1;
pragma(msg, t); // 3
}
{
mixin T.M!1; // Error: identifier `M` of `T.M` is not