A simplification of the RvalueRef idiom

Stefan Koch via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Nov 22 23:53:09 PST 2016


On Tuesday, 22 November 2016 at 22:03:14 UTC, Satoshi wrote:
> or I have simple class
>
> class View {
> this(Rectangle frame) {...}
> this(float, float, float, float) { ... }
> this(Point, Size) { ... }
> }
>
> then struct Point, Size and Rectangle (Point, Size)
>
> now I need to write 2 overloads for View class taking 4 floats 
> or (Point, Size) and this must do in every descendant of View 
> class.

This can be solved with string-mixins.



More information about the Digitalmars-d-learn mailing list