[英]c++ template struct “using type = struct_name”
template <::size_t... Is>
struct int_pack {
using type = int_pack;
};
using type = int_pack
? using type = struct_name
的模式時,是否有任何特定用法? 您不需要using type = int_pack
,這只是編寫int_pack
一種較短方法。
type
通常在type_traits
用於元編程。 例如,如果std::enable_if
的模板參數為true
則定義一個名稱type
。 這些幫助程序功能/結構中有更多定義名稱type
。 它只是一個名字,就像在for循環索引中使用i
一樣。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.