Click here to Skip to main content
15,922,015 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
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 
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 
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
reverse_bidirectional_iterator <list<int>::iterator,
list<int>::value_type,
list<int>::reference_type,
list<int>::difference_type> r (l.end());
cout << *r << " ";
r++;
cout << *r << " ";
r--;
cout << *r;
}
--------


Error and warnings:

--------
c:\Program Files\Microsoft Visual Studio\MyProjects\testRI\testRI.cpp(12) : error C2039: 'reference_type' : is not a member

of 'list<int,class std::allocator<int> >'
C:\Program Files\Microsoft Visual Studio\MyProjects\testRI\testRI.cpp(12) : error C2065: 'reference_type' : undeclared

identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\testRI\testRI.cpp(13) : error C2955: 'reverse_bidirectional_iterator' :

use of class template requires template argument list
c:\program files\microsoft visual studio\vc98\include\iterator(56) : see declaration of

'reverse_bidirectional_iterator'
C:\Program Files\Microsoft Visual Studio\MyProjects\testRI\testRI.cpp(13) : error C2514:

'std::reverse_bidirectional_iterator' : class has no constructors
c:\program files\microsoft visual studio\vc98\include\iterator(56) : see declaration of

'reverse_bidirectional_iterator'
C:\Program Files\Microsoft Visual Studio\MyProjects\testRI\testRI.cpp(13) : error C2262: 'r' : cannot be destroyed
C:\Program Files\Microsoft Visual Studio\MyProjects\testRI\testRI.cpp(14) : error C2678: binary '*' : no operator defined

which takes a left-hand operand of type 'class std::reverse_bidirectional_iterator' (or there is no acceptable conversion)
C:\Program Files\Microsoft Visual Studio\MyProjects\testRI\testRI.cpp(15) : error C2678: binary '++' : no operator defined

which takes a left-hand operand of type 'class std::reverse_bidirectional_iterator' (or there is no acceptable conversion)
C:\Program Files\Microsoft Visual Studio\MyProjects\testRI\testRI.cpp(15) : error C2678: binary '++' : no operator defined

which takes a left-hand operand of type 'class std::reverse_bidirectional_iterator' (or there is no acceptable conversion)
C:\Program Files\Microsoft Visual Studio\MyProjects\testRI\testRI.cpp(15) : error C2678: binary '++' : no operator defined

which takes a left-hand operand of type 'class std::reverse_bidirectional_iterator' (or there is no acceptable conversion)
C:\Program Files\Microsoft Visual Studio\MyProjects\testRI\testRI.cpp(16) : error C2678: binary '*' : no operator defined

which takes a left-hand operand of type 'class std::reverse_bidirectional_iterator' (or there is no acceptable conversion)
C:\Program Files\Microsoft Visual Studio\MyProjects\testRI\testRI.cpp(17) : error C2678: binary '--' : no operator defined

which takes a left-hand operand of type 'class std::reverse_bidirectional_iterator' (or there is no acceptable conversion)
C:\Program Files\Microsoft Visual Studio\MyProjects\testRI\testRI.cpp(17) : error C2678: binary '--' : no operator defined

which takes a left-hand operand of type 'class std::reverse_bidirectional_iterator' (or there is no acceptable conversion)
C:\Program Files\Microsoft Visual Studio\MyProjects\testRI\testRI.cpp(17) : error C2678: binary '--' : no operator defined

which takes a left-hand operand of type 'class std::reverse_bidirectional_iterator' (or there is no acceptable conversion)
C:\Program Files\Microsoft Visual Studio\MyProjects\testRI\testRI.cpp(18) : error C2678: binary '*' : no operator defined

which takes a left-hand operand of type 'class std::reverse_bidirectional_iterator' (or there is no acceptable conversion)
C:\Program Files\Microsoft Visual Studio\MyProjects\testRI\testRI.cpp(19) : warning C4508: 'main' : function should return a

value; 'void' return type assumed
Error executing cl.exe.
--------


How to resolve the trouble?


Thanks in advance,
George
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 
GeneralRe: Services on 98 Pin
Nick Blumhardt10-Feb-03 19:17
Nick Blumhardt10-Feb-03 19:17 
GeneralRe: What is the difference between delete[] and delete? Pin
Joaquín M López Muñoz10-Feb-03 2:24
Joaquín M López Muñoz10-Feb-03 2:24 
GeneralRe: What is the difference between delete[] and delete? Pin
George210-Feb-03 2:35
George210-Feb-03 2:35 

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.