Casting double array to a struct of doubles

前端 未结 6 1759
醉梦人生
醉梦人生 2020-11-30 14:54

Is it OK to cast a double array to a struct made of doubles?

struct A
{
   double x;
   double y;
   double z;
};

int main (int argc , char ** argv)
{
   do         


        
6条回答
  •  广开言路
    2020-11-30 15:50

    std::complex implementation of msvc use the array solution, and llvm libc++ use the former form.

    I think, just check the implementation of the std::complex of your libc++, and use the same solution with it.

提交回复
热议问题