Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2006-01-31 12:00:06


Greer, Joe wrote:
>
>> -----Original Message-----
>> On Behalf Of David Abrahams
>>
>> std::string str(30, 0);
>> someoldcapi(&str[0]);
>> str.resize(str.find(0));
>> str.find(...)
>>
>
> I didn't think strings were guaranteed to be contiguous, or did that get
> slipped in when I wasn't looking?
>

Sadly, you're correct. strings are not guaranteed to be contiguous. I'm
not aware of a std library that takes advantage of that leeway, though.

-- 
Eric Niebler
Boost Consulting
www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk