DIP69 - Implement scope for escape proof references

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Sat Dec 13 12:55:58 PST 2014


On 12/13/2014 6:10 AM, Max Samukha wrote:
> On Saturday, 13 December 2014 at 02:55:50 UTC, Manu via Digitalmars-d wrote:
>
>> Templates and functions are different things. I think it's a massive
>> mistake to have created a way to write a template that looks nothing
>> like a template.
>
> That is a misconception spread by C++. Templates are pure functions applied at
> compile time. Function templates are functions partially applied at compile time.

It took me an embarrassingly long time to get past the C++ notion that templates 
are something orthogonal from 'normal' functions and data declarations.

Even the C++ notion of a 'primary' template is wholly unnecessary, but is deeply 
embedded in how it handles the semantics of templates.

C++ did get right the partial ordering of templates, and D applied partial 
ordering to 'normal' functions as well.


More information about the Digitalmars-d mailing list