Skip to content

Commit fafec30

Browse files
authored
Merge pull request #71 from lglina/master
Fix broken std::string assign()
2 parents 007aa19 + 4d3a049 commit fafec30

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/string

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,13 @@ public:
202202
r = n;
203203
}
204204
resize(r);
205-
Tr::copy(vector<Ch, A>::data, str.vector<Ch, A>::data + pos, r);
205+
Tr::copy(vector<Ch, A>::data_, str.vector<Ch, A>::data_ + pos, r);
206206
return *this;
207207
}
208208

209209
_UCXXEXPORT basic_string& assign(const Ch* s, size_type n){
210210
resize(n);
211-
Tr::copy(vector<Ch, A>::data, s, n);
211+
Tr::copy(vector<Ch, A>::data_, s, n);
212212
return *this;
213213
}
214214

@@ -246,8 +246,8 @@ public:
246246
}
247247
size_type temp = vector<Ch, A>::elements;
248248
resize(vector<Ch, A>::elements + r);
249-
Tr::move(vector<Ch, A>::data + pos1 + r, vector<Ch, A>::data + pos1, temp - pos1);
250-
Tr::copy(vector<Ch, A>::data + pos1, str.vector<Ch, A>::data + pos2, r);
249+
Tr::move(vector<Ch, A>::data_ + pos1 + r, vector<Ch, A>::data_ + pos1, temp - pos1);
250+
Tr::copy(vector<Ch, A>::data_ + pos1, str.vector<Ch, A>::data_ + pos2, r);
251251
return *this;
252252
}
253253

@@ -279,8 +279,8 @@ public:
279279
}
280280
size_type temp = vector<Ch, A>::elements;
281281
resize(vector<Ch, A>::elements + n);
282-
Tr::move(vector<Ch, A>::data + pos + n, vector<Ch, A>::data + pos, temp - pos);
283-
Tr::assign(vector<Ch, A>::data + pos, n, c);
282+
Tr::move(vector<Ch, A>::data_ + pos + n, vector<Ch, A>::data_ + pos, temp - pos);
283+
Tr::assign(vector<Ch, A>::data_ + pos, n, c);
284284
return *this;
285285
}
286286

@@ -296,7 +296,7 @@ public:
296296
}
297297
size_type temp = vector<Ch, A>::elements;
298298

299-
Tr::move(vector<Ch, A>::data + pos, vector<Ch, A>::data + pos + xlen, temp - pos - xlen);
299+
Tr::move(vector<Ch, A>::data_ + pos, vector<Ch, A>::data_ + pos + xlen, temp - pos - xlen);
300300
resize(temp - xlen);
301301
return *this;
302302
}
@@ -361,8 +361,8 @@ public:
361361
//Initial block is of size pos1
362362
//Block 2 is of size len
363363

364-
Tr::move(vector<Ch, A>::data + pos1 + rlen, vector<Ch, A>::data + pos1 + xlen, temp - pos1 - xlen);
365-
Tr::copy(vector<Ch, A>::data + pos1, str.vector<Ch, A>::data + pos2, rlen);
364+
Tr::move(vector<Ch, A>::data_ + pos1 + rlen, vector<Ch, A>::data_ + pos1 + xlen, temp - pos1 - xlen);
365+
Tr::copy(vector<Ch, A>::data_ + pos1, str.vector<Ch, A>::data_ + pos2, rlen);
366366
resize(temp - xlen + rlen);
367367
return *this;
368368
}
@@ -394,7 +394,7 @@ public:
394394
if(r > n){
395395
r = n;
396396
}
397-
Tr::copy(s, vector<Ch, A>::data + pos, r);
397+
Tr::copy(s, vector<Ch, A>::data_ + pos, r);
398398
return r;
399399
}
400400

@@ -605,7 +605,7 @@ public:
605605
if(rlen > len2){
606606
rlen = len2;
607607
}
608-
int retval = Tr::compare(vector<Ch, A>::data + pos1, str.vector<Ch, A>::data + pos2, rlen);
608+
int retval = Tr::compare(vector<Ch, A>::data_ + pos1, str.vector<Ch, A>::data_ + pos2, rlen);
609609
if(retval == 0){
610610
if(len1 < len2){
611611
retval = -1;
@@ -649,7 +649,7 @@ public:
649649
if(rlen > len2){
650650
rlen = len2;
651651
}
652-
int retval = Tr::compare(vector<Ch, A>::data + pos1, s, rlen);
652+
int retval = Tr::compare(vector<Ch, A>::data_ + pos1, s, rlen);
653653
if(retval == 0){
654654
if(len1 < len2){
655655
retval = -1;

0 commit comments

Comments
 (0)