story
> and then I scrawl "I AM Weasel" on top of my string using my reference and now your string was changed because it was COW.
I mean, that's the point of references... no ? If I wanted a different object I'd make a copy.
Like, even with just one string, without any CoW, your post makes it sound like you'd be surprised than if you had:
void set_some_config(const char*);
char* get_some_config();
std::string s = "foo";
set_some_config(&s[1]);
s = "bar";
get_some_config();
you'd get "ar" in get_some_config().