|
Boost : |
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2024-05-27 21:09:11
El 26/05/2024 a las 22:53, Marc Glisse via Boost escribió:
>
> I didn't have much success with a quick google search either, so I'll
> have to go from memory. I seem to remember from previous discussions on
> the subject that there were several partial implementations in the wild,
> with one in a famous web browser in particular, but that was a long time
> ago.
>
> On the other hand, the reference-counted version of std::string that
> libstdc++ can still use in compatibility mode does use this strategy of
> a pointer to a region that contains both a header and the actual elements.
> https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=libstdc%2B%2B-v3/include/bits/cow_string.h;h=5d81bfc1230e44fc841098148586f6ca1e4770d1;hb=HEAD#l72
Good, I'll check it.
> My use-case (though we did something else in the end) would have been
> for a tree where nodes can have an arbitrary number of children, and
> leaves are more numerous than internal nodes. The vector would have been
> hidden in a flat_map.
Understood. Thanks for the use-case.
Best,
Ion
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk