草庐IT

MatrixConstructor

全部标签

c++ - 为什么 GCC 生成的代码会从堆栈中读取垃圾?

考虑以下代码(使用Eigen):#include#includetemplateinlinetypenamestd::enable_if::typesetRow(Eigen::Matrix&){}templateinlinetypenamestd::enable_if::typesetRow(Eigen::Matrix&m,Rvval,Rs...args){m(row,N)=val;setRow(m,args...);}templateclassMatrixConstructor{Eigen::Matrixm;public:MatrixConstructor(constEigen::M