Debian Codegraph @

.cargo/vendor/cbindgen/tests/expectations/array.cpp

raw
1 #include <cstdarg>
2 #include <cstdint>
3 #include <cstdlib>
4 #include <ostream>
5 #include <new>
6
7 struct Foo {
8 enum class Tag {
9 A,
10 };
11
12 struct A_Body {
13 float _0[20];
14 };
15
16 Tag tag;
17 union {
18 A_Body a;
19 };
20
21 static Foo A(const float (&_0)[20]) {
22 Foo result;
23 for (int i = 0; i < 20; i++) {
24 ::new (&result.a._0[i]) (float)(_0[i]);
25 }
26 result.tag = Tag::A;
27 return result;
28 }
29
30 bool IsA() const {
31 return tag == Tag::A;
32 }
33 };
34
35 extern "C" {
36
37 void root(Foo a);
38
39 } // extern "C"