当我尝试编译我的 C++ 项目时,我收到错误消息Call to implicitly-deleted default constructor of 'std::array' 。
头文件cubic_patch.hpp
#include <array>
class Point3D{
public:
Point3D(float, float, float);
private:
float x,y,z;
};
class CubicPatch{
public:
CubicPatch(std::array<Point3D, 16>);
std::array<CubicPatch*, 2> LeftRightSplit(float, float);
std::array<Point3D, 16> cp;
CubicPatch *up, *right, *down, *left;
};
源文件cubic_patch.cpp
#include "cubic_patch.hpp"
Point3D::Point3D(float x, float y, float z){
x = x;
y = y;
z = z;
}
CubicPatch::CubicPatch(std::array<Point3D, 16> CP){// **Call to implicitly-deleted default constructor of 'std::arraw<Point3D, 16>'**
cp = CP;
}
std::array<CubicPatch*, 2> CubicPatch::LeftRightSplit(float tLeft, float tRight){
std::array<CubicPatch*, 2> newpatch;
/* No code for now. */
return newpatch;
}
有人可以告诉我这里有什么问题吗?我发现了类似的主题,但并不完全相同,而且我不理解给出的解释。
谢谢。