Re: extern (c) struct ?

2018-03-08 Thread Robert M. Münch via Digitalmars-d-learn
On 2018-03-08 16:03:57 +, Adam D. Ruppe said: How are you accessing it? If it is by pointer only passing it to methods, you can simply: struct my_cpp_struct; and define functions: extern(C) void foo(my_cpp_struct* arg); Hi, :-/ seems I was a bit confused by all the backs and forth on

Re: extern (c) struct ?

2018-03-08 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 8 March 2018 at 15:51:53 UTC, Robert M. Münch wrote: I have a pretty complex struct with C++ typed private members etc. in it which I want to use from D. How are you accessing it? If it is by pointer only passing it to methods, you can simply: struct my_cpp_struct; and define

extern (c) struct ?

2018-03-08 Thread Robert M. Münch via Digitalmars-d-learn
I have a pretty complex struct with C++ typed private members etc. in it which I want to use from D. Obviously I don't want to/can't rebuild the struct definiton in D and I don't need access to all the members just some simple C API ones are enough. How can I get access to this struct from

Re: extern(C++) struct - what is it?

2016-12-16 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Friday, 16 December 2016 at 13:02:11 UTC, Nicholas Wilson wrote: On Friday, 16 December 2016 at 12:40:19 UTC, Ilya Yaroshenko wrote: [...] Like any other struct. [...] Thank you Nicholas

Re: extern(C++) struct - what is it?

2016-12-16 Thread Nicholas Wilson via Digitalmars-d-learn
On Friday, 16 December 2016 at 12:40:19 UTC, Ilya Yaroshenko wrote: It was in DMD sources. How it can be used? Are methods virtual? How multiple inheritance works? Can this be used in betterC mode? What different between classes in C++? Thanks, Ilya See also

Re: extern(C++) struct - what is it?

2016-12-16 Thread Nicholas Wilson via Digitalmars-d-learn
On Friday, 16 December 2016 at 12:40:19 UTC, Ilya Yaroshenko wrote: It was in DMD sources. How it can be used? Like any other struct. Are methods virtual? No. How multiple inheritance works? Don't think it works. Can this be used in betterC mode? Yes all it should affect is the

extern(C++) struct - what is it?

2016-12-16 Thread Ilya Yaroshenko via Digitalmars-d-learn
It was in DMD sources. How it can be used? Are methods virtual? How multiple inheritance works? Can this be used in betterC mode? What different between classes in C++? Thanks, Ilya