forked from Ubpa/UDRefl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
35 lines (28 loc) · 779 Bytes
/
main.cpp
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
#include <UDRefl/UDRefl.hpp>
#include <iostream>
#include <cmath>
using namespace Ubpa;
using namespace Ubpa::UDRefl;
struct Arr {
int data[5];
};
int main() {
Mngr.RegisterType<Arr>();
Mngr.AddField<&Arr::data>("data");
std::cout
<< "//" << std::endl
<< "// int[5]" << std::endl
<< "///////////" << std::endl;
for (auto&& [name, info] : MethodRange_of<int[5]>)
std::cout << name.GetView() << std::endl;
auto arr = Mngr.MakeShared(Type_of<Arr>);
auto data = arr.Var("data");
for (std::size_t i{ 0 }; i < data.size(); ++i)
data[i] = i;
std::cout << "arr.data: ";
for (SharedObject ele : data)
std::cout << ele << " ";
std::cout << std::endl;
std::cout << "data.begin().next(1).next(2): " << *data.begin().next(1).next(2) << std::endl;
return 0;
}