CTFE calling a template: Error: expression ... is not a valid template value argument

Simen Kjaeraas simen.kjaras at gmail.com
Thu Sep 20 14:31:24 PDT 2012


On Thu, 20 Sep 2012 23:22:36 +0200, Jens Mueller <jens.k.mueller at gmx.de>  
wrote:

> string foo(string f)
> {
>     if (f == "somestring")
>     {
>         return "got somestring";
>     }
>     return bar!(foo("somestring"));
> }
>
> template bar(string s)
> {
>     enum bar = s;
> }

> In line 7 I call the template bar. But I call with the string that is
> returned by the CTFE of foo("somestring") which should return "got
> somestring"

When's it gonna get around to doing that? In order to figure out the
return value of foo("somestring"), it will have to figure out the
return value of foo("somestring"), and to do that...


> I haven't found a bug on this.

That's because there is no bug.

-- 
Simen


More information about the Digitalmars-d mailing list