[Insight-developers] Explicit Instantiation Proposal

Miller, James V (GE, Research) millerjv at crd.ge.com
Thu Apr 27 08:57:11 EDT 2006


>> However, I am sure that after the first pass of putting in explicit instantiation,
>> there will be other instantiations that we'll want to add and some are going to
>> require new macros.  The simpler we can make the macro writing the more likely 
>> we'll survive the hit by the bus test.

> FYI, Julien was able to write a new macro and create instantiations with 
> no help from me and less documentation than is now available.  We don't 
> even live in the same state so it is unlikely a bus will kill both of us :)

Julien also wrote a C++ parser for fun to check coding style.  

I am not worried about the C++ gurus being able to walk the macros.  I am more 
worried about the rest of the developers.

While VXL has been using these techniques for eons, I have on more that one occasion
had to walk through the VXL macros to determine why some VXL developer's code would 
not link.  I am not a VXL developer (I used VXL for one project 4 years ago) but our 
VXL developers here who use VXL day in and day out brought the issues to me. My point
is that the people who use these macros day in and day have trouble understanding how
they work.

The proposed macros are more complicated than most the macros that ITK uses today
(Set/Get, NewMacro, ExceptionMacro, etc.).  

I want stress that I am in favor of explicit instantiation.  The improvements in build
time and disk usage will be significant.  Of these two, disk usage is my primary 
concern because I rarely have to build all of ITK.  Usually I am working in a small 
sandbox that builds against ITK and my sandbox always builds very quickly.  However,
I like to have several builds of ITK with different versions and different compilers.

I want the explicit instantiation mechansism to be something that we can support long
term and be a model that we can propagate to projects that build against ITK.

I do have one concern that may have been addressed when during the wrapping developements.
At one time, we had some classes where we could not instantiate the entire class (all methods) for 
every data type.  Some of the methods were appropriate for some data types and some methods
were appropriate for other data types.  Do we still have this issue in ITK?

Jim


More information about the Insight-developers mailing list