Click here to Skip to main content
16,005,222 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: template function instantiation Pin
George_George6-Mar-08 0:11
George_George6-Mar-08 0:11 
GeneralRe: template function instantiation Pin
Rajkumar R5-Mar-08 23:30
Rajkumar R5-Mar-08 23:30 
GeneralRe: template function instantiation Pin
George_George6-Mar-08 0:07
George_George6-Mar-08 0:07 
GeneralRe: template function instantiation Pin
Rajkumar R6-Mar-08 0:52
Rajkumar R6-Mar-08 0:52 
GeneralRe: template function instantiation Pin
George_George6-Mar-08 0:59
George_George6-Mar-08 0:59 
GeneralRe: template function instantiation Pin
Rajkumar R6-Mar-08 1:08
Rajkumar R6-Mar-08 1:08 
GeneralRe: template function instantiation Pin
George_George6-Mar-08 1:21
George_George6-Mar-08 1:21 
GeneralRe: template function instantiation Pin
George_George6-Mar-08 0:29
George_George6-Mar-08 0:29 
Hi Rajkumar,


I have a further question. I have tried similar code as yours. But can not compile in Visual Studio 2008. Any ideas? f<int> (100) works. Why?

BTW: a fix of

1>d:\visual studio 2008\projects\test_template3\test_template3\main.cpp(16) : error C2783: 'void f(int)' : could not deduce template argument for 'T'
1>        d:\visual studio 2008\projects\test_template3\test_template3\main.cpp(5) : see declaration of 'f'


#include <iostream>

using namespace std;

template <class T> void f(int a) {g (a);}

void g(int a)
{
	cout << a << endl;
}

extern void g(double);

int main()
{
	f (100);
	return 0;
}



regards,
George
AnswerRe: template function instantiation [modified] Pin
Rajkumar R6-Mar-08 1:00
Rajkumar R6-Mar-08 1:00 
GeneralRe: template function instantiation Pin
George_George6-Mar-08 1:56
George_George6-Mar-08 1:56 
GeneralRe: template function instantiation Pin
Rajkumar R6-Mar-08 2:04
Rajkumar R6-Mar-08 2:04 
GeneralRe: template function instantiation Pin
George_George6-Mar-08 2:08
George_George6-Mar-08 2:08 
GeneralRe: template function instantiation Pin
Rajkumar R6-Mar-08 2:23
Rajkumar R6-Mar-08 2:23 
GeneralRe: template function instantiation Pin
George_George6-Mar-08 15:11
George_George6-Mar-08 15:11 
Generaliterator for deque Pin
George_George5-Mar-08 22:00
George_George5-Mar-08 22:00 
GeneralRe: iterator for deque Pin
Maximilien6-Mar-08 1:00
Maximilien6-Mar-08 1:00 
GeneralRe: iterator for deque Pin
George_George6-Mar-08 16:26
George_George6-Mar-08 16:26 
QuestionSelecting a folder from open dialog ???????? Pin
TooShy2Talk5-Mar-08 21:40
TooShy2Talk5-Mar-08 21:40 
GeneralRe: Selecting a folder from open dialog ???????? Pin
Rajkumar R5-Mar-08 21:48
Rajkumar R5-Mar-08 21:48 
GeneralRe: Selecting a folder from open dialog ???????? Pin
James R. Twine6-Mar-08 5:30
James R. Twine6-Mar-08 5:30 
GeneralProblem in Release Mode please look at the code. Pin
ritz12345-Mar-08 21:38
ritz12345-Mar-08 21:38 
AnswerRe: Problem in Release Mode please look at the code. Pin
Roger Stoltz5-Mar-08 22:59
Roger Stoltz5-Mar-08 22:59 
GeneralRe: Problem in Release Mode please look at the code. Pin
ritz12345-Mar-08 23:27
ritz12345-Mar-08 23:27 
AnswerRe: Problem in Release Mode please look at the code. Pin
Maxwell Chen6-Mar-08 1:24
Maxwell Chen6-Mar-08 1:24 
GeneralRe: Problem in Release Mode please look at the code. Pin
Roger Stoltz6-Mar-08 1:37
Roger Stoltz6-Mar-08 1:37 

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.