By definition, an inlined function is still not compile-time. It's just
runtime that's had its cost of calling and returning removed at the
expense of the code being inlined, possibly multiple times.

-- 
-Time flies like the wind. Fruit flies like a banana. [EMAIL PROTECTED]
-Stranger things have happened but none stranger than this. Steven W. Orr-
Does your driver's license say Organ Donor?Black holes are where God \
-------divided by zero. Listen to me! We are all individuals!---------

On Tue, 4 Apr 2000, Jerry Feldman wrote:

=>What about optimizing compilers that generate inline functions? 
=>I can't answer that specifically, but there are some optimizations that can 
=>really get wild, especially in C++.
=>"Steven W. Orr" wrote:
=>> I beg to heartily differ. *No* C compiler will evaluate a call to strlen
=>> at compile time, even if the string is compiletime evaluatable.
=>> 
=>> The best you can hope to do with a compile-time constant is to use sizeof
=>> -1 as in
=>> 
=>> #define MYSTR "MyString"
=>> 
=>> if ( (sizeof MYSTR) - 1 ) == strlen ( target ) ) ...
=>> 
=>> The strlen call is *definitely* a run-time call. The best you can hope to
=>> get (e.g., gcc) is that is will be transformed into an inline call.
=>> 
=>> -- 
=>> -Time flies like the wind. Fruit flies like a banana. [EMAIL PROTECTED]
=>> -Stranger things have happened but none stranger than this. Steven W. Orr-
=>> Does your driver's license say Organ Donor?Black holes are where God \
=>> -------divided by zero. Listen to me! We are all individuals!---------
=>> 
=>> On Tue, 4 Apr 2000, Bill Freeman wrote:
=>> 
=>> =>Steven Orr writes:
=>> =>
=>> =>> Hold on there Buffalo Bob! There is no big difference between a strlen an
=>> d
=>> =>> a strcmp.
=>> =>
=>> =>Actually, there usually is.  Most C compilers (possibly even the pre-
=>> =>processor) evaluate strlen of a constant string at compile time.


**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************

Reply via email to