Thread overview
[Issue 4423] [tdpl] enums of struct types
August 07, 2014
https://issues.dlang.org/show_bug.cgi?id=4423

hsteoh@quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
                 CC|                            |hsteoh@quickfur.ath.cx
         Resolution|---                         |WORKSFORME

--- Comment #6 from hsteoh@quickfur.ath.cx ---
Works in git HEAD. Full test code:

------
struct S
{
    this(string phrase, int num)
    {
        this.phrase = phrase;
        this.num = num;
    }

    int opCmp(const ref S rhs)
    {
        if(phrase < rhs.phrase)
            return -1;
        else if(phrase > rhs.phrase)
            return 1;

        if(num < rhs.num)
            return -1;
        else if(num > rhs.num)
            return 1;

        return 0;
    }

    string phrase;
    int    num;
}

enum E : S {a = S("hello", 1),
            b = S("goodbye", 45),
            c = S("world", 22)};

void main() {
        import std.stdio;

        E e;
        writeln(e.phrase);

        e = E.b;
        writeln(e.phrase);
}
------

Program output:
------
hello
goodbye
------

--
August 10, 2014
https://issues.dlang.org/show_bug.cgi?id=4423

github-bugzilla@puremagic.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|WORKSFORME                  |FIXED

--
August 10, 2014
https://issues.dlang.org/show_bug.cgi?id=4423

--- Comment #7 from github-bugzilla@puremagic.com ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/3f719e1002b1aaf2c9f2e066f13c97dbd86cc498 fix Issue 4423 - [tdpl] enums of struct types

--
September 28, 2020
https://issues.dlang.org/show_bug.cgi?id=4423
Issue 4423 depends on issue 6221, which changed state.

Issue 6221 Summary: Should be possible to pass struct function returns by 'const ref'. https://issues.dlang.org/show_bug.cgi?id=6221

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--