RE: Stuck on compile error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If believe the problem is that erase expects two iterators, saying where to erase from and to.  The expression "&tripletVec_[numTriplets]" does not return an iterator, but the element stored at numTriplets.  So, it's a type mismatch.

Cheers,
Lyle


-----Original Message-----
From: gcc-help-owner@xxxxxxxxxxx [mailto:gcc-help-owner@xxxxxxxxxxx]On
Behalf Of Gary Cote
Sent: Friday, January 16, 2004 4:08 PM
To: gcc-help@xxxxxxxxxxx
Subject: Stuck on compile error



I'm upgrading from gcc 2.96 to gcc 3.2.3, fixing
the various compiler warnings and errors in our
existing code base. One error has got me stumped.
Can anyone please tell me what's wrong with this?

I've boiled it down to its essential elements.


-------------

#include <vector>
using namespace std;

class ttiAucTriplet {

int i;
};

typedef vector<ttiAucTriplet> tVec;

void foo() {
    tVec tripletVec_;
    int numTriplets = 0;

    tripletVec_.erase(tripletVec_.begin(), &tripletVec_[numTriplets]); 
}


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux