|
Boost : |
Subject: Re: [boost] [string] proposal
From: Ivan Le Lann (ivan.lelann_at_[hidden])
Date: 2011-01-29 05:41:09
----- "Patrick Horgan" <phorgan1_at_[hidden]> a écrit :
> On 01/28/2011 09:59 AM, Dean Michael Berris wrote:
> > On Fri, Jan 28, 2011 at 7:20 PM, Dean Michael Berris
> > <mikhailberis_at_[hidden]> wrote:
> >> So the interface I was thinking about (and suggesting) is a lot
> more
> >> minimal than what rope or std::string have exposed. I think when I
> do
> >> finish that design document (with rationale) it would be clear why
> I
> >> would like to keep it immutable and why I would prefer it still be
> >> called a string.
> >>
> >> Let me finish that document -- expect something over the weekend.
> :)
> >>
> > And I stopped before I write too much -- the initial version is
> > already up:
> https://github.com/downloads/mikhailberis/cpp-string-theory/cpp-string-theory.pdf
> > -- I'll give it more information and the actual interfaces and
> > implementation as soon as I get some Z's. :)
> >
> You mention that your string is thread safe by design, but you only
> solve the problem of mutating the data of a string, your references to
> the pieces from which you compose a string are not thread safe, since
> they are mutable, right?
I don't think so. Isn't the easiest way towards proper composition to consider
that the whole is the same as the part?
I see the "chain" (I voted for that one!) as an immutable tree of immutable leafs.
I think this can be naïvely seen as the following recursive boost::variant:
boost::make_recursive_variant <
boost::shared_ptr <const std::basic_string <code_unit_type>>,
boost::shared_ptr <const std::list <boost::recursive_variant_>>
>::type
Ivan
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk