Dr. Julian C. Cummings Office:
PB-111
Caltech/CACR, MC 158-79 Phone: 626-395-2543
1200
E. California Blvd. Fax: 626-584-5917
Pasadena, CA
91125
-----Original Message-----
From: blitz-support-bounces@oonumerics.org [mailto:blitz-support-bounces@oonumerics.org] On Behalf Of James Evans
Sent: Thursday, October 14, 2004 9:39 AM
To: blitz-support@oonumerics.org
Subject: [Blitz-support] Template SpecializationIs it planned for Blitz to switch over to use proper template specialization instead of many overloaded methods with run-time checking?There are issues that arise from not using specialization, for example:If someone were to write a class like the following:class Matrix: public blitz::Array<double, 2> {...}the compiler is allowed to completely generate code for all methods of a 'blitz::Array<double, 2>' The problem arrises in functions such as 'resizeAndPreserve' where you say something like the following in the implementation:T_array B(base(), BZ_BLITZ_SCOPE(shape)(length0, length1, length2), storage_);
base() will return a TinyVector<int, 2>;shape(...) will return a TinyVector<int, 3>;this generates an invalid function prototype and fails even though this code will never get called. It is acceptable for the compiler to generate the necessary code however.I realize that specializing 11 different classes can be repetetive and disgusting for maintenance, but in the long run it may be the best option.--James EvansPS: If you haven't looked at gcc-3.4x yet, it is much more stricter when it comes to standards compliance (especially in the are of templates). I havn't compiled blitz with it yet, but have other projects and have a feeling other things will break.