《The C++ Standard Library》第41页 不要误解了这段话
2007-09-20 17:54
549 查看
41页靠下有这样一段话:
这段话的意思是说不能把一个指针用assignment的方式直接赋给auto_ptr, 要用它的值来直接初始化。 而不是说auto_ptr不能用assignment的方式来初始化。 但是,auto_ptr用assignment的方式初始化的时候,只能用auto_ptr做为assignment的右边。下面的两个自已一个是用copy constructor的方式,另一个是用assignment的方式: 1. Copy constructor
2. assignment
这段话的意思是说不能把一个指针用assignment的方式直接赋给auto_ptr, 要用它的值来直接初始化。 而不是说auto_ptr不能用assignment的方式来初始化。 但是,auto_ptr用assignment的方式初始化的时候,只能用auto_ptr做为assignment的右边。下面的两个自已一个是用copy constructor的方式,另一个是用assignment的方式: 1. Copy constructor
2. assignment
相关文章推荐
- Beyond the C++ Standard Library中文版pdf
- Power up C++ with the Standard Template Library: Part I[翻译]
- Power up C++ with the Standard Template Library:Part II: Advanced Uses [翻译]
- 错误:fatal error C1189: #error : The C++ Standard Library forbids macroizing keywords. Enable warning
- The C++ Standard Library 学习笔记(一)1 - 4 章
- 《The C++ Standard Library》第45页 用const修饰auto_ptr的注意事项
- The C++ Standard Library 学习笔记(一)第5章
- C++11新特性——The C++ standard library, 2nd Edition 笔记(一)
- the boost graph library && Beyond the C++ Standard Library(boost中文版)
- use the Standard C++ Library in symbian
- The C++ Standard Library Extensions: A Tutorial and Reference
- Power up C++ with the Standard Template Library: Part 1
- Beyond the C++ Standard Library: An Introduction to Boost -- Library 5.2 Usage
- 《The C++ Standard Library》第50页 关于传递auto_ptr的问题
- 《The C++ Standard Library》读书笔记
- C++中使用array报错 requires compiler and library surpport for the ISO c++ 2011 standard
- The C++ Standard Library 学习笔记(一)第6章
- Thread Safety in the Standard C++ Library
- 个人翻译Beyond the C++ Standard Library
- error This file requires compiler and library support for the ISO C++ 2011 standard