Re: CString help
- From: "Mihai N." <nmihai_year_2000@xxxxxxxxx>
- Date: Tue, 26 Jun 2007 22:57:30 -0700
How are you reaching that (wrong) conclusion? Until I understand why you
say that, it's pointless to talk about its (non-existent) consequences.
The technique writes to &s[0]
operator[] is defined in terms of data().
But data is const value_type *data() const;
This means that the stuff pointed by data should not be changed, and
that the basic_string object itsef is not changed.
So writing in &(s.data()[0]) basically breaks this contract.
The fact that the buffer is contigous does not change this.
At least this is my reading. What is wrong here?
--
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
.
- Follow-Ups:
- Re: CString help
- From: Doug Harrison [MVP]
- Re: CString help
- References:
- Re: CString help
- From: Mihai N.
- Re: CString help
- From: Doug Harrison [MVP]
- Re: CString help
- From: Mihai N.
- Re: CString help
- From: Doug Harrison [MVP]
- Re: CString help
- From: Mihai N.
- Re: CString help
- From: Doug Harrison [MVP]
- Re: CString help
- From: Mihai N.
- Re: CString help
- From: Doug Harrison [MVP]
- Re: CString help
- From: Mihai N.
- Re: CString help
- From: Doug Harrison [MVP]
- Re: CString help
- From: Mihai N.
- Re: CString help
- From: Doug Harrison [MVP]
- Re: CString help
- Prev by Date: Re: CListCtrl derived class DestroyWindow not called in a Model Dialog
- Next by Date: Re: Why multiple inheritance fails
- Previous by thread: Re: CString help
- Next by thread: Re: CString help
- Index(es):
Relevant Pages
|