Relative Content

Tag Archive for c++stringc++11

Why the code crashes when calling std::string::begin()?

Here is a simple code snippet to learn Command Pattern which is to simulate a simple editor.
But I really can’t figure out why it crashes when inserting.The backtrace seems tell me that the Document::content is not vaid when inserting is called.