RFoe / coasync

Asynchronous network library that supports coroutines in C++20
https://github.com/RFoe/coasync
MIT License
18 stars 3 forks source link

序列化类型编码使用rtti,提供替代方案 #5

Open RFoe opened 4 weeks ago

RFoe commented 4 weeks ago

https://github.com/RFoe/coasync/blob/a466688370ce4bc5feefc8a55d960de447dfbfde/include/coasync/detail/meta/serde_stream_base.hpp#L163

或许是这样

#if __cpp_rtti
std::type_index{ typeid(T) }.hash_code()
#else
static_hash<signature<T>()>()
#endif