Bug 11828 – std.typecons.Typedef with two arguments too

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-12-26T16:35:23Z
Last change time
2024-12-01T16:19:46Z
Assigned to
No Owner
Creator
bearophile_hugs
Moved to GitHub: phobos#10025 →

Comments

Comment #0 by bearophile_hugs — 2013-12-26T16:35:23Z
In some cases I have to tell apart different Typedefs using the cookie, but I don't need to specify a different init value: alias Meters = Typedef!(double, "Meters"); alias Liters = Typedef!(double, "Liters"); For such cases I suggest to replace this part of the std.typecons module: /** Library typedef. */ template Typedef(T) { alias .Typedef!(T, T.init) Typedef; } With two (shorter) aliases: /// Library typedef. alias Typedef(T) = .Typedef!(T, T.init); /// ditto alias Typedef(T, string cookie=null) = .Typedef!(T, T.init, cookie);
Comment #1 by robert.schadek — 2024-12-01T16:19:46Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10025 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB