Click here to Skip to main content
15,894,405 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: primary key field Pin
Randor 11-Mar-08 7:29
professional Randor 11-Mar-08 7:29 
QuestionRe: primary key field Pin
David Crow11-Mar-08 10:13
David Crow11-Mar-08 10:13 
GeneralRe: primary key field Pin
Randor 11-Mar-08 11:37
professional Randor 11-Mar-08 11:37 
GeneralRe: primary key field Pin
David Crow12-Mar-08 2:31
David Crow12-Mar-08 2:31 
GeneralNetworking Pin
mirtu11-Mar-08 2:47
mirtu11-Mar-08 2:47 
QuestionRe: Networking Pin
David Crow12-Mar-08 2:52
David Crow12-Mar-08 2:52 
GeneralRe: Networking Pin
mirtu13-Mar-08 21:38
mirtu13-Mar-08 21:38 
GeneralRe: Networking Pin
David Crow14-Mar-08 2:38
David Crow14-Mar-08 2:38 
GeneralRe: Networking Pin
mirtu14-Mar-08 18:29
mirtu14-Mar-08 18:29 
GeneralRe: Networking Pin
David Crow15-Mar-08 4:23
David Crow15-Mar-08 4:23 
Generaltemplate function argument deduce Pin
George_George11-Mar-08 2:38
George_George11-Mar-08 2:38 
GeneralRe: template function argument deduce Pin
CPallini11-Mar-08 3:06
mveCPallini11-Mar-08 3:06 
GeneralRe: template function argument deduce Pin
George_George11-Mar-08 3:25
George_George11-Mar-08 3:25 
GeneralRe: template function argument deduce Pin
CPallini11-Mar-08 3:28
mveCPallini11-Mar-08 3:28 
GeneralRe: template function argument deduce Pin
George_George11-Mar-08 14:35
George_George11-Mar-08 14:35 
GeneralRe: template function argument deduce Pin
CPallini11-Mar-08 22:30
mveCPallini11-Mar-08 22:30 
GeneralRe: template function argument deduce Pin
George_George11-Mar-08 22:54
George_George11-Mar-08 22:54 
GeneralRe: template function argument deduce Pin
Stephen Hewitt11-Mar-08 19:31
Stephen Hewitt11-Mar-08 19:31 
GeneralRe: template function argument deduce Pin
Rajkumar R11-Mar-08 20:33
Rajkumar R11-Mar-08 20:33 
GeneralRe: template function argument deduce Pin
Stephen Hewitt11-Mar-08 20:56
Stephen Hewitt11-Mar-08 20:56 
GeneralRe: template function argument deduce Pin
Rajkumar R11-Mar-08 21:28
Rajkumar R11-Mar-08 21:28 
GeneralRe: template function argument deduce Pin
Stephen Hewitt11-Mar-08 21:33
Stephen Hewitt11-Mar-08 21:33 
Rajkumar R wrote:
both are different functions and its not matched by the return type but as a typecast operator.


No explicit type cast is needed:
// VanillaConsole.cpp : Defines the entry point for the console application.
//
 
#include "stdafx.h"
#include <iostream>
using namespace std;
 
struct Magic
{
	operator int() const
	{
		cout << "int" << endl;
		return 0;
	}
 
	operator float() const
	{
		cout << "float" << endl;
		return 0.0;
	}
 
	operator double() const
	{
		cout << "double" << endl;
		return 0.0;
	}
};
 
int main()
{
	Magic m;
 
	int i = m;
	float f = m;
	double d = m;
 
	return 0;
}


Give it a try!

Steve

GeneralRe: template function argument deduce Pin
Rajkumar R11-Mar-08 21:36
Rajkumar R11-Mar-08 21:36 
GeneralRe: template function argument deduce Pin
Stephen Hewitt11-Mar-08 21:39
Stephen Hewitt11-Mar-08 21:39 
GeneralRe: template function argument deduce [modified] Pin
Rajkumar R12-Mar-08 0:02
Rajkumar R12-Mar-08 0:02 

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.