ultimatepp/uppdev/StringBufferOf/StringBufferOf.cpp
cxl 3cd394812c Merge continued
git-svn-id: svn://ultimatepp.org/upp/trunk@10263 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2016-10-04 08:34:39 +00:00

23 lines
354 B
C++

#include <Core/Core.h>
using namespace Upp;
class StringBufferOf : public StringBuffer {
String& tgt;
public:
StringBufferOf(String& s) : tgt(s), StringBuffer(s) {}
~StringBufferOf() { tgt = *this; }
};
CONSOLE_APP_MAIN
{
String a = "Hello!";
String b = a;
{
StringBufferOf x(a);
x[2] = 'A';
}
DUMP(a);
DUMP(b);
}