bonjour, voila j'ai surchagé l'operator << comme ceci (enfin c'est pas exactement moi...)

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
 
 template<class T>CMyClass& operator<<(const T& T){
   					std::ostringstream oss;
    				oss << T;
    				write(oss.str());
					return *this;
			}
tout ceci fonctionne bien, pour des string char[] , int, etc..Etc..
mais lorsque je fait

CMyclass A;
A << "bonjour << std::endl;
il ne compile plus et me met ce beau msg.


elekis@ubuntu:~/stuff$ g++ -o test main.cc
main.cc: In function 'int main()':
main.cc:6: error: no match for 'operator<<' in '(+(+ CCoutLogger::Instance())->CLogger::operator<< [with T = char [9]](((const char (&)[9])"bonjour ")))->CLogger::operator<< [with T = int](((const int&)((const int*)(&5)))) << std::endl'
si c'est pas un objet, si c'est pas un string, c'est quoi???


et surtout comment fairepour qu'il soit accepté ??

merci

a++