On 2012-05-05 18:20:44 +0000, "Mehrdad" <[email protected]> said:

How do you fix it for size_t and uint, etc.?

I'm not sure what problem you're seeing. You can do the same with any type.

        struct PineappleSize { size_t size; }

If you need operators to work, define them. If you need the new type to be a specialization, just use alias this. Something simple:

        struct PineappleSize
        {
                size_t size;

                alias size this;

                PineappleSize opBinary(string op)(PineappleSize other)
                {
                        mixin("return size "~op~" other.size");
                }
        }


--
Michel Fortin
[email protected]
http://michelf.com/

Reply via email to