|
-
June 30th, 2006, 03:43 PM
#7
Re: new way of overloading operators in templates??
I found out. The correct code is:
Code:
#ifdef _MSC_VER
friend CMatriz<TG> operator+(const TG &op1,const CMatriz<TG> &op2); // objeto TG + CMatriz
friend CMatriz<TG> operator+(const double &op1,const CMatriz<TG> &op2); // constante + CMatriz
#elif __GNUC__ > 3 || (__GNUC__==3 && __GNUC_MINOR__ >=4)
friend CMatriz<TG> (::operator+ <TG>)(const TG &op1,const CMatriz<TG> &op2); // objeto TG + CMatriz
friend CMatriz<TG> (::operator+ <TG>)(const double &op1,const CMatriz<TG> &op2); // constante + CMatriz
#else
friend CMatriz<TG> operator+ <>(const TG &op1,const CMatriz<TG> &op2); // objeto TG + CMatriz
friend CMatriz<TG> operator+ <>(const double &op1,const CMatriz<TG> &op2); // constante + CMatriz
#endif
The code I was after is the one meant for gcc>=3.4, that however won't compile in 3.3
Any idea as to what does the new code means?
Last edited by Luis G; June 30th, 2006 at 03:50 PM.
int i;main(){for(;i["]<i;++i){--i;}"];read('-'-'-',i+++"hell\
o, world!\n",'/'/'/'));}read(j,i,p){write(j/p+p,i---j,i/i);}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|