aliased functions

BCS ao at pathlink.com
Tue Mar 20 17:36:45 PDT 2007


Reply to Chris Nicholson-Sauls,

> Suppose I extend that signature
> in a later revision...  Or suppose I typo while implementing yet
> another...  Or suppose a lot of things.  It would've been very handy
> to have something like this to keep me on track.
> 
> I may not be fond of languages that hold my hand, but I am fond of
> languages that help me hold my own.  :)
> 

You could do something like this.

typedef int function(int) callback


int foo(int bar){...}
static assert(is(&foo : callback));

It won't save you typing, but it will find errors.

I'd be interested in the "protocol" idea as well.





More information about the Digitalmars-d mailing list