[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] Where to implement this dtor? [Was: Group premium quotes]
From: |
Greg Chicares |
Subject: |
Re: [lmi] Where to implement this dtor? [Was: Group premium quotes] |
Date: |
Wed, 26 Aug 2015 12:49:21 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0 |
On 2015-08-18 21:38, Vadim Zeitlin wrote:
> On Tue, 18 Aug 2015 17:30:23 +0000 Greg Chicares <address@hidden> wrote:
>
> GC> In 'group_premium_pdf_gen.hpp', this class's constructor is implemented
> GC> inline:
[...]
> GC> but its destructor is in 'group_premium_pdf_gen.cpp':
[...]
> GC> Or would it be even better to write the ctor out of line near the dtor, in
> GC> 'group_premium_pdf_gen.cpp'?
>
> In practice this wouldn't matter from performance point of view, so it's
> basically a question of taste. I'd probably make both the ctor and the dtor
> inline because they seem to be very unlikely to change without other, more
> significant changes to this class which would result in recompilation of
> all of its clients anyhow, so there doesn't seem to be any disadvantage in
> making them inline.
>
> GC> AFAICT, objects of a type derived from this
> GC> abstract base class are created only in 'group_premium_pdf_gen_wx.cpp',
> GC> which necessarily depends on 'liblmi', so it just seems tidiest to have
> GC> both implementations there.
>
> Assuming by "there" you mean in liblmi (still in
Yes, that's what I meant.
> group_premium_pdf_gen.cpp), and not in group_premium_pdf_gen_wx.cpp as I
> had initially understood the above (and spent some time writing that this
> couldn't work before realizing that this must have been obvious to you as
> well and so I must have misunderstood you...), I don't see any problems
> with this but, again, I don't see any problems with making both ctor and
> dtor inline neither.
I chose to implement both ctor and dtor in 'group_premium_pdf_gen.cpp'
(committed 20150826T1233Z, revision 6262). This way, they're both
certainly in 'group_premium_pdf_gen.o' and nowhere else. As you point
out, there's little to choose between this way and writing both inline
in this case.
- Re: [lmi] Group premium quotes, Greg Chicares, 2015/08/12
- [lmi] Group premium quotes, Greg Chicares, 2015/08/16
- [lmi] Number of "eligibles" [Was: Group premium quotes], Greg Chicares, 2015/08/18
- Re: [lmi] Number of "eligibles" [Was: Group premium quotes], Vadim Zeitlin, 2015/08/18
- Re: [lmi] Number of "eligibles" [Was: Group premium quotes], Greg Chicares, 2015/08/26
- Re: [lmi] Number of "eligibles" [Was: Group premium quotes], Vadim Zeitlin, 2015/08/26
- Re: [lmi] Number of "eligibles" [Was: Group premium quotes], Greg Chicares, 2015/08/26
- Re: [lmi] Number of "eligibles" [Was: Group premium quotes], Vadim Zeitlin, 2015/08/27
- Re: [lmi] Number of "eligibles" [Was: Group premium quotes], Greg Chicares, 2015/08/28
[lmi] Vanishing menu underlines [Was: Group premium quotes], Greg Chicares, 2015/08/18