标题:qt5.11constexpr问题
作者:hfutzhu
日期:2020-05-17 14:15
内容:
我的编译环境是qt5.11minw32位
有一个函数 constexpr bool active() const noexcept { return m_flag; }
编译报error: enclosing class of constexpr non-static member function 'bool Form::active() const' is not a literal type
constexpr bool active() const noexcept { return m_flag; }
这个是什么意思?
#1 [青空飞羽 05-18 17:38]
.如果m_flag在编译时能确定,那么返回值就可以是constexpr,编译通过,否正编译失败