From cdd0b4fb7d48b32686d56364cf170569bdb0149d Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Fri, 15 Apr 2022 19:44:07 -0400 Subject: Use = default and = delete where possible in classes --- README-maintainer | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'README-maintainer') diff --git a/README-maintainer b/README-maintainer index 52c10810..f4c54324 100644 --- a/README-maintainer +++ b/README-maintainer @@ -165,6 +165,18 @@ CODING RULES or QPDFDocumentHelper subclasses since there's no reason to use dynamic_cast with those. + IMPORTANT NOTE ABOUT QPDF_DLL_CLASS: On mingw, the vtable for a + class with some virtual methods and no pure virtual methods seems + often (always?) not to be generated if the destructor is inline or + declared with `= default`. Therefore, for any class that is intended + to be used as a base class and doesn't contain any pure virtual + methods, you must declare the destructor in the header without + `= default` and provide a non-inline implementation in the source + file. Add this comment to the implementation: + + // Must be explicit and not inline -- see QPDF_DLL_CLASS in + // README-maintainer + * Put private member variables in std::shared_ptr for all public classes. Remember to use QPDF_DLL on ~Members(). Exception: indirection through std::shared_ptr is expensive, so don't -- cgit v1.2.3-70-g09d2