Subject: Re: [boost] [string_ref] type erasure to support arbitrary strings
From: Andreas Pokorny (andreas.pokorny_at_[hidden])
Date: 2013-01-31 07:38:22
2013/1/30 Jeffrey Lee Hellrung, Jr. <jeffrey.hellrung_at_[hidden]>:
> It's somewhat of a compromise as a string_ref has very little access
> overhead compared to using a std::string or similar directly (I would think
> the only overhead, if any, is in the construction of the string_ref). A
> type-erased reference to a range of characters would have quite a bit of
> access overhead (everything would rely on dynamic dispatching).
Yes that is the reason why I always resisted from declaring a more
dynamic string interface. Never noticed or accepted the need. But well
there is now string_ref. Why stop halfways? Is it a case of paying for
something that you dont need (always)?
> That said, there are certainly situations (e.g., module boundaries) where a
> type-erased string could make sense; for such situations, take a look at
> any_range within Boost.Range.
Thank you - have not seen that yet.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk