> However, there is a deficiency with the KIND mechanism. There is no way of
> even at compile time to inquire on the number of available precisions. If
> there were and a macro expander was available such as ccp, it would be
> possible to generate generic code for each available precision. At least I
> think it would. WG5 might like to think about this!
Ahh, we're back to templates! My favourite! Because Fortran (90) is so
often used for libraries a type of generic procedure definition is
sorely missed. Then the compiler could fill in at compile time what is
needed. Or if the library is pre-compiled one should have an 'expand to
all precisions on this machine' flag for the compiler that churns the
template through all possible incarnations. [I'm sure this is more
complicated than it sounds here: one should probably not allow the
mixing of precisions in template procedures..]
I either have a precision qualifier in a header file -- which means I
have to recompile everything when I want to change the precision -- or I
duplicate procedures with different precisions and have a generic
interface. The second avoids recompilation, but is error-prone and
irritating and should not be necessary in this day and age.
Adriaan
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|