[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] Define special member functions inline?
From: |
Vadim Zeitlin |
Subject: |
Re: [lmi] Define special member functions inline? |
Date: |
Mon, 6 Mar 2017 15:59:20 +0100 |
On Mon, 6 Mar 2017 12:30:35 +0000 Greg Chicares <address@hidden> wrote:
GC> On 2017-03-06 10:41, Greg Chicares wrote:
GC> >
GC> > Okay, then our guideline so far is
GC> > Write explicitly-defaulted special member functions inline, in the
GC> > class definition.
GC> > with the rationale that
GC> > This makes the code clearer, and lets the compiler optimize better.
GC> > [plain text because I don't know '.md']
GC>
GC> Exceptions: Sometimes it is not possible to define a destructor inside
GC> the class definition, because, e.g.:
GC> * it is pure virtual and cannot be defined at the point of declaration
GC> * the class has smart-pointer members of forward-declared types
GC> In such cases, define the destructor out of line in the '.cpp' file.
FYI: I've added this to my local style file, please see
https://gist.github.com/vadz/3222ef957769f3a9415caa799113d640
for the (few) rules I have so far.
VZ