[Insight-users] itkGetMacro vs. itkGetConstMacro
HIRAKI Hideaki
hhiraki at lab.nig.ac.jp
Thu, 19 Feb 2004 23:56:48 +0900
Hello,
In many classes, itkGetMacro is used to provide access to their data
members and prohibits 'Get' a data member of a 'const' object. I could
workaround the problem by const_cast (and there are some classes that
use itkGetConstMacro to allow this kind of operation). But it seems to
be easier and safe to change the definition of itkGetMacro as
itkGetConstMacro. Why the two macro need to be differentiated? Is
there a case itkGetMacro returns a lawbreaker such as a pointer?
Thanks,
Hideaki Hiraki