I tried searching everywhere, but because it is such a perplexing question, I wasn't able to find what I was looking for. I am trying to create function/method but I don't know how to specify its return type, which should be:
double(*)[3]
I want to be able to use a query like this one:
double R[3][3];
query ( &output, R );
but instead of R[3][3]
, I have a vector std::vector<double> R_vect (9);
and I do this:
query ( &output, reinterpret_cast<double(*)[3]> (R_vect.data()) );
which is a mess, so I wanted to implement a function to make it readable, say:
ReturnType Cast ( const std::vector<double>& R_vect ) {
return reinterpret_cast<double(*)[3]> (R_vect.data());
}
but I can't specify the return type. I used typedef, and it works:
typedef double DesiredCast[3];
DesiredCast* Cast ( ... ) { ... }
but I am still curious how to do it without typedefs.