On Thu, 2008-09-11 at 15:39 +0200, Kinkie wrote:
> There's a quite important aspect I'd like to clear: currently most
> manipulation functions modify the KBuf itself, i.e.
>
> KBuf foo.assing("foo");
> foo.append(" bar");
> // foo now contains "foo bar".
>
> An alternative would be to always return fresh KBuf, or in other words:
>
> KBuf foo.assing("foo");
> foo=foo.append(" bar");
>
> The choice was made because it's more efficient, but it may be
> counterintuitive.
You made the right choice. The "modifying methods modify their object"
approach is more efficient and should be expected by most C++
developers.
Alex.