Problem mit constexpr


  • Mod

    constexpr unsigned foo[] = { 0, foo[0] };
    int main() {}
    

    gcc sagt dazu:

    test.cpp:1:40: error: the value of ‘foo’ is not usable in a constant expression
    test.cpp:1:20: note: ‘foo’ used in its own initializer

    hat er recht?


Anmelden zum Antworten