muler said:
hi,
what does this exactly mean:
"Except for the new, delete, typeid, dynamic_cast, and throw operators
and the try-block, individual C++ expressions and statements need no
run-time support." TC++PL § 1.3.1
I would interpret this in the following way: Most C++ statements can be
translated into a sequence of architecture-specific machine instructions which
consume a fixed amount of time (or to say it in other words, the work the
processor has to do in order to process the C++ statement does not depend on
some internal state of the application).
Some C++ expressions can only get translated into machine instructions that
require some computations based on internal states of the application. For
example the operators new and delete must work on the free-lists that are
internally kept by the C++ run-time environment (how a particular C++ compiler
manages it memory is of course an implementation detail we do not need to care
about, but it is nevertheless good to know what happens behind the scenes). Thus
it may take more or less work for the computer to process a new or delete
request; it depends on the state of the free-lists.
I don't know whether TC++PL § 1.3.1 also means that a C++ programme written
without using the mentioned features of the C++ language won't need to be linked
against the C++ run-time library (which is another platform specific detail, I
guess). I tried this with a simple application on MS Visual C but it complains
that is doesn't find _mainCRTStartup.
Regards,
Stuart