__traits(getAttributes, ...) gets attributes for the first overload only

Jakob Ovrum via Digitalmars-d digitalmars-d at puremagic.com
Mon Dec 7 17:19:29 PST 2015


On Monday, 7 December 2015 at 23:52:38 UTC, NX wrote:
> On Sunday, 6 December 2015 at 02:00:30 UTC, Andrei Alexandrescu 
> wrote:
>> Yah, error is the way to go. -- Andrei
>
> Can I ask a question?:
> Why we don't have a way to get an exact overload of function?
> Something like:
>
> void foo(int i);
> int foo(float f);
> //...
> int function(float) foop = &foo::(float);

`&foo` is a special "type" that will implicitly convert to both 
`void function(int)` and `int function(float)`. No special syntax 
is needed, just trigger the conversion.



More information about the Digitalmars-d mailing list