Boost logo

Boost :

From: jarvi (jarvi_at_[hidden])
Date: 2005-05-05 19:14:52


On May 5, 2005, at 11:51 AM, Giovanni P. Deretta wrote:

> Angus Leeming wrote:
>> Hartmut Kaiser wrote:
>>> FYI, Wave has a special #pragma usable for bridging this gap:
>>>
>>> #pragma wave system(any OS command)
>>>
>>> which spawns of the given command and intercepts the produced stdout
>>> stream, inserting it instead of the pragma itself :-P. In C99 mode
>>> you
>>> even may use it from the operator _Pragma and force a full macro
>>> expansion of the inserted results:
>>>
>>> #define EVAL(x) x
>>> EVAL(_Pragma("wave system(any OS command)"))
>>>
>>> Regards Hartmut
>> Hartmut,
>> is that a good idea? I can imagine that running an existing
>> executable might cause untold damage to my system, but compiling a
>> piece of source code?
>> Doesn't it smack of C++ source code as computer virus?
>
> Well, technically, being templates turing complete we are in trouble
> anyway ...
>
> Sorry couldn't resist :)
>

A program running on a Turing machine can only affect the tape of the
machine.
The "tape" of a template metaprogram is quite well isolated from other
parts of a computer system.
(OTOH, templates never cease to surprise...)

   Jaakko


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk