RFoe / coasync

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

serde_stream中对序列化类型的requires子句过于复杂,需要重构 #19

Closed RFoe closed 1 month ago

RFoe commented 2 months ago

https://github.com/RFoe/coasync/blob/8bab4cc8c00e5f61db263c39ba2c229919704c68/include/coasync/detail/meta/serde_stream_base.hpp#L244 https://github.com/RFoe/coasync/blob/8bab4cc8c00e5f61db263c39ba2c229919704c68/include/coasync/detail/meta/serde_stream_base.hpp#L173 https://github.com/RFoe/coasync/blob/8bab4cc8c00e5f61db263c39ba2c229919704c68/include/coasync/detail/meta/serde_stream_base.hpp#L160

或许是这样

if constexpr(small_integral<T>) {
    serialize_impl(small_integral_tag, value);
} else if constexpr(customized<T>) {
    serialize_impl(customized_tag<T>, value)
} else if constexpr(...) {
    // ...
}