* RE: STL vector .at() method?
@ 2004-03-18 20:10 Martin York
0 siblings, 0 replies; 4+ messages in thread
From: Martin York @ 2004-03-18 20:10 UTC (permalink / raw)
To: gcc-help
You don't need to upgrade the whole compiler.
We use STLPort to compensate for the deficiency in the STL supplied with
gcc 2.96
<<http://www.stlport.com>>
Falk Hueffner wrote:
> "Chris Barker" <Chris.Barker@noaa.gov> writes:
>
>
>>It looks to me like the STL implimentation provided with GCC 2.96
>>(provided by RedHat LInux 7.2) simply doesn't support that method. Is
>>that the case?
> Yes.
>>I can upgrade, if that will make a difference.
> It will.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: STL vector .at() method?
2004-03-18 14:45 ` Falk Hueffner
@ 2004-03-18 19:51 ` Chris Barker
0 siblings, 0 replies; 4+ messages in thread
From: Chris Barker @ 2004-03-18 19:51 UTC (permalink / raw)
Cc: gcc-help
Falk Hueffner wrote:
> "Chris Barker" <Chris.Barker@noaa.gov> writes:
>
>
>>It looks to me like the STL implimentation provided with GCC 2.96
>>(provided by RedHat LInux 7.2) simply doesn't support that
>>method. Is that the case?
> Yes.
>>I can upgrade, if that will make a difference.
> It will.
Thanks, that settles it.. on to an upgrade. However, I'd still like to
know where I can find docs that would tell me what is and is not
supported by various versions of gcc's STL implimentation. Anyone know?
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: STL vector .at() method?
2004-03-18 9:15 Chris Barker
@ 2004-03-18 14:45 ` Falk Hueffner
2004-03-18 19:51 ` Chris Barker
0 siblings, 1 reply; 4+ messages in thread
From: Falk Hueffner @ 2004-03-18 14:45 UTC (permalink / raw)
To: Chris Barker; +Cc: gcc-help
"Chris Barker" <Chris.Barker@noaa.gov> writes:
> It looks to me like the STL implimentation provided with GCC 2.96
> (provided by RedHat LInux 7.2) simply doesn't support that
> method. Is that the case?
Yes.
> I can upgrade, if that will make a difference.
It will.
--
Falk
^ permalink raw reply [flat|nested] 4+ messages in thread
* STL vector .at() method?
@ 2004-03-18 9:15 Chris Barker
2004-03-18 14:45 ` Falk Hueffner
0 siblings, 1 reply; 4+ messages in thread
From: Chris Barker @ 2004-03-18 9:15 UTC (permalink / raw)
To: gcc-help
Hi all,
I'm trying to port an app to Linux that makes use of some of the STD
containers. I'm having a problem with the vector .at() method. The error
I get is:
$ g++ -o testSTL testSTL.cpp
testSTL.cpp: In function `int main ()':
testSTL.cpp:20: no matching function for call to `vector<int,
allocator<int> >::at (int)'
This is from some small test code I got from "C++ How to Program" (code
included below)
It looks to me like the STL implimentation provided with GCC 2.96
(provided by RedHat LInux 7.2) simply doesn't support that method. Is
that the case? I can upgrade, if that will make a difference.
This sure looks like a classic RTFM, but I"ve spend hours on the net,
and have not found a FM to read, so a pointer to some description of
what the libraries with various versions of GCC provide in the way of
STL support would be much appreciated.
-thanks,
-Chris
**** Simple test program below ****
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
const int SIZE = 6;
int a[ SIZE ] = {1,2,3,4,5,6};
vector< int > v(a, a + SIZE);
ostream_iterator< int > output (cout, " " );
cout << "Vector v contains: ";
copy( v.begin(), v.end(), output );
cout << "\nFirst element of v: " << v.front()
<< "\nLast element of v:" << v.back();
v [ 0 ] = 7;
v.at( 2 ) = 10;
v.insert (v.begin() + 1, 22);
cout << "\nVector v after Changes: ";
copy( v.begin(), v.end(), output );
v.erase( v.begin() ) ;
cout << "\nVector v after erase: ";
copy( v.begin(), v.end(), output );
v.erase( v.begin(), v.end()) ;
cout << "\nVector v after erase all: ";
copy( v.begin(), v.end(), output );
v.insert( v.begin(),a, a + SIZE );
cout << "\nContents of Vector before clear: ";
copy( v.begin(), v.end(), output );
v.clear();
cout << "\nContents of Vector after clear: ";
copy( v.begin(), v.end(), output );
// cout << "\n";
cout << endl;
return 0;
}
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-03-18 18:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-18 20:10 STL vector .at() method? Martin York
-- strict thread matches above, loose matches on Subject: below --
2004-03-18 9:15 Chris Barker
2004-03-18 14:45 ` Falk Hueffner
2004-03-18 19:51 ` Chris Barker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).