

|
 |
| Programming > C++ Moderated > Re: Meyers effe... |
|
| << Topic |
< Post |
Post 9 of 9 Topic 9501 of 9823
|
Post > |
Topic >> |
Re: Meyers effective C++, templates, np-complete
by Vidar Hasfjord <vattilah-groups@[EMAIL PROTECTED]
>
Apr 16, 2008 at 11:38 AM
| On Apr 15, 4:22 am, Todd Mars <tamn...@[EMAIL PROTECTED]
> wrote:
> Does this mean that the use of templates can cause the compile to
> execute for an infinite loop or near infinite loop?
Yes. Since templates form a Turing-complete meta-language inside C++
it follows that you can make a template meta-program that runs
forever. While traditional C/C++ programming allows you to express a
computation in the form of a binary executable on a computer,
templates allow you to express how that program is constructed; which
itself is a computation of course. The former executes at run-time in
the resulting binary executable, the latter (i.e. template
instantiation) executes at compile-time inside your compiler. In a
real sense, the compiler is the execution platform for a C++ template
meta-program.
Regards,
Vidar Hasfjord
--
[ See http://www.gotw.ca/resources/clcm.htm
for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]


|
9 Posts in Topic:
|
Todd Mars <tamnt54@[EM |
2008-04-14 21:22:01 |
|
Carl Barron <cbarron41 |
2008-04-15 12:28:24 |
|
=?ISO-8859-1?Q?Daniel_Kr= |
2008-04-15 12:29:15 |
|
Marcin.Barczynski@[EMAIL |
2008-04-15 12:32:41 |
|
Thomas Richter <thor@[ |
2008-04-15 12:31:09 |
|
Mathias Gaunard <loufo |
2008-04-15 12:32:35 |
|
Edward Rosten <Edward. |
2008-04-15 12:34:17 |
|
"Martin T." < |
2008-04-15 12:43:13 |
|
Vidar Hasfjord <vattil |
2008-04-16 11:38:44 |
|
Post A Reply:

|
|
|
|