Effective C++【学习笔记】Preface

C++编程精进指南
本书提供55项具体建议,旨在帮助程序员提升C++编程技能与设计水平,涵盖通用设计策略、特定语言特性及标准模板库(STL)使用技巧。书中每条建议均附有详尽解释,强调深思熟虑的应用而非盲目遵循。此外,还涉及命名规范、多线程考量及TR1和Boost库介绍。

摘抄:

55 specific ways to improve your programs and designs.

-------------------------------------------------------------------------------------

Introduction

  1. General design strategies
  2. The nuts and bolts of specific language features.

It’s a collection of 55 specific suggestions (I call them Items) for how you can improve your programs and designs.

---------------------------------------------------------------------------------------

Guidelines in this book, by their nature, have exceptions. That’s why each Item has an explanation. The explanations are the most important part of the book.

----------------------------------------------------------------------------------------

Blind application of the Items in this book is clearly inappropriate, but at the same time, you probably shouldn’t violate any of the guidelines without a good reason.

----------------------------------------------------------------------------------------

Read carefully when you see what appears to be an assignment, because the “=” syntax can also be used to call the copy constructor: Widget w3 = w2; // invoke copy constructor!

----------------------------------------------------------------------------------------

If a new object is being defined (such as w3 in the statement above), a constructor has to be called;

----------------------------------------------------------------------------------------

The STL is the Standard Template Library, the part of C++'s standard library devoted to containers(e.g., vector, list, set, map, etc), iterators (e.g., vector<int>::iterator, set<string>::iterator, etc.), algorithms(e.g., for_each, find, sort, etc.), and related functionality.

----------------------------------------------------------------------------------------

Naming conventions are like: mf means member functions

Threading considerations: The book is not about multithread programming with C++, but we can get useful tips when confront a multithread problem.

----------------------------------------------------------------------------------------

TR1 and Boost

TR1 ("Technical Report 1" ) is a specification for new functionality being added to C++'s standard library. This  functionality takes the form of new class and function templates for things like hash tables, reference-counting smart pointers, regular expressions, and more. All TR1 components are in the namespace tr1 that's nested inside the namespace std.

Boost is an organization and a web site offering portable, peer-reviewed, open source C++ library. Most TR1 functionality  is based on work done at Boost. and until compiler vendors include TR1 in their C++ library distributions, the Boost web site is likely to remain the first stop for developers looking for TR1 implementations. Boost offers more than is available in TR1, however, so it’s worth knowing about in any case.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值