[Development] Proposal: adding Q_DECL_NOEXCEPT to many methods

Marc Mutz marc.mutz at kdab.com
Thu Aug 2 16:02:43 CEST 2012


Hi Thiago,

On Thursday August 2 2012, Thiago Macieira wrote:
> I'd like to propose we add Q_DECL_NOEXCEPT to many methods in our API.

+1 from me, too.

[Though it doesn't seem to help with the problem that move constructors can't 
be inline if the class uses smart pointers. It still wants to call the dtor 
of the smart pointer. Might be just GCC not correctly implementing it, though 
("code language only" - whatever that means).]

Need to be careful with templates. Can't use add the unrestricted noexcept 
there, need to use noexcept(noexcept(expr)), which is even uglier :)

Re: ugliness: I expect people will become familiar with this sooner than 
later. The C++11 std library is _full_ of noexcept tags.

Thanks,
Marc

-- 
Marc Mutz <marc.mutz at kdab.com> | Senior Software Engineer
KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
www.kdab.com || Germany +49-30-521325470 || Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-Independent Software Solutions



More information about the Development mailing list