lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] Where to implement this dtor? [Was: Group premium quotes]


From: Greg Chicares
Subject: [lmi] Where to implement this dtor? [Was: Group premium quotes]
Date: Tue, 18 Aug 2015 17:30:23 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0

[I'm keeping this running commentary in a single thread (whose
continuing theme is...

On 2015-08-16 17:07, Greg Chicares wrote:
> First of all, don't read this before September, especially not if you're
> on vacation.

...) but setting specific "Subject:" headers]

In 'group_premium_pdf_gen.hpp', this class's constructor is implemented inline:

  class LMI_SO group_premium_pdf_generator
...
  {
    public:
...
      virtual ~group_premium_pdf_generator();
...
    protected:
      group_premium_pdf_generator() {}
  };

but its destructor is in 'group_premium_pdf_gen.cpp':

  group_premium_pdf_generator::~group_premium_pdf_generator() {}

Is there any objection to implementing the dtor inline as follows?

-      virtual ~group_premium_pdf_generator();
+      virtual ~group_premium_pdf_generator() {}

Or would it be even better to write the ctor out of line near the dtor, in
'group_premium_pdf_gen.cpp'? AFAICT, objects of a type derived from this
abstract base class are created only in 'group_premium_pdf_gen_wx.cpp',
which necessarily depends on 'liblmi', so it just seems tidiest to have
both implementations there.

I'm sure either way is valid C++14, because they both compile and link
with g++-3.4.5 .




reply via email to

[Prev in Thread] Current Thread [Next in Thread]