Yao G. <nospamyaolt...@gmail.com> wrote:

Hello.

Greetings.

foo( "Hello World", first, second );
---

You can notice that the first argument is a string literal. What I want to know is: If a function argument is declared as a string literal, it can be accessed at compile time? And if the answer is yes, how can I do it?.

Afraid not. What you posted later is the only way to do this. This has
been discussed several times in the past, and some suggestions have
popped up, including static function parameters:

void foo( static string s ) {
  // s is a compile time constant
}

This has however not been implemented.

--
Simen

Reply via email to