[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] Define special member functions inline?
From: |
Greg Chicares |
Subject: |
Re: [lmi] Define special member functions inline? |
Date: |
Mon, 6 Mar 2017 12:30:35 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0 |
On 2017-03-06 10:41, Greg Chicares wrote:
>
> Okay, then our guideline so far is
> Write explicitly-defaulted special member functions inline, in the
> class definition.
> with the rationale that
> This makes the code clearer, and lets the compiler optimize better.
> [plain text because I don't know '.md']
Exceptions: Sometimes it is not possible to define a destructor inside
the class definition, because, e.g.:
* it is pure virtual and cannot be defined at the point of declaration
* the class has smart-pointer members of forward-declared types
In such cases, define the destructor out of line in the '.cpp' file.
[cf. commit b05b68201a064b22cec6ec159e7372337a5fa1f8]