constexpr not working if the function is declared inside class scope

后端 未结 3 2057
谎友^
谎友^ 2020-11-30 11:15

I am using g++4.8.0, which doesn\'t contain earlier constexpr bug. Thus below code works fine:

constexpr int size() { return 5; }
int array[size         


        
3条回答
  •  眼角桃花
    2020-11-30 11:37

    Apparently it's not even a bug, because its status is RESOLVED INVALID, which means that the people behind GCC and that bugzilla, after reviewing the problem, don't think that this is a GCC bug.

    I remind you on that page because there is also an answer for this behaviour in one of the related posts.

提交回复
热议问题