Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/135.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ VS2013中静态constexpr阵列出现错误C2864(CTP_Nov2013)_C++_Arrays_C++11_Visual Studio 2013_Constexpr - Fatal编程技术网

C++ VS2013中静态constexpr阵列出现错误C2864(CTP_Nov2013)

C++ VS2013中静态constexpr阵列出现错误C2864(CTP_Nov2013),c++,arrays,c++11,visual-studio-2013,constexpr,C++,Arrays,C++11,Visual Studio 2013,Constexpr,以下是标题中的代码: struct FormContainer{ enum Forms{ Stuff, FormCount}; enum MoreForms{ MoreStuff = FormCount, MoreFormCount}; static std::array<UInt32, MoreFormCount> Forms; static constexpr UInt32 FormArrayCount = 2; static const

以下是标题中的代码:

struct FormContainer{
    enum Forms{ Stuff, FormCount};
    enum MoreForms{ MoreStuff = FormCount, MoreFormCount};
    static std::array<UInt32, MoreFormCount> Forms;

    static constexpr UInt32 FormArrayCount = 2;
    static constexpr char* FormArrayNames[FormArrayCount] { "AnArray", "2ndArray" };
    static constexpr UInt32 FormArrayEndingIndex[FormArrayCount] { FormCount, MoreFormCount };
};
struct FormContainer{
枚举表单{Stuff,FormCount};
枚举MoreForms{MoreStuff=FormCount,MoreFormCount};
静态std::数组形式;
静态constexpr UInt32 formaraycount=2;
静态constexpr char*FormArrayNames[FormArrayCount]{“AnArray”,“2ndArray”};
静态constexpr UInt32 FormArrayEndingIndex[FormArrayCount]{FormCount,MoreFormCount};
};
为什么会出现以下错误:

错误C2864:“Common::FormContainer::FormArrayEndingIndex”:具有类内初始值设定项的静态数据成员必须具有非易失性常量整数类型


对于最后两行(数组初始化)?

ctp没有完整的constexpr支持,这可能就是原因。你应该在Microsoft Connect上填写错误报告。找到它。。。CTP支持C++11 constexpr,成员函数除外。(另一个限制是不支持数组。)此外,它不支持C++14的扩展constexpr规则