forked from uncrustify/uncrustify
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplates.cpp
More file actions
147 lines (114 loc) · 2.22 KB
/
templates.cpp
File metadata and controls
147 lines (114 loc) · 2.22 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#include <list>
#include <map>
#include <vector>
class MyClass
{
public:
std::map < int, bool > someData;
std::map < int, std::list < bool > > otherData;
};
void foo()
{
List < byte >bob = new List<byte> ();
}
A<B> foo;
A<B,C> bar;
A<B*> baz;
A<B<C> > bay;
void asd(void)
{
A<B> foo;
A<B,C> bar;
A<B*> baz;
A<B<C> > bay;
if (a < b && b > c)
{
a = b < c > 0;
}
if (a < bar() > c)
{
}
a < up_lim() ? do_hi() : do_low;
a[ a<b>c] = d;
}
template<typename T> class MyClass
{
}
template<typename T>
class MyClass
{
}
template<typename A, typename B, typename C> class MyClass : myvar(0),
myvar2(0)
{
}
template<typename A, typename B, typename C> class MyClass
: myvar(0),
myvar2(0)
{
}
static int max_value()
{
return (std :: numeric_limits <int >:: max ) ();
}
template < class Config_ >
priority_queue < Config_ > :: ~ priority_queue () {
}
template<class T>
T test(T a) {
return a;
}
int main() {
int k,j;
h g<int>;
k=test<int>(j);
return 0;
}
template<typename T, template<typename, unsigned int, unsigned int> class ConcreteStorageClass>
class RotationMatrix
: public StaticBaseMatrix<T, 3, 3, ConcreteStorageClass>
{
public:
RotationMatrix()
: StaticBaseMatrix<T, 3, 3, ConcreteStorageClass>()
{
// do some initialization
}
void assign(const OtherClass<T, 3, 3 >& other)
{
// do something
}
};
int main()
{
MyClass<double, 3, 3, MyStorage> foo;
}
template< typename CharT, int N, typename Traits >
inline std::basic_ostream<CharT,Traits>& FWStreamOut(std::basic_ostream<CharT,Traits> &os,
const W::S<CharT,N,Traits> &s)
{
return operator<< <CharT, N, Traits, char, std::char_traits<char> >( os, s );
}
struct foo {
type1 < int & > bar;
};
struct foo {
type1 < int const > bar;
};
template <int i> void f();
template <int i> void g() {
f<i-1>();
f< i >();
f<i+1>();
f<bar()>();
}
void h() { g<42>(); }
#include <vector>
std::vector<int> A(2);
std::vector<int> B;
std::vector<int>C(2);
std::vector<int>D;
template<class T>struct X{template<class U>void operator()(U);};
template<class T>class Y{template<class V>void f(V);};
void (* foobar)(void) = NULL;
std::vector<void (*)(void)> functions;