[Insight-developers] Removing typeids, removing block-copied code, UseVectorBasedHistogram

Luis Ibanez luis.ibanez at kitware.com
Sat Nov 6 15:44:08 EDT 2010


On Fri, Nov 5, 2010 at 10:34 AM, kent williams
<norman-k-williams at uiowa.edu>wrote:

> It also occured to me that I don't need no stinking templates -- that
> function can be replaced with
>
> const bool UseVectorBasedHistogram(sizeof(InputPixelType) <= 2);
>
>
Hi Kent,

This option above may not be safe enough, since users can
use any type as pixel type. That is, the InputPixelType may
not only be one of the basic types (char, short, int ....), but
can also be a customized class.

For example, InputPixelType could be:

foo {
char a,
char b,
};

so, a sizeof(foo) = 2

may not be specific enough.


     Luis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20101106/65d590e0/attachment.htm>


More information about the Insight-developers mailing list