-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathsplit_iterator_compile.cpp
More file actions
executable file
·67 lines (57 loc) · 1.19 KB
/
Copy pathsplit_iterator_compile.cpp
File metadata and controls
executable file
·67 lines (57 loc) · 1.19 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
#define _SCL_SECURE_NO_WARNINGS
#include "split_iterator.h"
#include <string>
void foo()
{
typedef string_ref<char> sref;
std::string s = "1,2,3,4";
sref r0;
(void)r0;
sref r1(s);
sref r2("hello");
sref r3("hello", 5);
sref r4(r1);
r4 = r1;
(void)(r2 == r3);
(void)(r2 != r3);
(void)(r2 < r3);
(void)(r2 > r3);
(void)(r2 <= r3);
(void)(r2 >= r3);
(void)(r2 == "hello");
(void)("hello" == r2);
(void)(r2 == s);
(void)(s == r2);
sref r5 = r2.substr(1, 3);
(void)r5;
(void)r2.find('e');
(void)r2.find("ll");
(void)r2.find(sref("ll"));
sref ri("12345");
(void)to_value<int>(ri);
sref rd("3.14");
(void)to_value<double>(rd);
(void)to_string(ri);
for(auto v : make_split(s, ','))
{
(void)v;
}
std::string s2 = "a, b, c";
for(auto v : make_split(s2, ", "))
{
(void)v;
}
std::string s3 = "a,b;c,d";
for(auto v : make_split_any_of(s3, ",;"))
{
(void)v;
}
auto c = make_split(s, ',');
(void)c.size();
auto p = c.split2();
(void)p;
int a = 0, b = 0, d = 0;
(void)c.fill(a, b, d);
(void)c[0];
(void)c[2];
}