include mystringstream.h, , , .
- ,
sstream. - Your STL implementation should not have specialized
basic_stringstream <char, char_traits<char>, allocator<char> > - Your STL implementation or any other header you include should not have a stringstream already created
In doing so, he worked in this simple code example .
namespace std
{
class newallocator : public allocator<char>
{
};
template <>
class basic_stringstream<char, char_traits<char>, allocator<char> >
: public basic_stringstream <char, char_traits<char>, newallocator >
{
public:
basic_stringstream()
{
precision(16);
}
};
}
I personally do not like this solution, because it significantly changes the behavior of the standard library, and does not expand it.
source
share