Addition to prev. revision [#CLICKHOUSE-2].

This commit is contained in:
Alexey Milovidov 2017-08-01 17:33:38 +03:00
parent db984d92a8
commit fd5ac57b8e

View File

@ -50,22 +50,27 @@ public:
}; };
class StringHolder { namespace detail
protected: {
std::string ss; /// For correct order of initialization.
}; class StringHolder
{
protected:
std::string value;
};
}
/// Creates the string by itself and allows to get it. /// Creates the string by itself and allows to get it.
class WriteBufferFromOwnString : public StringHolder, public WriteBufferFromString class WriteBufferFromOwnString : public detail::StringHolder, public WriteBufferFromString
{ {
public: public:
WriteBufferFromOwnString() : WriteBufferFromString(ss) {} WriteBufferFromOwnString() : WriteBufferFromString(value) {}
std::string & str() std::string & str()
{ {
finish(); finish();
return ss; return value;
} }
}; };