简体   繁体   中英

Is a naked char32_t signed or unsigned?

Similarly, is a naked char16_t signed or unsigned? Is it implementation defined?

From the standard (pre-C++11 draft n3290, or post-C++11 draft n3337) §3.9.1 Fundamental types :

Types char16_t and char32_t denote distinct types with the same size, signedness, and alignment as uint_least16_t and uint_least32_t , respectively, in <stdint.h> , called the underlying types.

uint_least16_t and uint_least32_t are both unsigned (from §18.4.1 Header <cstdint> synopsis ), so same for char16_t and char32_t .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM