Re: Copying Bitmap
On Thu, 07 Jun 2007 09:23:41 GMT, MrAsm <mrasm@usa.com> wrote:
On Wed, 06 Jun 2007 23:15:58 -0500, "Doug Harrison [MVP]"
<dsh@mvps.org> wrote:
link to the Boost smart pointer page:
http://www.boost.org/libs/smart_ptr/smart_ptr.htm
I was reading scoped_ptr source code here (starting from your link):
http://www.boost.org/boost/scoped_ptr.hpp
The source is full of comments
"// never throws"
May I ask why the Boost authors prefer the comment to the exception
specification "throw ()" ?
Exception-specification rationale
http://www.boost.org/more/lib_guide.htm#Exception-specification
Exception Safety and Exception Specifications: Are They Worth It?
http://www.gotw.ca/gotw/082.htm
The "throw ()" exception specification could be useful to the
compiler, because it tells the compiler "never throws", but the
comments are only useful to human beings but are discarded by the
compiler...
VC++ doesn't implement throw() per the standard anyway, and it's better to
use the non-standard extension __declspec(nothrow). For more, see:
http://msdn2.microsoft.com/en-us/library/wfa0edys(VS.80).aspx
--
Doug Harrison
Visual C++ MVP