How to call a extern C++ class constructor ?

Luhrel lucien.perregaux at gmail.com
Sat Feb 1 08:38:22 UTC 2020


On Saturday, 1 February 2020 at 08:32:51 UTC, Ferhat Kurtulmuş 
wrote:
> On Saturday, 1 February 2020 at 08:27:07 UTC, Luhrel wrote:
>> On Saturday, 1 February 2020 at 08:21:29 UTC, Ferhat Kurtulmuş 
>> wrote:
>>>
>>> You cannot. 
>>> https://dlang.org/spec/cpp_interface.html#using_cpp_classes_from_d
>>>
>>> You must use a factory method like createInstance.
>>
>> Oh I see, so there's definitively no way to call a c++ ctor 
>> without modifying the c++ code ?
>
> İf you are not allowed to modify that c++ code, you can write a 
> createInstance function in your custom cpp file.

That was my fear.


More information about the Digitalmars-d-learn mailing list