Calypso: Direct and full interfacing to C++
Kagamin via Digitalmars-d-announce
digitalmars-d-announce at puremagic.com
Tue Dec 23 07:20:17 PST 2014
On Monday, 22 December 2014 at 23:14:44 UTC, Elie Morisse wrote:
> • Structs
> https://github.com/Syniurge/Calypso/blob/master/tests/calypso/showcase.d
> testClass cls = new testInherit;
This should be written
testClass* cls = new testInherit;
In C++ struct and class differ only in symbol mangling. They are
both value types, support inheritance, copy constructors etc. By
looking at the declaration you can't decide if a class should be
used as value type or reference type, so better treat it as value
type like in C++.
More information about the Digitalmars-d-announce
mailing list