C type traits裡哪些東西通過標準語言沒有可能實現而必須尋求編譯器內建支援?

時間 2021-06-02 11:03:05

1樓:叛逆者

2樓:梨梨喵

翻了一下MSVC的,能找到的大概有

// COMPILER SUPPORT MACROS

#define _IS_BASE_OF(_Base, _Der) \

: _Cat_base<__is_base_of(_Base, _Der)>

#define _IS_CONVERTIBLE(_From, _To) \

: _Cat_base<__is_convertible_to(_From, _To)>

#define _IS_UNION(_Ty) \

: _Cat_base<__is_union(_Ty)>

#define _IS_CLASS(_Ty) \

: _Cat_base<__is_class(_Ty)>

#define _IS_POD(_Ty) \

: _Cat_base<__is_pod(_Ty)>

#define _IS_EMPTY(_Ty) \

: _Cat_base<__is_empty(_Ty)>

#define _IS_POLYMORPHIC(_Ty) \

: _Cat_base<__is_polymorphic(_Ty)>

#define _IS_ABSTRACT(_Ty) \

: _Cat_base<__is_abstract(_Ty)>

#define _IS_STANDARD_LAYOUT(_Ty) \

: _Cat_base<__is_standard_layout(_Ty)>

#define _IS_TRIVIAL(_Ty) \

: _Cat_base<__is_trivial(_Ty)>

#define _HAS_TRIVIAL_DESTRUCTOR(_Ty) \

: _Cat_base<__has_trivial_destructor(_Ty)>

#define _HAS_VIRTUAL_DESTRUCTOR(_Ty) \

: _Cat_base<__has_virtual_destructor(_Ty)>

#define _UNDERLYING_TYPE(_Ty) \

__underlying_type(_Ty)

#define _IS_LITERAL_TYPE(_Ty) \

: _Cat_base<__is_literal_type(_Ty)>

#define _IS_ENUM(_Ty) \

: _Cat_base<__is_enum(_Ty)>

#define _IS_DESTRUCTIBLE(_Ty) \

: _Cat_base<__is_destructible(_Ty)>

#define _IS_NOTHROW_ASSIGNABLE(_To, _From) \

: _Cat_base<__is_nothrow_assignable(_To, _From)>

#define _IS_NOTHROW_DESTRUCTIBLE(_Ty) \

: _Cat_base<__is_nothrow_destructible(_Ty)>

#define _IS_TRIVIALLY_ASSIGNABLE(_To, _From) \

: _Cat_base<__is_trivially_assignable(_To, _From)>

#define _IS_CONSTRUCTIBLE \

__is_constructible

#define _IS_NOTHROW_CONSTRUCTIBLE \

__is_nothrow_constructible

#define _IS_TRIVIALLY_CONSTRUCTIBLE \

__is_trivially_constructible

對應的是:

is_base_of

is_convertible

is_union

is_class

is_pod

is_empty

is_polymorphic

is_abstract

is_standard_layout

is_trivial

has_trivial_destructor

has_virtual_destructor

underlying_type

is_literal_type

is_enum

is_destructible

is_nothrow_assignable

is_nothrow_destructible

is_trivially_assignable

is_constructible

is_nothrow_constructible

is_trivially_constructible

3樓:Sunchy321

翻了一下GCC的,能找到的大概有

is_enum

is_union

is_class

is_trivial

is_standard_layout

is_pod

is_literal_type

is_empty

is_polymorphic

is_abstract

has_trivial_assign

has_virtual_destructoris_base_of

underlying_type

這麼多。。

《這就是街舞》裡,AK東跳得好?

呵呵。本來對他沒有感覺。半決賽他那個莫名其妙的熱血高校贏了楊凱,就無語了。整個半決賽,最差的作品就他那個。凱哥就算失誤了,也比他那個作品好,bboy能把作品編成這樣真的很好。技巧完全贏他,完整性和銜接也很好。ak東那個全程無亮點,還比不上kk的作品熱血。他要是出場在後面基本就無緣8強。就一幫男人跳一...

東契奇有哪些厲害的地方?

球場莽夫 個人認為 東契奇在進入nba之前的背景 很值得一提。父親,斯洛維尼亞前國家隊男籃隊員,如今是一名職業教練。母親,國家級舞蹈家 職業跨欄運動員,如今擔任D77的全職助理。東契奇7歲接受正規籃球訓練。13歲簽約皇家馬德里。15歲公升入皇馬青年隊,成為領軍人物。16歲正式參加西甲職業聯賽,同時也...

如何評價《見字如面》裡的許子東?

蛋包咖哩蛋 為什麼回答裡都是噴女教授的?有點想不通。看第一季的時候許教授就給我的印象就不如女教授好。我倒是覺得許教授有些時候有點急。 胖頭大辣雞 如何評價?我以前孤陋寡聞沒聽說過人,後來他說了一句 它不是伊利諾伊的本校,他是伊利諾伊大學的香檳分校 凝凝 許老師思想超脫,觀點獨特,言辭犀利,見解深刻。...