Thread overview
[Issue 23610] std.typecons.Typedef doesn't forward constructors
Jan 09, 2023
Andrej Mitrovic
Jan 09, 2023
Iain Buclaw
January 09, 2023
https://issues.dlang.org/show_bug.cgi?id=23610

--- Comment #1 from Andrej Mitrovic <andrej.mitrovich@gmail.com> ---
For anyone else who just wants to "get things done", I use this sort of workaround:

-----
private struct Vec3(size_t line = __LINE__)
{
    ...
}

// Type aliases for Vec3
public alias Point3 = Vec3!();   // 3D point
public alias Color = Vec3!();    // RGB color
-----

So at least that gives you some type safety.

And that only works for your own user-defined types. But you could use alias this tricks to wrap existing types. Maybe Typedef does something like this under the hood. But it's so incomplete it's a pain to use.

--
January 09, 2023
https://issues.dlang.org/show_bug.cgi?id=23610

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P3

--
December 01
https://issues.dlang.org/show_bug.cgi?id=23610

--- Comment #2 from dlangBugzillaToGithub <robert.schadek@posteo.de> ---
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/phobos/issues/9854

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB

--