type/value mismatch error in template
type/value mismatch error in template
- Subject: type/value mismatch error in template
- From: John Weeks <email@hidden>
- Date: Wed, 12 Oct 2005 08:57:46 -0700
I posted this a couple days ago, and it looks like it didn't get noticed.
Sorry to re-post, but it's got me stumped and stopped.
Xcode 2.1 gives the following errors:
error: expected `;' before 'iter'
error: type/value mismatch at argument 1 in template parameter list for
'template<class _T1, class _T2> struct std::pair'
error: expected a type, got
'std::vector<VectorT,std::allocator<_CharT> >::iterator'
type/value mismatch at argument 2 in template parameter list for
'template<class _T1, class _T2> struct std::pair'
expected a type, got 'std::vector<VectorT,std::allocator<_CharT> >::iterator'
in compiling this code (error lines marked with *)
template <class T> int
RunningMedianTFP(T *dataP, IndexInt stride,IndexInt nstrides,IndexInt
num,int replaceMedianWithValue,T replacementValue,T replacementThreshold)
{
int i, err= 0;
IndexInt oldDataIndex;
T valueToRemove, valueToAdd;
T *p;
* typename vector<T>::iterator iter;
* pair<typename vector<T>::iterator, typename vector<T>::iterator> range;
It looks like gcc is not recognizing "typename vector<T>::iterator" as a
type. I expect we're running afoul of two-phase name lookup, but I was
under the impression that "typename" should have taken care of that.
"vector<double>::iterator iter" compiles OK.
The code above compiles OK with CodeWarrior with the ISO Template Parsing
checkbox turned on.
Thanks in advance, and I apologize for the munged lines that are going to
result from those long lines.
Regards,
John Weeks
WaveMetrics, Inc.
Phone (503) 620-3001
Fax (503) 620-6754
email email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden