
22 Oct
2004
22 Oct
'04
5:11 p.m.
Rob Stewart wrote:
It is easy to build a safe interface atop a fast one, but you can't do the reverse.
Yes. The question is, why should the fast interface not consist of a set of algorithms operating on sequences of char*_t. The argument against was that creating a string incurs an allocation penalty, and the users will not do it. But my experience does not suggest that this would be the case. I frequently use vector<char> for C APIs that need a char[] and std::string for C++ APIs, and haven't found the necessary conversions a performance burden.