草庐IT

stdarray

全部标签

c++ - 使用 std::array 并使用 "array"作为名称

在我的C++JSON库中,我最近有一个regressionwithGCC7.我剥离了受影响的代码并希望了解错误。代码考虑一下这个标题myclass.hpp:#pragmaoncetemplatestructA{structvalue_t{Xarray;};staticAarray(){returnA();}friendbooloperator如您所见,我在结构value_t中使用名称“数组”作为成员变量名称,作为静态函数的名称。然后我将标题包含在以下文件中:#includeusingstd::array;//notethis!#include"myclass.hpp"intmain()