Re: Compiling Templates

2009-07-02 Thread Kagamin
bearophile Wrote: > Kagamin: > > > bearophile Wrote: > > > > > Most of the things you can do with templates can be done with functions > > > (even not pure ones!) run at compile-time that are also allowed to use > > > (and receive/return) a type of compile-time variables of type "type" :-) >

Re: Compiling Templates

2009-07-02 Thread bearophile
Kagamin: > bearophile Wrote: > > > Most of the things you can do with templates can be done with functions > > (even not pure ones!) run at compile-time that are also allowed to use (and > > receive/return) a type of compile-time variables of type "type" :-) I think > > this may lead to a lang

Re: Compiling Templates

2009-07-02 Thread Kagamin
bearophile Wrote: > Most of the things you can do with templates can be done with functions (even > not pure ones!) run at compile-time that are also allowed to use (and > receive/return) a type of compile-time variables of type "type" :-) I think > this may lead to a language that's cleaner th

Re: Compiling Templates

2009-06-29 Thread Saaa
Always nice to see the inner workings, thanks. Here a few things that bugged me: Seeing templates as runtime functions, making the whole instantiation thing kind of strange :) Trying to use implicitly deduces parameters for function templates. Writing Foo(d) iso Foo!(int [][])(d). -- template Fo

Re: Compiling Templates

2009-06-29 Thread Joel C. Salomon
Walter Bright wrote: > http://www.reddit.com/r/programming/comments/8wgak/compiling_templates/ Nice & informative. Now if there were only such a readable description of how exceptions work… —Joel Salomon

Re: Compiling Templates

2009-06-28 Thread bearophile
Walter Bright: > http://www.reddit.com/r/programming/comments/8wgak/compiling_templates/ It looks like a quite complex machinery. >From the article: >But there is a rule in C++ and D that a template with a specific set of >arguments can only have one instantiation for the whole program. This mea