@@ -290,8 +290,19 @@ $(H2 $(LNAME2 classes, Classes))
290
290
291
291
$(P D structs and classes have different semantics whereas C++ structs and
292
292
classes are basically the same. The use of a D struct or class depends on
293
- the C++ implementation and not on the used C++ keyword.
294
- When mapping a D $(CODE class) onto a C++ $(CODE struct),
293
+ the C++ implementation and not on the used C++ keyword.)
294
+
295
+ $(UL
296
+ $(LI If the C++ implementation has one or more $(CODE virtual) member
297
+ functions (including inherited member functions), it should be declared as
298
+ an $(CODE extern(C++) class) in D.)
299
+
300
+ $(LI If the C++ implementation does not have any $(CODE virtual) member
301
+ functions (including inherited member functions), it should be declared as
302
+ an $(CODE extern(C++) struct) in D.)
303
+ )
304
+
305
+ $(P When mapping a D $(CODE class) onto a C++ $(CODE struct),
295
306
use $(CODE extern(C++, struct)) to avoid linking problems with C++ compilers
296
307
(notably MSVC) that distinguish between C++'s $(CODE class) and $(CODE struct)
297
308
when mangling. Conversely, use $(CODE extern(C++, class)) to map a D
@@ -811,12 +822,12 @@ $(H2 $(LNAME2 data-type-compatibility, Data Type Compatibility))
811
822
812
823
$(TROW
813
824
$(ARGS $(CODE extern (C++)) $(B struct)),
814
- $(ARGS $(B struct) or $(B class))
825
+ $(ARGS $(B struct) or $(B class) without virtual member functions )
815
826
)
816
827
817
828
$(TROW
818
829
$(ARGS $(CODE extern (C++)) $(B class)),
819
- $(ARGS $(B struct) or $(B class))
830
+ $(ARGS $(B struct) or $(B class) with virtual member functions )
820
831
)
821
832
822
833
$(TROW
0 commit comments