Function overloading concern
Bob W
nospam at aol.com
Fri Mar 10 00:52:58 PST 2006
"Sean Kelly" <sean at f4.ca> wrote in message
news:duq8gt$1cav$1 at digitaldaemon.com...
> By the way, the more complex C++ examples don't work in D anyway, because
> D is module-based. For example, it's more likely func would be defined in
> a third module like so:
>
> Module C:
>
> module c;
> import b; // let's say b is the default implementation
>
> template func( T )
> {
> void func( inout T t1, inout T t2 )
> {
> swap( t1, t2 );
> }
> }
>
> Main:
>
> import a;
> import c;
>
> void main()
> {
> int i = 1, j = 2;
> func( s, t );
> }
>
> However, this doesn't work in D even without overloading.
I doubt that this would work in any programming language ;-)
More information about the Digitalmars-d
mailing list