免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: 无风之谷
打印 上一主题 下一主题

让我欢喜让我忧——我的C++之路 [复制链接]

论坛徽章:
0
861 [报告]
发表于 2012-04-22 13:01 |只看该作者
回复 804# pmerofc
是。
ISO C++11
3.9/7 Types bool, char, char16_t, char32_t, wchar_t, and the signed and unsigned integer types are collectively called integral types.48 A synonym for integral type is integer type. The representations of integral types shall define values by use of a pure binary numeration system.49 [ Example: this International Standard permits 2’s complement, 1’s complement and signed magnitude representations for integral types. —end example ]
4 Therefore, enumerations (7.2) are not integral; however, enumerations can be promoted to integral types as specified in 4.5.
49) A positional representation for integers that uses the binary digits 0 and 1, in which the values represented by successive bits are additive, begin with 1, and are multiplied by successive integral power of 2, except perhaps for the bit with the highest position. (Adapted from the American National Dictionary for Information Processing Systems.)

论坛徽章:
2
青铜圣斗士
日期:2015-11-26 06:15:59数据库技术版块每日发帖之星
日期:2016-07-24 06:20:00
862 [报告]
发表于 2012-04-22 13:06 |只看该作者
回复 831# walleeee

因为没有@功能,但又不想让你错过……  所以就选最近的一个回复了……


幻の上帝 发表于 2012-04-22 13:01
ISO C++11
3.9/7 Types bool, char, char16_t, char32_t, wchar_t, and the signed and unsigned integer types are collectively called integral types.


你要的char16_t, char32_t。。。  C++0x听见了……   C++11实现了……   至于编译器可能还得等……

论坛徽章:
2
程序设计版块每日发帖之星
日期:2015-06-17 22:20:00每日论坛发贴之星
日期:2015-06-17 22:20:00
863 [报告]
发表于 2012-04-22 13:12 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
864 [报告]
发表于 2012-04-22 13:13 |只看该作者
回复 821# walleeee

对象模型篇幅方面倒不能怪作者。只是语言的话的确可以两页就讲完。要是语言实现倒是可以写成一本书。

ISO C++11
1.8 The C++ object model [intro.object]
1 The constructs in a C++ program create, destroy, refer to, access, and manipulate objects. An object is a region of storage. [ Note: A function is not an object, regardless of whether or not it occupies storage in the way that objects do. —end note ] An object is created by a definition (3.1), by a new-expression (5.3.4) or by the implementation (12.2) when needed. The properties of an object are determined when the object is created. An object can have a name (Clause 3). An object has a storage duration (3.7) which influences its lifetime (3.. An object has a type (3.9). The term object type refers to the type with which the object is created. Some objects are polymorphic (10.3); the implementation generates information associated with each such object that makes it possible to determine that object’s type during program execution. For other objects, the interpretation of the values found therein is determined by the type of the expressions (Clause 5) used to access them.
2 Objects can contain other objects, called subobjects. A subobject can be a member subobject (9.2), a base class subobject (Clause 10), or an array element. An object that is not a subobject of any other object is called a complete object.
3 For every object x, there is some object called the complete object of x, determined as follows:
— If x is a complete object, then x is the complete object of x.
— Otherwise, the complete object of x is the complete object of the (unique) object that contains x.
4 If a complete object, a data member (9.2), or an array element is of class type, its type is considered the most derived class, to distinguish it from the class type of any base class subobject; an object of a most derived class type or of a non-class type is called a most derived object.
5 Unless it is a bit-field (9.6), a most derived object shall have a non-zero size and shall occupy one or more bytes of storage. Base class subobjects may have zero size. An object of trivially copyable or standard-layout type (3.9) shall occupy contiguous bytes of storage.
6 Unless an object is a bit-field or a base class subobject of zero size, the address of that object is the address of the first byte it occupies. Two objects that are not bit-fields may have the same address if one is a subobject of the other, or if at least one is a base class subobject of zero size and they are of different types; otherwise, they shall have distinct addresses.4
[ Example:
static const char test1 = ’x’;
static const char test2 = ’x’;
const bool b = &test1 != &test2; // always true
—end example ]
7 [ Note: C++ provides a variety of fundamental types and several ways of composing new types from existing types (3.9). —end note ]
以上。

论坛徽章:
2
青铜圣斗士
日期:2015-11-26 06:15:59数据库技术版块每日发帖之星
日期:2016-07-24 06:20:00
865 [报告]
发表于 2012-04-22 13:16 |只看该作者
本帖最后由 OwnWaterloo 于 2012-04-22 13:17 编辑

回复 866# 幻の上帝

嘿嘿,你觉得作者会这样讲么   
这又不是讲标准的书,也(终于抓到个用删除线的机会,手痒改一改)更不是讲实现的书,而是讲实践的。
至于怎么个实践法,又怎么用2页(?)纸说完,就看作者本事了

论坛徽章:
0
866 [报告]
发表于 2012-04-22 13:18 |只看该作者
回复 865# pmerofc

其实也是有的……不过同wchar_t的情况类似,不是内建支持的基本类型。
ISO C11(N1570)
7.28 Unicode utilities <uchar.h>
1 The header <uchar.h> declares types and functions for manipulating Unicode characters.
2 The types declared are mbstate_t (described in 7.30.1) and size_t (described in 7.19);
char16_t
which is an unsigned integer type used for 16-bit characters and is the same type as uint_least16_t (described in 7.20.1.2); and
char32_t
which is an unsigned integer type used for 32-bit characters and is the same type as uint_least32_t (also described in 7.20.1.2).

顺带提一下我关于“整型”以及相关说法相关的理解:
integer type显然是“整数类型”;
integral type按字面倒可以是“整型”,但既然ISO C++已经规定是integer type的同义词了,所以没必要用(用了只会使读者更迷糊),除非译著有术语表参照;
int type就应该是“int类型”。

论坛徽章:
0
867 [报告]
发表于 2012-04-22 13:21 |只看该作者
回复 867# OwnWaterloo

这个,老实说不带什么期望。
不过,2页就说完,不足以推论出这里就一定有问题(只是照现在作者表现的水平看我相信八成有问题)。

论坛徽章:
0
868 [报告]
发表于 2012-04-22 13:24 |只看该作者
回复 827# starwing83


    你对群众在这方面的平均资质似乎过于乐观了……

论坛徽章:
2
程序设计版块每日发帖之星
日期:2015-06-17 22:20:00每日论坛发贴之星
日期:2015-06-17 22:20:00
869 [报告]
发表于 2012-04-22 13:28 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
870 [报告]
发表于 2012-04-22 13:29 |只看该作者
回复 850# 陈良乔


怎么说呢……虽然不是native speaker,不过希望作者最好在自然语言上不要有太低级的错误……
>> because the original site is unstabitily. the new URL is

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP