This is the mail archive of the
mailing list for the GCC project.
Re: [Patch] Implementation of n3793 <experimental/optional>
- From: Luc Danton <lucdanton at free dot fr>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>, Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 02 Nov 2013 23:18:08 +0100
- Subject: Re: [Patch] Implementation of n3793 <experimental/optional>
- Authentication-results: sourceware.org; auth=none
- References: <5260CFE7 dot 7000808 at free dot fr> <CAH6eHdTs43dT6yY=tfL9mfWHKAR3yZ-2j02Scs8FW4zUE=L6=w at mail dot gmail dot com> <52729DF5 dot 6020806 at free dot fr> <CAH6eHdQ9bwMD0Awh9bivCTb83na8i1od6pyqRMULmY48a2-x-A at mail dot gmail dot com> <4589CEDD-15F5-4E9F-9975-196EF10EEA20 at oracle dot com> <52753C68 dot 4050708 at free dot fr> <d15f0e1a-b8c7-4760-a93d-03d026bfe65d at email dot android dot com>
On 2013-11-02 19:02, Paolo Carlini wrote:
Can you expand? I think it's just as much inline as the other overload
-- does it need to be different?
The other overload is constexpr thus it's implicitly inline. The fall back is very simple too and I think it should be declared inline, unless you analyzed the assembly and believe it normally boils down to more than, say, 5 instructions.
I see. It didn't occur to me to declare it inline, as I only ever use
the keyword to satisfy
ODR requirements. E.g. the non-member swap isn't declared inline either.
For future reference, is there a rule of thumb in use?