Click here to Skip to main content
15,915,094 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Is anybody use the Visual C++6/MFC develope application? Pin
Hamid_RT20-Feb-07 5:41
Hamid_RT20-Feb-07 5:41 
AnswerRe: Is anybody use the Visual C++6/MFC develope application? Pin
Hans Dietrich20-Feb-07 3:25
mentorHans Dietrich20-Feb-07 3:25 
AnswerRe: Is anybody use the Visual C++6/MFC develope application? Pin
Ravi Bhavnani20-Feb-07 3:40
professionalRavi Bhavnani20-Feb-07 3:40 
AnswerRe: Is anybody use the Visual C++6/MFC develope application? Pin
David Crow20-Feb-07 3:58
David Crow20-Feb-07 3:58 
AnswerRe: Is anybody use the Visual C++6/MFC develope application? Pin
Hamid_RT20-Feb-07 5:38
Hamid_RT20-Feb-07 5:38 
Questionold DIB in res\activity.ico; pass it through SDKPAINT. What it is ? PinPopular
sakthimuthu20-Feb-07 1:46
sakthimuthu20-Feb-07 1:46 
AnswerRe: old DIB in res\activity.ico; pass it through SDKPAINT. What it is ? Pin
David Crow20-Feb-07 4:00
David Crow20-Feb-07 4:00 
Questiontypedef in templates? Pin
N-O-R-B-E-R-T20-Feb-07 1:31
N-O-R-B-E-R-T20-Feb-07 1:31 
I'm writing a class which is more or less a STL map with a few enhancements, e.g. sending of update notifications. To still have STL like access to the map, I forward the map iterators in my class with public typedefs. The problem is, those typedefs seem to be missing a semicolon where there is definitely none missing;

<br />
#include <map><br />
<br />
template <typename K, typename V><br />
class Repository<br />
{<br />
private:<br />
	typedef std::map<K, T> ReposMap;<br />
public:<br />
	typedef ReposMap::iterator iterator; //line 14<br />
	typedef ReposMap::const_iterator const_iterator; //line 15<br />
public:<br />
	Repository()<br />
	{<br />
	}<br />
<br />
	~Repository()<br />
	{<br />
	}<br />
<br />
//[...] some other functions ...<br />
<br />
private:<br />
	ReposMap m_objects;<br />
};<br />


MSVC8 gives the following error msgs compiling this code:
Error 2:  error C2146: syntax error : missing ';' before identifier 'iterator'  14
Error 3:  error C4430: missing type specifier - int assumed. Note: C++ does not support default-int  14

and the same error msgs again for line 15 before 'const_iterator'

I was wondering what the error could be in that few lines of code. Typedefs should be able to work with template parameters, so there shouldn't be an problem, should it?

I'm trying to compile this and some other versions of the same problem for two days now, but I don't have an idea, what could cause the problem, so I'd appreciate any suggestions.

thanks in advance,
Norbert
GeneralRe: typedef in templates? Pin
N-O-R-B-E-R-T20-Feb-07 1:36
N-O-R-B-E-R-T20-Feb-07 1:36 
AnswerRe: typedef in templates? Pin
prasad_som20-Feb-07 1:52
prasad_som20-Feb-07 1:52 
AnswerRe: typedef in templates? Pin
N-O-R-B-E-R-T20-Feb-07 1:57
N-O-R-B-E-R-T20-Feb-07 1:57 
GeneralRe: typedef in templates? Pin
prasad_som20-Feb-07 2:00
prasad_som20-Feb-07 2:00 
GeneralRe: typedef in templates? Pin
prasad_som20-Feb-07 17:05
prasad_som20-Feb-07 17:05 
GeneralRe: typedef in templates? Pin
Stephen Hewitt20-Feb-07 11:40
Stephen Hewitt20-Feb-07 11:40 
AnswerRe: typedef in templates? Pin
prasad_som20-Feb-07 17:04
prasad_som20-Feb-07 17:04 
QuestionProblem deploying VC++ applications Pin
Ralph A. Moritz20-Feb-07 0:50
Ralph A. Moritz20-Feb-07 0:50 
AnswerRe: Problem deploying VC++ applications Pin
Ralph A. Moritz20-Feb-07 1:22
Ralph A. Moritz20-Feb-07 1:22 
Questionscrolling window from left to right Pin
radhika2820-Feb-07 0:35
radhika2820-Feb-07 0:35 
AnswerRe: scrolling window from left to right Pin
Nibu babu thomas20-Feb-07 0:55
Nibu babu thomas20-Feb-07 0:55 
AnswerRe: scrolling window from left to right Pin
jhwurmbach20-Feb-07 1:21
jhwurmbach20-Feb-07 1:21 
QuestionSockets Pin
Johan Pretorius19-Feb-07 23:15
Johan Pretorius19-Feb-07 23:15 
AnswerRe: Sockets Pin
AkiraOne19-Feb-07 23:35
AkiraOne19-Feb-07 23:35 
AnswerRe: Sockets Pin
led mike20-Feb-07 5:45
led mike20-Feb-07 5:45 
Questioninvalidate rectangle Pin
rushiraj.jhala19-Feb-07 22:42
rushiraj.jhala19-Feb-07 22:42 
AnswerRe: invalidate rectangle Pin
prasad_som19-Feb-07 22:54
prasad_som19-Feb-07 22:54 

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.