C++: expected identifier before numeric constant

后端 未结 3 2028
花落未央
花落未央 2020-12-21 02:20

I\'m trying to write a small program using MTL, but I\'m getting the mentioned error when I try to make a MTL Matrix a member of a class.

#include 

        
3条回答
  •  不知归路
    2020-12-21 02:53

    You need to do that in the constructor's initialiser list.

    class myClass {
        mtl::dense2D Ke;
    public:
        myClass() : Ke(mtl::dense2D(6, 6)) { }
    };
    

提交回复
热议问题