Click here to Skip to main content
15,908,834 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow to use select() function with file descriptors on windows Pin
Vijay_Vijay11-May-10 1:04
Vijay_Vijay11-May-10 1:04 
AnswerRe: how to use select() function with file descriptors on windows Pin
Richard MacCutchan11-May-10 2:36
mveRichard MacCutchan11-May-10 2:36 
QuestionHow to Track the event in Excel for cell insert/delete in C++ or VC++ for ? Pin
Gaurav171011-May-10 0:28
Gaurav171011-May-10 0:28 
AnswerRe: How to Track the event in Excel for cell insert/delete in C++ or VC++ for ? Pin
Stuart Dootson11-May-10 0:44
professionalStuart Dootson11-May-10 0:44 
GeneralRe: How to Track the event in Excel for cell insert/delete in C++ or VC++ for ? Pin
KTTransfer11-May-10 18:19
KTTransfer11-May-10 18:19 
GeneralRe: How to Track the event in Excel for cell insert/delete in C++ or VC++ for ? Pin
Stuart Dootson11-May-10 23:24
professionalStuart Dootson11-May-10 23:24 
GeneralRe: How to Track the event in Excel for cell insert/delete in C++ or VC++ for ? Pin
Gaurav171012-May-10 1:34
Gaurav171012-May-10 1:34 
GeneralRe: How to Track the event in Excel for cell insert/delete in C++ or VC++ for ? Pin
Stuart Dootson12-May-10 2:01
professionalStuart Dootson12-May-10 2:01 
GeneralRe: How to Track the event in Excel for cell insert/delete in C++ or VC++ for ? Pin
Gaurav171012-May-10 2:04
Gaurav171012-May-10 2:04 
GeneralRe: How to Track the event in Excel for cell insert/delete in C++ or VC++ for ? Pin
Stuart Dootson12-May-10 2:15
professionalStuart Dootson12-May-10 2:15 
GeneralRe: How to Track the event in Excel for cell insert/delete in C++ or VC++ for ? Pin
Gaurav171012-May-10 2:17
Gaurav171012-May-10 2:17 
GeneralRe: How to Track the event in Excel for cell insert/delete in C++ or VC++ for ? Pin
KTTransfer13-May-10 1:04
KTTransfer13-May-10 1:04 
Questioninclude directory Pin
john563211-May-10 0:23
john563211-May-10 0:23 
AnswerRe: include directory Pin
Stuart Dootson11-May-10 0:47
professionalStuart Dootson11-May-10 0:47 
Questionconvert mjpeg to mpeg4 Pin
gmallax10-May-10 23:51
gmallax10-May-10 23:51 
AnswerRe: convert mjpeg to mpeg4 Pin
«_Superman_»11-May-10 7:42
professional«_Superman_»11-May-10 7:42 
QuestionHow to register a dll on Window 7 machine. Pin
pandit8410-May-10 20:39
pandit8410-May-10 20:39 
AnswerRe: How to register a dll on Window 7 machine. [modified] Pin
_AnsHUMAN_ 10-May-10 21:47
_AnsHUMAN_ 10-May-10 21:47 
QuestionRe: How to register a dll on Window 7 machine. Pin
pandit8411-May-10 0:02
pandit8411-May-10 0:02 
AnswerRe: How to register a dll on Window 7 machine. Pin
Electron Shepherd11-May-10 2:49
Electron Shepherd11-May-10 2:49 
QuestionCreate Visual Studio Project Pin
Game-point10-May-10 19:51
Game-point10-May-10 19:51 
AnswerRe: Create Visual Studio Project Pin
Richard MacCutchan10-May-10 21:21
mveRichard MacCutchan10-May-10 21:21 
Questionproblem with std::map insertion with a std::vector type object Pin
gourishsio10-May-10 19:33
gourishsio10-May-10 19:33 
Hi,
I was trying to compile the following code,
but it give the error that "tmpname cannot appear in constant expression"
I am using the g++ compiler


#include <iostream>
#include <vector>
#include <map>
#include <string>

class TidePhaseAmp
{
public:
	float amp;
	float phase;
};

main ()
{

	std::map< std::string, std::vector<TidePhaseAmp> > extracted_tConst;

	const char * tmpname = "2n2";
	extracted_tConst.insert(std::pair<std::string, std::vector<TidePhaseAmp>>(tmpname, std::vector<TidePhaseAmp>(5)));

	return(0);

}


the compile error messages are
test_map2.cpp: In function ‘int main()’:
test_map2.cpp:19: error: ‘tmpname’ cannot appear in a constant-expression
test_map2.cpp:19: error: a comma operator cannot appear in a constant-expression
test_map2.cpp:19: error: a call to a constructor cannot appear in a constant-expression
test_map2.cpp:19: error: ‘>>’ should be ‘> >’ within a nested template argument list

however the program does not gives any error when I compile it using visual studio 2008 express compiler

is the problem because I am using a constructor in the statement .i.e. std::vector<TidePhaseAmp>(5)
or is there any other workaround for the problem

Gourish
AnswerRe: problem with std::map insertion with a std::vector type object PinPopular
Graham Breach10-May-10 20:23
Graham Breach10-May-10 20:23 
AnswerRe: problem with std::map insertion with a std::vector type object Pin
Stuart Dootson10-May-10 22:15
professionalStuart Dootson10-May-10 22:15 

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.