wg21.cmeerw.net

The requirement in 7.7 [expr.const] that a constant expression cannot contain

  • an array-to-pointer conversion (7.3.3 [conv.array]) that is applied to a glvalue that does not designate an object with static storage duration

effectively eliminates the use of automatic constexpr arrays such as

    void f() {
       constexpr int ar[] = { 1, 2 };
       constexpr int i = ar[1];
    }

There does not seem to be a problem with this kind of usage.

History Date User Action Args 2014-03-03 00:00:00adminsetstatus: fdis -> c++11 2011-04-10 00:00:00adminsetmessages: + msg3320 2011-04-10 00:00:00adminsetstatus: tentatively ready -> fdis 2011-02-28 00:00:00adminsetstatus: review -> tentatively ready 2010-11-29 00:00:00adminsetmessages: + msg3080 2010-11-29 00:00:00adminsetstatus: open -> review 2010-09-08 00:00:00admincreate

Read the original on wg21.cmeerw.net ↗