-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutil.cpp
More file actions
55 lines (42 loc) · 819 Bytes
/
Copy pathutil.cpp
File metadata and controls
55 lines (42 loc) · 819 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
#include "util.h"
#include<numeric>
#include "simdjson.h"
namespace tba{
std::vector<size_t> range(size_t lim){
std::vector<size_t> r(lim);
std::iota(begin(r),end(r),0);
return r;
}
std::vector<int> range(int start,int lim){
std::vector<int> r(lim-start);
std::iota(begin(r),end(r),start);
return r;
}
std::ostream& operator<<(std::ostream& o,std::nullptr_t){
return o<<"NULL";
}
double rand(double const*){
return std::rand();
}
short rand(short const*){
return std::rand();
}
int rand(int const*){
return std::rand();
}
long rand(long const*){
return std::rand();
}
unsigned rand(unsigned const*){
TBA_NYI
}
bool rand(bool const*){
return std::rand()%2;
}
std::nullptr_t rand(std::nullptr_t const*){
TBA_NYI
}
std::string rand(std::string const*){
return "foo"+as_string(std::rand());
}
}