About unboxed_type_t
4kangjc opened this issue · 2 comments
4kangjc commented
flare/flare/base/future/basics.h
Lines 125 to 129 in d90635d
这个会不会更好点,更易于理解? common_type
有点难懂
template <class T0 = void, class... Ts>
struct unboxed_type {
using type = std::conditional_t<sizeof...(Ts) == 0, T0, std::tuple<T0, Ts...>>;
};
template <class... Ts>
using unboxed_type_t = typename unboxed_type<Ts...>::type;
0x804d8000 commented
两种写法其实倒无所谓写哪个,毕竟写模板的应该都对各种晦涩语法习惯了
不过确实应该有一个struct unboxed_type
,这儿直接using成了一连串东西可能是一开始写在了某个类内部后来挪出来了。写在类内部的时候我有时候喜欢直接using xxx_t = 一连串东西
,主要是图个省事
4kangjc commented
两种写法其实倒无所谓写哪个,毕竟写模板的应该都对各种晦涩语法习惯了
不过确实应该有一个
struct unboxed_type
,这儿直接using成了一连串东西可能是一开始写在了某个类内部后来挪出来了。写在类内部的时候我有时候喜欢直接using xxx_t = 一连串东西
,主要是图个省事
好的