|
Boost : |
From: Caleb Epstein (caleb.epstein_at_[hidden])
Date: 2006-10-12 14:47:44
On 10/12/06, Arkadiy Vertleyb <vertleyb_at_[hidden]> wrote:
> "Jeff Garland" <jeff_at_[hidden]> wrote
> > So a core goal of the library is that you can
> > use super_string in some code and then seamlessly pass that instance to
> > existing interfaces written in terms of std::string for zero cost.
>
> Not exactly... the cost would be runtime -- to allocate a copy of the
> string. You wouldn't be able to pass anything other than "std::string" to
> "const std::string&" without copying it first, would you?
Anything derived from std::basic_string<char> would work too. Super String is:
template<class char_type >
class basic_super_string : public std::basic_string<char_type>
So there would be no copies.
-- Caleb Epstein
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk