Click here to Skip to main content
15,926,281 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
Thanks Rajkumar,


I have got the redefinition error as you pointed out. Cool! But to use the latter one, it is also not mandatory needed to specify the template parameter type, it could also be deduced. Here is my code to prove. Any comments?

#include <iostream>

using namespace std;

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

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

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

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

int main()
{
	f (100);

	return 0;
}



regards,
George
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 
GeneralRe: Problem in Release Mode please look at the code. Pin
ritz12346-Mar-08 17:12
ritz12346-Mar-08 17:12 
Generalvertical text Pin
Russell'5-Mar-08 21:23
Russell'5-Mar-08 21:23 
GeneralRe: vertical text Pin
Rajkumar R5-Mar-08 21:29
Rajkumar R5-Mar-08 21:29 
GeneralRe: vertical text Pin
Russell'5-Mar-08 21:37
Russell'5-Mar-08 21:37 
GeneralRe: vertical text Pin
Rajkumar R5-Mar-08 21:45
Rajkumar R5-Mar-08 21:45 
GeneralRe: vertical text [SOLVED] Pin
Russell'5-Mar-08 21:59
Russell'5-Mar-08 21:59 

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.