[Issue 5175] Add a way to get parameter names to std.traits

2015-06-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=5175

Andrei Alexandrescu  changed:

   What|Removed |Added

Version|unspecified |D2

--


[Issue 5175] Add a way to get parameter names to std.traits

2014-06-06 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=5175

Justin Whear  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||jus...@economicmodeling.com
 Resolution|--- |FIXED

--- Comment #2 from Justin Whear  ---
Fixed with the addition of ParameterIdentifierTuple
(http://dlang.org/phobos/std_traits.html#ParameterIdentifierTuple).

--


[Issue 5175] Add a way to get parameter names to std.traits

2013-01-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5175


Andrej Mitrovic  changed:

   What|Removed |Added

 CC||andrej.mitrov...@gmail.com


--- Comment #1 from Andrej Mitrovic  2013-01-22 
19:37:08 PST ---
Well there is now __parameters, but this gives out both the types, param names,
and default values:

void test(int x, int y = 1) { }

template ParameterTuple(alias func)
{
static if(is(typeof(func) P == __parameters))
alias P ParameterTuple;
else
static assert(0);
}

void main()
{
pragma(msg, ParameterTuple!test);
}

> (int x, int y = 1)

I would personally like to wrap ParameterTypeTuple, ParameterStorageClassTuple,
and provide a single GetParameters template which would return a tuple of these
struct objects:

struct Parameter(Type, alias DefVal)
{
ParameterStorageClass stc;
Type type;
string name;
alias DefVal defaultValue;
}

It's questionable how doable this is but it would make the API easier to use.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---