The problem is that the overloaded <statement expects an argument ..
new ostringstream()
but you give him an argument.
ostringstream()
It is not that corresponds to an overloaded function.
auto_ptr ostringstream . .
#include<sstream>
#include<iostream>
#define STRING_STREAM( data ) \
((ostringstream&)( *( auto_ptr<ostringstream>(new ostringstream()) ) << data)).str()
using namespace std;
enum TestEnum { ALPHA, BETA };
ostringstream& operator<<( ostringstream& oss, TestEnum testEnum ){
oss << "TestEnum";
return oss;
}
int main(){
cout << STRING_STREAM( ALPHA ) << endl;
}