April 15, 2010 D2.0 and C++ classes supported linking? | ||||
---|---|---|---|---|
| ||||
Is there anyway to access a c++ defined class with D, or must all member function calls be called from within the c++ code in order to have information brought up. Or is there a way to create a object of type myCPPlusClass that will allow for more direct access to the member functions of the class? If it is possible some example code of a working basic C++ class and it's calling corresponding D code. would be appreciated, I am trying to see if I am trying to find a way to reuse some of my old C++ classes to test out the linking in D2.0 For example if i wanted to have D do the interface, and C++ libraries handle the back end math functions. |
May 15, 2010 Re: D2.0 and C++ classes supported linking? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Doug | Doug wrote:
> Is there anyway to access a c++ defined class with D, or must all member
> function calls be called from within the c++ code in order to have information
> brought up. Or is there a way to create a object of type myCPPlusClass that
> will allow for more direct access to the member functions of the class? If it
> is possible some example code of a working basic C++ class and it's calling
> corresponding D code. would be appreciated, I am trying to see if I am trying
> to find a way to reuse some of my old C++ classes to test out the linking in D2.0
>
> For example if i wanted to have D do the interface, and C++ libraries handle
> the back end math functions.
D can access C++ classes as long as those classes are single inheritance. Just mark them in the D declaration with extern (C++).
|
Copyright © 1999-2021 by the D Language Foundation