change mixins

Bill Baxter wbaxter at gmail.com
Sun Feb 14 17:26:14 PST 2010


On Sun, Feb 14, 2010 at 4:39 PM, Walter Bright
<newshound1 at digitalmars.com> wrote:
> Bill Baxter wrote:
>>
>> I have had one use for templates that are both stand-alone and mixed
>> in -- that's collections of aliases and utility functions based on a
>> particular type.
>
>
> You'll possibly run into a serious problem doing that. With templates, the
> name lookup is done in the scope of the template definition. With mixin
> templates, name lookup is done in the scope of the template instantiation.

Hmm, well it never caused a problem in my case.  The contents of the
templates were mostly self contained and didn't refer to much of
anything from the outside world.

Anyway, I'm not saying this is a must-have capability, just providing
a data point that someone has actually used the functionality.  If
there's something super cool that can be enabled by making the change,
then that probably wins.

--bb



More information about the Digitalmars-d mailing list