[fpc-pascal] CPPClass Documentation?

Sven Barth pascaldragon at googlemail.com
Sat Jan 18 15:22:21 CET 2014


On 18.01.2014 13:45, Ewald wrote:
> Hi,
>
> This morning, I saw on fpc-devel a message titled `CPPClass`, which made
> me wonder if this keyword means what its name implies. Sadly though,
> there is not much documentation on this subject (read: none I could find
> other than some messages in the mailing list archive).
>
> Is there anyone who could shed some light on this? (Links to
> documentation I missed will do :-) )

It's a experimental feature in its infancy. Some years old already and a 
few years ago "a bit" improved by me. So currently you can import C++ 
classes (generated by GCC or CLang!) that either have static methods or 
non virtual ones and call them. What currently does not work is 
instantiation and destruction of such classes, using virtual methods, 
operator overloads and C++ exceptions. I still plan to improve this 
feature further, but with all one needs to find time...

For its usage you can take a look at $fpc/tests/test/cg/tcppcl{1,2}.pas 
with the corresponding C++ files residing inside the obj/ subdirectory 
of cg/.

Regards,
Sven




More information about the fpc-pascal mailing list