最后,“指针”的发布候选者是“指针”。文件(指针介绍) [英] Finally, a release candidate of the "Pointers" document (introduction to pointers)

查看:54
本文介绍了最后,“指针”的发布候选者是“指针”。文件(指针介绍)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

还不完美,但是:

http://home.no.net/dubjai/win32cpptu...ters/ch_01.pdf
http://home.no.net/dubjai/win32cpptu...1_examples.zip


要访问目录,请使用书签和书签。 Adobe中的选项卡

Acrobat。


仍然欢迎评论,更正,赞美,尼特等等!


1指针。

1.1基础介绍。

1.1.1如何获取指向给定对象的指针,以及如何使用该指针。

1.1.2 nullpointer值,有效和无效指针。

1.1.3如何使用指针实现out-arguments。

1.1.4如何通过使用指针实现in-arguments。

1.1.5如何使用C ++样式引用而不是C样式指针作为参数。

1.1.6如何访问主参数。

1.1.7指针和引用的const正确性。

1.2运行时多态性。

1.2.1多态性。

1.2.2数据表示和链接数据结构的概念。

1.2.3带有模拟动态类型的C风格多态(只有一种实际类型)。

1.2.4动态内存分配的基本用法&取消分配。

1.2.5如何使用函数指针来模拟动态类型,C风格。

1.2.6对逻辑子类型使用实数类型和继承C风格。

1.2.7使用vtables,主要是C风格(也有关于抽象类等的几个词)。

1.2.8 C ++虚拟成员函数。

1.2.9 C ++析构函数和多态删除。

1.3动态分配对象的安全性。

1.3.1对象所有权和C ++ std :: auto_ptr。

1.3.2新的异常安全:RAII和C ++构造函数。

1.3.3使用C ++访问说明符& ;;确保动态分配。友情。

1.3.4抛开boost :: shared_ptr(又名std :: tr1 :: shared_ptr)。

1.3.5确保使用智能指针,通过重载operator new。

1.3.6通过删除对拷贝分配的访问来对抗切片。

1.3.7值复制问题&可能的解决方案。

1.3.8克隆作为所有权和别名问题的解决方案。

1.3.9故意共享作为所有权和别名问题的解决方案。

1.4异常介绍。

1.4.1如何生成和处理异常。

1.4.2异常使用示例:数值和文本之间的转换。

1.4.3例外和指针,包括硬的概念例外。

1.5基本序列化和反序列化。

1.5.1分层数据结构的序列化格式。

1.5.2序列化:一个简单的非OO递归下降解析器。

1.5.3序列化:使用侵入式OO代码的简单生成器。

1.5.4使用非侵入式非生成器的生成器-OO代码(介绍C ++ RTTI)。

1.5.5使用非侵入式OO代码的生成器(引入访问者模式)。

1.6关于C ++继承的注意事项属于指针。

1.6.1通过引用传递Base / Derived-class指针。

1.6.2 Liskov替换原则(更多关于mutable / immutable)。 />
1.6.3协方差,逆变和不变性。

1.7结束语和&确认。


-

答:因为它弄乱了人们通常阅读文字的顺序。

问:为什么这是一件坏事吗?

A:热门发布。

问:usenet和电子邮件中最烦人的是什么?

解决方案

您好Alf P. Steinbach,


您的PDF看起来非常整洁。刚才我已经下载了你的

PDF ..


你可以给出关于你的工作的总结,原因是

工作,你对读者的期望等等。


谢谢


Gopal


[后续设置为acllcc ++]


Alf P. Steinbach说:

尚未完美,但是:< > http:// home .no.net / dubjai / win32cpptu ... ters / ch_01.pdf




GhostView不喜欢它。它在我尝试的每一页上都给出了一个错误(10或

所以)。只是空白页。


由于我没有(也不想拥有)Adobe Acrobat,我无法支付
审查文件。


不抱怨 - 只是让你知道。


-

Richard Heathfield

Usenet是一个奇怪的地方 - dmr 29/7/1999
http://www.cpax.org.uk

电子邮件:rjh在上面的域名(但显然放弃了www)


Alf P. Steinbach写道:

尚未完美,但是:

http://home.no.net/dubjai/win32cpptu...ters/ch_01.pdf
http://home.no.net/dubjai/win32cpptu...1_examples.zip
要访问目录,请使用书签和书签。 Adobe中的选项卡
Acrobat。

评论,更正,赞美,尼特等仍然受到欢迎!



与此无关指针的东西,但这个碎片来自你的

in_by_pointer.cpp


typedef std :: vector< int> IntVector;

..

..

..

double sum = 0.0;

for(std :: size_t i = 0; i< pNumbers-> size(); ++ i)

{

sum + = pNumbers- > at(i);

}


出现了一个问题:循环变量的(最)正确类型是什么
$ b上面这样的for循环中的$ b?

因为std :: vector<> .size()返回一个std :: vector<> :: size_type,shouldn'这个




double sum = 0.0;

for(IntVector :: size_type i = 0; i< pNumbers-> size(); ++ i)

{

sum + = pNumbers-> at(i);

}


在我的实现中,std :: vector<> :: size_type只是

std :: size_t的typedef,但这有保证吗?


Not yet perfect, but:

http://home.no.net/dubjai/win32cpptu...ters/ch_01.pdf
http://home.no.net/dubjai/win32cpptu...1_examples.zip

To access the table of contents, use the "Bookmarks" tab in Adobe
Acrobat.

Comments, corrections, praise, nits, etc., are still welcome!

1 Pointers.
1.1 Introduction to the basics.
1.1.1 How to obtain a pointer to a given object, and how to use that pointer.
1.1.2 The nullpointer value, valid and invalid pointers.
1.1.3 How to implement out-arguments by using pointers.
1.1.4 How to implement in-arguments by using pointers.
1.1.5 How to use C++ style references instead of C style pointers for arguments.
1.1.6 How to access main arguments.
1.1.7 Const-correctness for pointers and references.
1.2 Run-time polymorphism.
1.2.1 Polymorphism.
1.2.2 The concepts of data representations and linked data structures.
1.2.3 C-style polymorphism with simulated dynamic types (just one actual type).
1.2.4 Basic use of dynamic memory allocation & deallocation.
1.2.5 How to use function pointers to simulate dynamic types, C-style.
1.2.6 Using real types and inheritance for logical sub-types, mostly C-style.
1.2.7 Using vtables, mostly C-style (also a few words about abstract classes, etc.).
1.2.8 C++ virtual member functions.
1.2.9 C++ destructors and polymorphic delete.
1.3 Safety for dynamically allocated objects.
1.3.1 Object ownership and the C++ std::auto_ptr.
1.3.2 Exception safety for new: RAII and C++ constructors.
1.3.3 Ensure dynamic allocation by using C++ access specifiers & friendship.
1.3.4 An aside on wrapping boost::shared_ptr (a.k.a. std::tr1::shared_ptr).
1.3.5 Ensure that smart pointers are used, by overloading operator new.
1.3.6 Combat slicing by removing access to copy assignment.
1.3.7 Value copying problems & possible solutions.
1.3.8 Cloning as a solution to ownership and aliasing problems.
1.3.9 Intentional sharing as a solution to ownership and aliasing problems.
1.4 An introduction to exceptions.
1.4.1 How to generate and handle exceptions.
1.4.2 Exception usage example: conversion between numeric values and text.
1.4.3 Exceptions and pointers, including the concept of "hard" exceptions.
1.5 Basic serialization and de-serialization.
1.5.1 A serialization format for hierarchical data structures.
1.5.2 De-serialization: a simple non-OO recursive descent parser.
1.5.3 Serialization: a simple generator using intrusive OO code.
1.5.4 A generator using non-intrusive non-OO code (introducing C++ RTTI).
1.5.5 A generator using non-intrusive OO code (introducing the visitor pattern).
1.6 Notes on C++ inheritance as it pertains to pointers.
1.6.1 Passing Base/Derived-class pointers by reference.
1.6.2 The Liskov substitution principle (more about mutable/immutable).
1.6.3 Covariance, contravariance and invariance.
1.7 Closing words & acknowledgements.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

解决方案

Hi Alf P. Steinbach,

Your PDF looks very neat at first look. Just now I have downloaded your
PDF..

You could have given the summary about your work, the reason for the
work, what you expect from the readers etc..

Thanks

Gopal


[Followups set to acllcc++]

Alf P. Steinbach said:

Not yet perfect, but:

http://home.no.net/dubjai/win32cpptu...ters/ch_01.pdf



GhostView doesn''t like it. It gave an error on every page I tried (ten or
so). Just blank pages.

Since I don''t have (and don''t want to have) Adobe Acrobat, I was unable to
review the document.

Not complaining - just letting you know.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)


Alf P. Steinbach wrote:

Not yet perfect, but:

http://home.no.net/dubjai/win32cpptu...ters/ch_01.pdf
http://home.no.net/dubjai/win32cpptu...1_examples.zip
To access the table of contents, use the "Bookmarks" tab in Adobe
Acrobat.

Comments, corrections, praise, nits, etc., are still welcome!


It has nothing to do with the pointer stuff, but this fragment from your
in_by_pointer.cpp

typedef std::vector<int> IntVector;
..
..
..
double sum = 0.0;
for( std::size_t i = 0; i < pNumbers->size(); ++i )
{
sum += pNumbers->at( i );
}

arises the question: What is the (most) correct type for the loop variable
in such a for-loop as above?

As std::vector<>.size() returns a std::vector<>::size_type, shouldn''t this
be

double sum = 0.0;
for( IntVector::size_type i = 0; i < pNumbers->size(); ++i )
{
sum += pNumbers->at( i );
}

In my implementation std::vector<>::size_type is just a typedef for
std::size_t, but is this guaranteed?


这篇关于最后,“指针”的发布候选者是“指针”。文件(指针介绍)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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