[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [pooma-dev] Request for Review
From: |
Julian C. Cummings |
Subject: |
RE: [pooma-dev] Request for Review |
Date: |
Thu, 26 Apr 2001 01:11:39 -0700 |
Hi
Scott,
I
actually had written those templated constructor definitions
the
way you suggest at first. I think that the "template
<>"
should
be there, indicating the specialization of the class
template. However, both the HP aCC compiler and
(more
importantly) the Intel VTune compiler get confused by
this.
This
looks like a case where not all compilers have caught
up
with the correct syntax. I think the best thing to do is
what
John
suggested: put the constructor definitions back inside
the
class definition. That seems to work for all compilers
except
aCC as far as I know, and there are a *lot* of other
problems with that compiler besides this one that are
stopping
it
from handling Pooma correctly.
Julian
C.
I was looking at the
changes that Julian made to Range, Interval, etc and, as reported by John,
they indeed don't compile under Metrowerks. However, it seems like they
shouldn't compile at all unless there is yet another corner case of C++.
Here's the deal:
We have a class, which is a full specialization of a
templated class:
template<class T> class
Interval;
template<>
class Interval<1>
{
...
template<class T1, class T2>
Interval(const T1
&m, const T2 &n);
};
The question is what does the
definition of the constructor look like outside the class body. Julian
had:
template<class T1, class
T2>
Interval<1>::Interval(const T1, &m, const T2 &n) { ...
}
Metrowerks complains of "Illegal function overloading" and I
originally just thought this was a bug, but on further thought, it looks like
the function should read:
template<>
template<class
T1, class T2>
Interval<1>::Interval(const T1, &m, const T2
&n) { ... }
This compiles with CodeWarrior and it makes sense to
me, but is this correct? If so, I'll check in the changes, which consist of
adding the template<> on the top of the 6 out of line ctors at the
bottom of Interval.h, Grid.h, and
Range.h.
Scott
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- RE: [pooma-dev] Request for Review,
Julian C. Cummings <=