dynamic classes and duck typing

Bill Baxter wbaxter at gmail.com
Mon Nov 30 13:36:26 PST 2009


On Mon, Nov 30, 2009 at 1:00 PM, Walter Bright
<newshound1 at digitalmars.com> wrote:
> Álvaro Castro-Castilla wrote:
>>
>> It does. Shouldn't this work also?
>>
>> struct foo {
>>    void opDispatch( string name, T... )( T values ) {    }   }
>>
>>                                                             void main( ) {
>>  foo f;
>>    f.bar( 3.14 );
>> }
>
> Declare as:
>
>    void opDispatch(string name, T...)(T values...)
>                                               ^^^

You didn't use to have to do that with variadic templates.  Is that
also a new change in SVN?

Also, is there any chance you could paste the 1-line bug description
into your SVN commit messages?
For those of us who don't have the bug database memorized it would
make it much easier to find relevant commits.

(for instance I was scanning the commit log to see if there were any
changes related to how variadic templates work, but all one sees is a
list of commit messages like "bugzilla 3494".  Takes too long to
figure such things out if you have to plug each number one-by-one into
bugzilla.)

--bb



More information about the Digitalmars-d mailing list