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 than
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
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
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 means