"Oliver S." wrote:[color=blue]
>[color=green]
> > If you want it the C way, then do it the C way.[/color]
>
> In most cases you can estimate the maximum string-length a string will
> have. So my suggested approach is suitable for all this cases. With the
> lib I started you simply give the maximum lentgh as a template-parame-
> ter and the calls would throw an exception if the bounds would be excee-
> ded (a solution that does a fallback to heap-based strings in this case
> would be most elegant, although I doubt that this is really needed).
>[color=green]
> > In C++ this is not a good idea.[/color]
>
> That's your opinion that bases on your personal preferences; nothing
> more.[/color]
Oh. I already tested std::string compared to fixed length character
buffers. I found that in my applications it doesn't make a difference
in terms of speed. But the safety and ease that std::string brings
is more then worth that small spees penalty. And yes: The penalty
has always been small in real world programs.
--
Karl Heinz Buchegger
kbuchegg@gascad.at