1
class M33
{
public:
double m[3][3];
double (*GetM())[3] {
return m;
}
};
// call to JPL cspice f2c generated routine
// void mxm_c (const double m1 [3][3],
// const double m2 [3][3],
// double mout[3][3])
void test()
{
M33 m1;
M33 m2;
M33 mOut;
mxm_c(m1.m, m2.m, mOut.m); // this works
mxm_c(m1.GetM(), m2.GetM(), mOut.GetM()); // this works
}
VS2013を使用しています。 質問:それは、それによって、このコーディングスタイルのショートカットを可能な...オペレータオーバーロードをキャストして、外部ライブラリにアクセスするための2次元配列を返します。
operator double*[3]() // this does not compile
{
return m;
}
としてキャスト演算子を使用することは可能ですか?
mxm_c(m1, m2, mOut); // this does not work