Redirect to different overloads at compile time?

2014-06-29 Thread David Bregman via Digitalmars-d-learn
Suppose I have a C library which implements a function for several types. C doesn't have overloading, so their names will be distinct. extern(C): double foo_double(double); float foo_float(float); Now I want to build a D wrapper, and merge them into a single function with overloading: T

Re: Redirect to different overloads at compile time?

2014-06-29 Thread David Bregman via Digitalmars-d-learn
On Monday, 30 June 2014 at 04:50:05 UTC, Kenji Hara wrote: In D, you can merge arbitrary overloads by using alias declaration. Oh wow, you are right. That's a nice feature! I guess I simplified too much for the sake of making the post, the functions I would actually like to merge are