C ++ 11:intptr_t / int_ptr_t,intmax_t / int_max_t? [英] C++11: intptr_t/int_ptr_t, intmax_t/int_max_t?

查看:492
本文介绍了C ++ 11:intptr_t / int_ptr_t,intmax_t / int_max_t?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在c ++ 11上做了一些阅读,我注意到了一些关于int类型名称的事情。现在,显然规范只能通过支付,但是有一个从2月的早期草案可以在 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf

I'm doing a bit of reading on c++11 and I've noticed a couple things about int type names. Right now, apparently the spec is only available by paying for it but there is an early draft from February available at http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf

但是我注意到在c ++ 11维基百科页面en.cppreference.com上引用的网站,这是一对标准整数类型的差异。

However I noticed on a website which is cited on the c++11 wikipedia page, en.cppreference.com, a discrepency in a couple of the standard integer types.

http://en.cppreference.com/的网页w / cpp / types / integer 提到各种固定宽度整数类型,还包括 int_max_t int_ptr_t 。但是上面链接的使用 intmax_t intptr_t (没有中间下划线)在例如MS的 crtdefs.h 和boost的 cstdint.hpp

The page at http://en.cppreference.com/w/cpp/types/integer mentions various fixed-width integer types, and also int_max_t and int_ptr_t. However the spec linked above uses intmax_t and intptr_t (without the middle underscore) which I am used to and which already exists in, for example, MS's crtdefs.h, and boost's cstdint.hpp. Is this likely just a typo on the website, did this change in the spec since the February draft?

编辑删除了有关头文件的内容,这是不相关的。

Edit Removed stuff about the header files, it was irrelevant.

推荐答案

是的,这只是在网站上的拼写错误。从FDIS,§18.4.1( Header< cstdint>摘要):

Yes, it's just a typo on the website. From the FDIS, §18.4.1 (Header <cstdint> synopsis):


namespace std {

      ...

    ; typedef 有符号整型 intmax_t;

  ;  typedef 有符号整型 intptr_t; // 可选

     ...

   typedef 无符号整型 uintmax_t;

    typedef 无符号整型 uintptr_t; // 可选

} // namespace std

namespace std {
     ...
   typedef signed integer type intmax_t;
   typedef signed integer type intptr_t; //optional
     ...
   typedef unsigned integer type uintmax_t;
   typedef unsigned integer type uintptr_t; //optional
} //namespace std

这篇关于C ++ 11:intptr_t / int_ptr_t,intmax_t / int_max_t?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆