-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFakeList.cpp
More file actions
55 lines (40 loc) · 858 Bytes
/
FakeList.cpp
File metadata and controls
55 lines (40 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//
// Created by ABacker on 9/5/2016
//
#include "FakeList.h"
#include <list>
#include <cstring>
#include <iostream>
#define CRTDBG_MAP_ALLOC
using namespace std;
using namespace nini;
string_builder build() {
string_builder sb;
char *s = new char[15];
strcpy(s, "1234567890");
sb.assign(std::move(s), strlen(s));
sb.append("1234567890");
sb.insert("aacc", 4, 10);
sb.insert("ddeeff", 6, 4);
sb.insert("cccc", 4, 6);
auto it_insert = sb.begin();
it_insert += 4;
sb.insert("bbb", 3, it_insert);
sb.print(true);
return sb;
}
void test_operator() {
printf("test_operator\n");
string_builder sb1 = build();
sb1 += "test_operator";
sb1.print(true);
string_builder sb2 = build();
sb1 += std::move(sb2);
sb1.print(true);
//string_builder sb3 = sb1 + sb2;
}
int main() {
test_operator();
string_builder sb = "xxx";
return 0;
}