[Insight-developers] itkGetConstMacro versus itkGetConstReferenceMacro

Lorensen, William E (Research) lorensen at crd.ge.com
Thu Nov 4 07:41:48 EST 2004


Jim and I found a nasty bug yesterday that was related to the use of
GetConstMacro. It's a long story, but the Get should have returned a
reference rather than a copy.

Last night, I replaced all GetConstMacro usage with GetConstReferenceMacro.
Everything compiled and all tests passed on Borland and VS7.

Can anyonoe think of a reason why this would be a bad move. Certainly,
performace should be slightly better with the reference macro since a new
version of the ivar need not be created.

If there are no objections, I'll check this in later today. I'm building
InsightApplications now.

Bill


More information about the Insight-developers mailing list