[Insight-developers] Partial specialization example

Brad King brad.king@kitware.com
Fri, 26 Jan 2001 17:34:12 -0500 (EST)


  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

---1463811583-1490636170-980548452=:20114
Content-Type: TEXT/PLAIN; charset=US-ASCII

Hello, all:

During todays conference call, I was asked to prepare an example of
how to fake partial specialization in Visual C++.  The attached file gives
a simple example, with explanation.  We probably don't want to use this,
since it is pretty ugly, and the only way to clean it up has limitations
(see comments in file).

However, I have a good solution to the filter dispatching problem using a
similar approach.  I'll send another email with it attached shortly.

-Brad

---1463811583-1490636170-980548452=:20114
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="partialSpecialization.cxx"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.21.0101261734120.20114@darkstar.kitware.com>
Content-Description: 
Content-Disposition: attachment; filename="partialSpecialization.cxx"

Ly8gVGhpcyBpcyBhbiBleGFtcGxlIG9mIGhvdyB0byBmYWtlIHBhcnRpYWwg
c3BlY2lhbGl6YXRpb24gb3ZlciB0aGUgZmlyc3QNCi8vIHBhcmFtZXRlciBv
ZiBhIHRlbXBsYXRlIGNsYXNzLiAgV2Ugd2lsbCBjcmVhdGUgYSB0ZW1wbGF0
ZSBjbGFzcyAiRXhhbXBsZSINCi8vIHdpdGggdHdvIHBhcmFtZXRlcnMsIGFu
ZCBwYXJ0aWFsbHkgc3BlY2lhbGl6ZSBpdCBmb3IgImludCIgYXMgaXRzIGZp
cnN0DQovLyBwYXJhbWV0ZXIuDQoNCiNpbmNsdWRlIDxpb3N0cmVhbT4NCg0K
Ly8gRGVmaW5lIGEgaGVscGVyIGNsYXNzIHdoZXJlIHRoZSBpbXBsZW1lbnRh
dGlvbiBhY3R1YWxseSBnb2VzLg0KdGVtcGxhdGUgPHR5cGVuYW1lIEE+DQpz
dHJ1Y3QgRXhhbXBsZU91dGVyDQp7DQogIHRlbXBsYXRlIDx0eXBlb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