Re: extern (c++) std::function?

2014-08-16 Thread Etienne via Digitalmars-d-learn
On 2014-08-15 6:12 AM, Rémy Mouëza wrote: assignments of anonymous/inline ones. You may want to add a layer of abstraction to the API you expose in D so that user D delegates are used from a second extern (C) delegate itself used by the C++ wrapper: Thanks for the detailed answer, this is the

Re: extern (c++) std::function?

2014-08-15 Thread FreeSlave via Digitalmars-d-learn
On Friday, 15 August 2014 at 03:10:43 UTC, Etienne Cimon wrote: I'm looking into making a binding for the C++ API called Botan, and the constructors in it take a std::function. I'm wondering if there's a D equivalent for this binding to work out, or if I have to make a C++ wrapper as well?

Re: extern (c++) std::function?

2014-08-15 Thread Rémy Mouëza via Digitalmars-d-learn
You'll certainly have to make a C++ wrapper. However, a delegate being implemented as a struct containing a context pointer and a function, you can get some degree of interoperability between C++ and D (BUT note that it is an undocumented implementation detail subject to change without notice

extern (c++) std::function?

2014-08-14 Thread Etienne Cimon via Digitalmars-d-learn
I'm looking into making a binding for the C++ API called Botan, and the constructors in it take a std::function. I'm wondering if there's a D equivalent for this binding to work out, or if I have to make a C++ wrapper as well?