Click here to Skip to main content
15,894,106 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: Question about allocate of STL. Pin
markkuk13-Feb-03 2:24
markkuk13-Feb-03 2:24 
GeneralSinking events... Pin
LukeV12-Feb-03 3:25
LukeV12-Feb-03 3:25 
GeneralRe: Sinking events... Pin
LukeV12-Feb-03 4:37
LukeV12-Feb-03 4:37 
GeneralRe: Sinking events... Pin
LukeV12-Feb-03 11:45
LukeV12-Feb-03 11:45 
GeneralQuestion about front_inserter of STL. Pin
George212-Feb-03 2:56
George212-Feb-03 2:56 
GeneralRe: Question about front_inserter of STL. Pin
Joaquín M López Muñoz12-Feb-03 6:47
Joaquín M López Muñoz12-Feb-03 6:47 
GeneralRe: Question about front_inserter of STL. Pin
George212-Feb-03 13:32
George212-Feb-03 13:32 
GeneralQuestion about reverse_iterator. Pin
George212-Feb-03 2:21
George212-Feb-03 2:21 
Hi, everyone!

Here is a sample of the usage of iterator of STL.
When compiling it with VC6.0, some error occur.

I have added the source codes and related error
messages below.

Source:

--------
#include <list>
#include <iostream>

using namespace std;

int main()
{
list<int> l;
// fill l with 1 2 3 4
l.push_back(1);
l.push_back(2);
l.push_back(3);
l.push_back(4);

copy (reverse_iterator<int*, int, int&, ptrdiff_t> (l.end()),
reverse_iterator<int*, int, int&, ptrdiff_t> (l.begin()),
ostream_iterator<int> (cout, " ") );

return 1;
}
--------

Error messages:
--------
C:\Program Files\Microsoft Visual Studio\MyProjects\testRI2\testRI2.cpp(15) : error C2440: 'type cast' : cannot convert from

'class std::list<int,class std::allocator<int> >::iterator' to 'class std::reverse_iterator<int *,int,int &,int,int>'
No constructor could take the source type, or constructor overload resolution was ambiguous
C:\Program Files\Microsoft Visual Studio\MyProjects\testRI2\testRI2.cpp(16) : error C2440: 'type cast' : cannot convert from

'class std::list<int,class std::allocator<int> >::iterator' to 'class std::reverse_iterator<int *,int,int &,int,int>'
No constructor could take the source type, or constructor overload resolution was ambiguous
Error executing cl.exe.
--------


Thanks in advance,
George
GeneralRe: Question about reverse_iterator. Pin
Joaquín M López Muñoz12-Feb-03 2:26
Joaquín M López Muñoz12-Feb-03 2:26 
GeneralRe: Question about reverse_iterator. Pin
George212-Feb-03 2:35
George212-Feb-03 2:35 
GeneralQuestion about iterator of STL. Pin
George212-Feb-03 1:43
George212-Feb-03 1:43 
GeneralRe: Question about iterator of STL. Pin
Joaquín M López Muñoz12-Feb-03 2:07
Joaquín M López Muñoz12-Feb-03 2:07 
GeneralRe: Question about iterator of STL. Pin
George212-Feb-03 2:11
George212-Feb-03 2:11 
GeneralRe: Question about iterator of STL. Pin
Joaquín M López Muñoz12-Feb-03 2:19
Joaquín M López Muñoz12-Feb-03 2:19 
GeneralRe: Question about iterator of STL. Pin
George212-Feb-03 2:22
George212-Feb-03 2:22 
GeneralMFC And STL Pin
super11-Feb-03 3:46
professionalsuper11-Feb-03 3:46 
GeneralRe: MFC And STL Pin
Joaquín M López Muñoz11-Feb-03 7:54
Joaquín M López Muñoz11-Feb-03 7:54 
GeneralRe: MFC And STL Pin
Tim Smith11-Feb-03 8:43
Tim Smith11-Feb-03 8:43 
GeneralQuestion about STL stack Pin
George211-Feb-03 0:24
George211-Feb-03 0:24 
GeneralRe: Question about STL stack Pin
Stuart Dootson11-Feb-03 1:52
professionalStuart Dootson11-Feb-03 1:52 
GeneralRe: Question about STL stack Pin
George211-Feb-03 1:58
George211-Feb-03 1:58 
GeneralExcluding implemented interfaces from the typelib Pin
Nick Blumhardt10-Feb-03 19:20
Nick Blumhardt10-Feb-03 19:20 
GeneralRe: Excluding implemented interfaces from the typelib Pin
AlexO11-Feb-03 2:22
AlexO11-Feb-03 2:22 
GeneralServices on 98 Pin
Nick Blumhardt10-Feb-03 14:06
Nick Blumhardt10-Feb-03 14:06 
GeneralRe: Services on 98 Pin
Michael Dunn10-Feb-03 15:50
sitebuilderMichael Dunn10-Feb-03 15:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.