Path: csiph.com!eeepc.pasdenom.info!news.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!not-for-mail From: Thomas Richter Newsgroups: comp.lang.java.programmer Subject: Re: Java vs C++ Date: Mon, 07 Feb 2011 14:53:02 +0100 Organization: InterNetNews at News.BelWue.DE (Stuttgart, Germany) Lines: 15 Message-ID: References: <4d4d585c$0$81476$e4fe514c@news.xs4all.nl> <4d4d60dc$0$23763$14726298@news.sunsite.dk> <4d4d8322$0$41117$e4fe514c@news.xs4all.nl> NNTP-Posting-Host: vpn-m-8d3a2f56.campus.uni-stuttgart.de Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.belwue.de 1297086783 2627 141.58.47.86 (7 Feb 2011 13:53:03 GMT) X-Complaints-To: news@news.belwue.de NNTP-Posting-Date: Mon, 7 Feb 2011 13:53:03 +0000 (UTC) User-Agent: Mozilla-Thunderbird 2.0.0.24 (X11/20100329) In-Reply-To: Xref: csiph.com comp.lang.java.programmer:26135 Lawrence D'Oliveiro wrote: > In message , Thomas Richter wrote: > >> Templates allow meta-programming, i.e. you can use the compiler to >> generate code. > > Why, what do compilers normally do? Generate source code, or rather, evaluate expressions at compile time rather than run time. Compilers usually take the source code and create executable code from that, but the C++ template system allows you to instruct the compiler to do parts of this evaluation while compiling. So long, Thomas