bonjour, voila j'ai surchagé l'operator << comme ceci (enfin c'est pas exactement moi...)
tout ceci fonctionne bien, pour des string char[] , int, etc..Etc..Code:
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; }
mais lorsque je fait
CMyclass A;
A << "bonjour << std::endl;
il ne compile plus et me met ce beau msg.
si c'est pas un objet, si c'est pas un string, c'est quoi???Citation:
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'
et surtout comment fairepour qu'il soit accepté ??
merci
a++