Bug 11938 – "Ifti!T" for std.traits

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-01-16T09:58:27Z
Last change time
2024-12-01T16:19:55Z
Assigned to
No Owner
Creator
monarchdodra
Moved to GitHub: phobos#9623 →

Comments

Comment #0 by monarchdodra — 2014-01-16T09:58:27Z
traits has "Unqual", which can give the Unqualified type of something. However, there is no guarantee that "T : Unqual!T". For types where "T : Unqual!T", I'd like a template called "Ifti" that returns Unqual!T, and T otherwise. This would, in particular, be useful for templates that operate on ranges. For example: strut S { int i; } strut P { int* p; } Ifti!(const(int[])) => const(int)[] Ifti!(const(S)) => S Ifti!(const(P)) => const(P) Not sure "Ifti" is the correct name, but I couldn't think of better.
Comment #1 by peter.alexander.au — 2014-01-25T10:40:30Z
Comment #2 by robert.schadek — 2024-12-01T16:19:55Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9623 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB