Re: Unexpected type conversion for arithmetic with cdata<double &>

  • From: Simon Cooke <sjcfwd@xxxxxxxxx>
  • To: "luajit@xxxxxxxxxxxxx" <luajit@xxxxxxxxxxxxx>
  • Date: Thu, 16 Oct 2014 15:20:24 -0400

This was a contrived example to create the reference type. My issue
involved an FFI function that indexed an element of an array stored
inside a C++ object and returned a reference to it. From the docs I
took "Reference types are dereferenced before a conversion can take
place" to mean that it would convert to double automatically when
used, but now I see that this doesn't apply here. I can modify the
return type of the function to return by value for scalar types.
Thanks for the clarification.

Simon

Other related posts: