Click here to Skip to main content
15,915,777 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalregarding AVCODEC Pin
Girish Kumar3-Jan-08 1:01
Girish Kumar3-Jan-08 1:01 
GeneralRe: regarding AVCODEC Pin
Vaclav_3-Jan-08 16:40
Vaclav_3-Jan-08 16:40 
General[Message Deleted] Pin
Girish Kumar3-Jan-08 17:58
Girish Kumar3-Jan-08 17:58 
GeneralRe: regarding AVCODEC Pin
Vaclav_3-Jan-08 18:11
Vaclav_3-Jan-08 18:11 
GeneralRe: regarding AVCODEC Pin
Girish Kumar3-Jan-08 18:41
Girish Kumar3-Jan-08 18:41 
GeneralRe: regarding AVCODEC Pin
Girish Kumar4-Jan-08 22:07
Girish Kumar4-Jan-08 22:07 
GeneralRe: regarding AVCODEC Pin
Girish Kumar5-Jan-08 20:23
Girish Kumar5-Jan-08 20:23 
GeneralTemplate and operator Pin
Vics3-Jan-08 0:53
Vics3-Jan-08 0:53 
Hi all,
I have a problem with Visual c++ 6.0 compiler.
First, I define this template class and these 2 operators:

template <class T>
class mat
{};

template <class T> inline mat<T> operator +(mat<T> m1,T el){return m1;};  

inline mat<double> operator -(mat<double> m1,double el){return m1;};  

Then, I try to compile these istructions:
mat<double> A,B;
B=A+1;	 // error C2678 binary '+' : no operator defined which takes a left-hand operand of type 'class mat<double>'
B=A+1.0; // OK
B=A-1;	 // OK

The compiler give an error for the first operator if I don't specify the correct type of the right-hand operand; for the second operator there are no problems. Anyone can explain me why there is a difference between the two operators in the implicit casting? Are there a way to avoid this problem?
Thanks in advance!
GeneralRe: Template and operator Pin
CPallini3-Jan-08 2:08
mveCPallini3-Jan-08 2:08 
GeneralRe: Template and operator Pin
Vics3-Jan-08 2:49
Vics3-Jan-08 2:49 
Questionhow to modify these matrix? Pin
gentleguy3-Jan-08 0:39
gentleguy3-Jan-08 0:39 
AnswerRe: how to modify these matrix? [modified] Pin
CPallini3-Jan-08 0:57
mveCPallini3-Jan-08 0:57 
QuestionRe: how to modify these matrix? Pin
David Crow3-Jan-08 2:58
David Crow3-Jan-08 2:58 
GeneralRe: how to modify these matrix? Pin
CPallini3-Jan-08 3:18
mveCPallini3-Jan-08 3:18 
GeneralRe: how to modify these matrix?[modifed 4/01/08] Pin
gentleguy3-Jan-08 14:43
gentleguy3-Jan-08 14:43 
GeneralRe: how to modify these matrix?[modifed 4/01/08] Pin
David Crow3-Jan-08 15:50
David Crow3-Jan-08 15:50 
GeneralRe: how to modify these matrix?[modifed 4/01/08] Pin
CPallini3-Jan-08 20:59
mveCPallini3-Jan-08 20:59 
AnswerRe: how to modify these matrix? Pin
David Crow3-Jan-08 2:47
David Crow3-Jan-08 2:47 
AnswerRe: how to modify these matrix? Pin
Randor 3-Jan-08 6:51
professional Randor 3-Jan-08 6:51 
GeneralRe: how to modify these matrix? Pin
CPallini3-Jan-08 7:23
mveCPallini3-Jan-08 7:23 
GeneralRe: how to modify these matrix? Pin
Randor 3-Jan-08 7:33
professional Randor 3-Jan-08 7:33 
GeneralRe: how to modify these matrix? Pin
CPallini3-Jan-08 7:52
mveCPallini3-Jan-08 7:52 
GeneralRe: how to modify these matrix? Pin
gentleguy3-Jan-08 14:36
gentleguy3-Jan-08 14:36 
GeneralA project made from XPCOM components and VC++ - I posted this messaje before several hours ago Pin
cuesdean florin3-Jan-08 0:38
cuesdean florin3-Jan-08 0:38 
QuestionRe: A project made from XPCOM components and VC++ - I posted this messaje before several hours ago Pin
Matthew Faithfull3-Jan-08 1:02
Matthew Faithfull3-Jan-08 1: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.