Click here to Skip to main content
15,909,822 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: calculation error Pin
kbury15-Oct-09 5:07
kbury15-Oct-09 5:07 
GeneralRe: calculation error Pin
Luc Pattyn15-Oct-09 5:38
sitebuilderLuc Pattyn15-Oct-09 5:38 
QuestionHow to convert the vbscript to c++ using adsi Pin
raja 414-Oct-09 4:59
raja 414-Oct-09 4:59 
AnswerRe: How to convert the vbscript to c++ using adsi Pin
David Crow15-Oct-09 3:15
David Crow15-Oct-09 3:15 
QuestionEnabling and Disadbling Toolbar Buttons. Pin
hariakuthota14-Oct-09 4:43
hariakuthota14-Oct-09 4:43 
AnswerRe: Enabling and Disadbling Toolbar Buttons. Pin
CPallini14-Oct-09 5:27
mveCPallini14-Oct-09 5:27 
QuestionProblem in C++ Template definition Pin
gourishsio14-Oct-09 4:32
gourishsio14-Oct-09 4:32 
AnswerRe: Problem in C++ Template definition Pin
CPallini14-Oct-09 5:24
mveCPallini14-Oct-09 5:24 
You cannot do that (as the message clearly states). An option would be making vector<K> an out argument, i.e. for instance:
template<typename T, typename Function, typename K>
void find( std::vector<T> &a, Function _predicate, std::vector <K> & v)
{
	v.resize(a.size());
	
	for( unsigned int i = 0; i < a.size(); i++ )
	{
		if( _predicate(a[i]) )
		{
			v[i] = K(a[i]);
		}
	}
}


and then

int main()
{
  //...
  std::vector<int> b;
  find( a, is_true<int>(), b );
  //...
}


Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke

[My articles]

AnswerRe: Problem in C++ Template definition [modified] Pin
Stuart Dootson14-Oct-09 6:19
professionalStuart Dootson14-Oct-09 6:19 
QuestionCreating a Status Bar in DialogBased Application Pin
Hari_1614-Oct-09 3:49
Hari_1614-Oct-09 3:49 
AnswerRe: Creating a Status Bar in DialogBased Application Pin
Roger Stoltz14-Oct-09 4:47
Roger Stoltz14-Oct-09 4:47 
AnswerRe: Creating a Status Bar in DialogBased Application Pin
David Crow14-Oct-09 7:52
David Crow14-Oct-09 7:52 
GeneralRe: Creating a Status Bar in DialogBased Application Pin
Hari_1614-Oct-09 18:01
Hari_1614-Oct-09 18:01 
GeneralRe: Creating a Status Bar in DialogBased Application Pin
David Crow15-Oct-09 3:09
David Crow15-Oct-09 3:09 
QuestionHow to convert real to binary Pin
Aljaz11114-Oct-09 3:09
Aljaz11114-Oct-09 3:09 
AnswerRe: How to convert real to binary Pin
Iain Clarke, Warrior Programmer14-Oct-09 3:22
Iain Clarke, Warrior Programmer14-Oct-09 3:22 
AnswerRe: How to convert real to binary Pin
Cedric Moonen14-Oct-09 4:18
Cedric Moonen14-Oct-09 4:18 
AnswerRe: How to convert real to binary Pin
CPallini14-Oct-09 5:05
mveCPallini14-Oct-09 5:05 
GeneralRe: How to convert real to binary Pin
Aljaz11114-Oct-09 6:26
Aljaz11114-Oct-09 6:26 
GeneralRe: How to convert real to binary Pin
Ozer Karaagac14-Oct-09 15:54
professionalOzer Karaagac14-Oct-09 15:54 
GeneralRe: How to convert real to binary Pin
Luc Pattyn14-Oct-09 16:18
sitebuilderLuc Pattyn14-Oct-09 16:18 
GeneralRe: How to convert real to binary Pin
Patcher3214-Oct-09 17:59
Patcher3214-Oct-09 17:59 
QuestionOpen an associated file using doubleclick while application is running Pin
Erik14-Oct-09 2:22
Erik14-Oct-09 2:22 
QuestionRe: Open an associated file using doubleclick while application is running Pin
David Crow14-Oct-09 2:27
David Crow14-Oct-09 2:27 
AnswerRe: Open an associated file using doubleclick while application is running Pin
Erik14-Oct-09 18:17
Erik14-Oct-09 18:17 

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.