• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
type/value mismatch error in template
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: type/value mismatch error in template
      • From: Andreas Grosam <email@hidden>
  • Prev by Date: Re: set a breakpoint in szone_error to debug
  • Next by Date: Re: creating a package in xcode 1.5 with an alternative 'stub' app for 10.1 and 10.2
  • Previous by thread: type/value mismatch error in template
  • Next by thread: Re: type/value mismatch error in template
  • Index(es):
    • Date
    • Thread