Compile-time constness is waaay to strict!

asd asd at none.invalid
Sat Jul 25 13:09:56 PDT 2009


KennyTM~ Wrote:

> It makes sense. A compile-time function must be executable in run time 
> as well. Which means both of the following must be meaningful.
> 
> void main () {
>    auto s = readln();
>    if (isEmptyString(s)) { ... } // Run time executed
> }
> 
> void main2 () {
>    static if (isEmptyString("")) { ... } // Compile time executed
> }
> 
> If you use static if in isEmptyString, the run time counterpart is 
> meaningless.

Ah, now I see it. Thanks!



More information about the Digitalmars-d mailing list