function template
From: nikola (sendspam_at_here.lol)
Date: 05/31/04
- Next message: Rolf Magnus: "Re: '\0' in a C++ string?"
- Previous message: Steven T. Hatton: "Re: Why do I want RTTI?"
- Next in thread: lallous: "Re: function template"
- Reply: lallous: "Re: function template"
- Reply: Rolf Magnus: "Re: function template"
- Reply: Gianni Mariani: "Re: function template"
- Reply: Pete Becker: "Re: function template"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 31 May 2004 13:23:05 GMT
Hi all,
I was working with a simple function template to find the min of two values.
But since I would like the two values to be different (type) I dont know
what kind of value (type) it will return. I tried to write something like
this:
template <class Type1, class Type2, class Type3>
Type3 findMin(Type1 x, Type2 y){
return (x < y) ? x : y;
}
but it says it cannot deduce template argument for 'Type3'
Can anyone help? Thanx
- Next message: Rolf Magnus: "Re: '\0' in a C++ string?"
- Previous message: Steven T. Hatton: "Re: Why do I want RTTI?"
- Next in thread: lallous: "Re: function template"
- Reply: lallous: "Re: function template"
- Reply: Rolf Magnus: "Re: function template"
- Reply: Gianni Mariani: "Re: function template"
- Reply: Pete Becker: "Re: function template"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]