D vs C++
Daniel Gibson
metalcaedes at gmail.com
Mon Dec 27 08:18:17 PST 2010
Am 27.12.2010 17:01, schrieb Caligo:
> On Mon, Dec 27, 2010 at 7:20 AM, Jonathan M Davis <jmdavisProg at gmx.com
> <mailto:jmdavisProg at gmx.com>> wrote:
>
> On Monday 27 December 2010 04:41:37 spir wrote:
> > On Sun, 26 Dec 2010 12:06:04 -0800
> >
> > Walter Bright <newshound2 at digitalmars.com
> <mailto:newshound2 at digitalmars.com>> wrote:
> > > 11. generative programming
> >
> > Does someone have a pointer to any kind of doc about this? (in D)
>
> Anything on templates, template mixins, and string mixins. All of
> them generate
> code. And some people have done some pretty crazy stuff with them
> (especially
> string mixins).
>
> - Jonathan M Davis
>
>
> So is it like template metaprogramming in C++? a small D example would
> be helpful. There doesn't seem to be anything about it in TDPL.
http://www.digitalmars.com/d/2.0/templates-revisited.html
>
> As for CTFE, does this mean I could call 'writeln()' at compile time and
> have it print a message to stdout while compiling?
writeln() not. you can call pure functions (but not yet all of them)
See http://www.digitalmars.com/d/2.0/function.html#interpretation for
further information.
More information about the Digitalmars-d
mailing list