zengine-old/engine/3rdparty/zlib/test/refl_01.cpp

23 lines
500 B
C++
Raw Normal View History

2024-04-11 10:13:15 +08:00
#include "refl/vertex.h"
2024-04-14 22:45:08 +08:00
#include "refl/std/sarray.h"
#include <array>
struct object {
2024-04-13 17:47:44 +08:00
};
template<typename T>
2024-04-14 22:45:08 +08:00
void testInitObject(){
if constexpr (has_init_object<T>::value){
auto InitObject = &T::__InitObject;
}
2024-04-13 17:47:44 +08:00
}
int main() {
2024-04-14 22:45:08 +08:00
testInitObject<object>();
auto& cls = TypeInfo<vec3>::StaticClass;
auto field = cls.GetField(GetStaticField<vec3>("norm"));
int x = 10;
auto ov = cls.New<vec3>();
ov->norm(x, x);
field->Call<void>((void*)ov, 10, x);
2024-04-13 17:47:44 +08:00
std::cout << "hello world\n";
return 0;
}