Search

March 25, 2023
General »
...It's but a convenient example to demonstrate the problem with D's `alias` anyway.
March 24, 2023
Learn »
...import std.variant;

    private Variant[string] values;
    alias values this;

    @property
    {
      Variant opDispatch(string key...
March 24, 2023
Learn »
...fine for structs:

```
struct MyInt {
    int x;
    alias x this;

    this(MyString s) {
        x = s...
March 24, 2023
General »
...template Vec3(T) {
    alias Vec3 = Matrix!(T, 3, 1);

    template opResolveAlias(alias U)
    {
        static if...
March 24, 2023
General »
...S, size_t M, size_t N)
{
}

alias Vec3(S) = Matrix!(S, 3, 1);
```

What...
March 24, 2023
Learn »
...or other operators for a struct, just alias the value to `this` and use `std...
March 24, 2023
General »
...it: for now, D allows writing template alias paramters, but AFAIK they will match absolutely...
March 24, 2023
General »
My apologies, correction: `A` is a 'trivial alias'. Sorry for the minipost, but this topic...
March 24, 2023
Learn »
BTW, you can also `alias this` your struct value and then use `std.conv : to...
March 24, 2023
General »
...with concrete types.

Finally, in our example:

```
alias A(T) = B!T;
void foo(T...
121 122 123 124 125 126 127 128 129 130 131
Next ›   Last »