[Issue 8968] New: std.traits.ParameterIdentifierTuple is undocumented and doesn't work with ref params
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Nov 6 10:18:55 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8968
Summary: std.traits.ParameterIdentifierTuple is undocumented
and doesn't work with ref params
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: andrej.mitrovich at gmail.com
--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2012-11-06 10:18:54 PST ---
import std.traits;
void foo(ref int x) { }
void main()
{
alias ParameterIdentifierTuple!foo x;
}
D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\traits.d(518): Error: function
literal __lambda16 (ref int x) is not callable using argument types (int)
It tries to use a clever trick by defining an inner lambda with a parameter
list, and then extracts the name from that. But it can't call a lambda with a
ref parameter at compile-time.
Honestly we should just have a simple __trait that returns the parameter
identifiers, because this is a very hacky workaround that doesn't work in all
cases.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list