The autostr
that is returned from the function is a temporary. Temporary values can only be bound to references-to-const (const autostr&
), but your reference is non-const. (And "rightly so".)
This is a terrible idea, almost none of the standard library is intended to be inherited from. I already see a bug in your code:
autostr s("please don't delete me...oops");
What's wrong with std::string
?
GMan
2010-05-26 05:08:05