I am using SimpleINI to get values into std::stringstream my_string; –
CSimpleIniCaseA::TNamesDepend::const_iterator i;
for (i = values.begin(); i != values.end(); ++i)
my_string << i->pItem <<"\n";
cout<<my_string.str()<<endl;
cout is working fine. I am able to print values on console.
But when I pass this string steam to BOOST ASIO Server constructor like this-
server tcp(tcp_service,my_string.str());
I get below compiler error-
‘std::basic_streambuf<_CharT, _Traits>& std::basic_streambuf<_CharT, _Traits>::operator=(const std::basic_streambuf<_CharT, _Traits>&) [with _CharT = char, _Traits = std::char_traits<char>]’ is private
I am able to pass other data types like char *, but not string steam. What is wrong?
You said you did something like
But there you pass a string to the constructor, not a stringstream.
Either change your constructor, or remove the
.str()frommy_string.str()