DUAL FEATURE REQUEST: let "with" take a struct pointer and evaluate to its parameter
downs
default_357-line at yahoo.de
Sat Dec 22 11:16:53 PST 2007
downs wrote:
> Consider:
>
>> R delegate() bind(R, T...)(R delegate(T) dg, T bind) {
>> struct Holder { typeof(dg) _dg; T _bind; R call() { return _dg(_bind); } }
>> with (new holder) {
>> _dg=dg;
>> _bind=bind;
>> return &call;
>> }
>> }
>
Arrgh!
I mean
>
> with (new Holder) {
> foreach (id, entry; dg) _dg[id]=entry;
>
Sorry :)
More information about the Digitalmars-d
mailing list