www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Interfacing D with C++ functions that take reference values

reply solidstate1991 <laszloszeremi outlook.com> writes:
I need some C++ stuff, but some of the functions take reference 
values (Stuff&), and I don't know if this feature is emulated on 
D side with extern(C++) functions. While I don't have to worry 
about it with functions that are defined in the header, other 
ones and classes are a different matter.
Oct 03 2018
parent kinke <noone nowhere.com> writes:
On Wednesday, 3 October 2018 at 23:05:10 UTC, solidstate1991 
wrote:
 I need some C++ stuff, but some of the functions take reference 
 values (Stuff&), and I don't know if this feature is emulated 
 on D side with extern(C++) functions.
Of course; you're restricted to D value types though (D class references are C++-mangled as pointers): struct Stuff { ... } void foo(ref Struct param);
Oct 03 2018