[Insight-developers] STYLE: Un-necessary use of static_cast -- should we care?

Williams, Norman K norman-k-williams at uiowa.edu
Mon Jul 23 17:27:27 EDT 2012


The problem with ITK in this context is that SetInput is overloaded.
There may be two different ways to set an input, and one may be picky, and
another more permissive.  The compiler will only sometimes be able to
determine what exactly the real pointer type is.  And even then I suspect
most compilers do not optimize away dynamic_cast.


On 7/23/12 4:16 PM, "Johnson, Hans J" <hans-johnson at uiowa.edu> wrote:

>I like the idea of using a debug-only assertion if the pointer is NULL.  I
>don't think that this should be a performance problem, and It is my belief
>(no proof) that the compiler will minimize the work needed when it can
>deterministically identify what the real pointer types are.



________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
________________________________


More information about the Insight-developers mailing list