C++-Effective C++ Items】的更多相关文章

Item2:尽量以const,enum,inline替换#define 原因:1, #define ASPECT_RATIO 1.63 编译错误时产生魔数,应以const double Aspect_Ratio = 1.63替换 2, #define不能提供作用域,如某个类的常量 class GamePlayer{ private: static const int = 1024; int scores[NumTruns]; }; 上面的类也可以通过下面的enum实现, 但是此种实现更像是def…
write by 九天雁翎(JTianLing) -- blog.csdn.net/vagrxie 讨论新闻组及文件 一.   综述 <异常处理与MiniDump详解(1) C++异常>稍微回顾了下C++异常的语法及其类似于函数参数传递的抛出异常对象的copy,引用语义,但是有个问题没有详细讲,那就是C++异常的绝佳搭档,智能指针.在没有智能指针的时候会感觉C++的异常少了一个用于释放资源的finally语法,但是C++没有这样的语法是有理由的,因为C++的智能指针.假如不用智能指针仅仅使用异…
[construction of tuples containing 0 or 1 items] the syntax has some extra quirks to accommodate these. Empty tuples are constructed by an empty pair of parentheses; a tuple with one item is constructed by following a value with a comma (it is not su…
I was recently invited to speak at a conference in Singapore on Effective Project Communications. I'm unable to attend, so I wanted to share my insights on this very important topic in a blog entry. As a Project Manager, communication will occur in m…
哈哈,各位园友新年快乐!愚安好久没在园子里写东西了,这次决定针对javascript做一个系列,叫做<小王子浅读Effective javascript>,主要是按照David Herman的<Effective javascript>的内容做一些解读和扩展.原书中有68点针对javascript编程的小tips,很是经典,园友们也可以网上找找PDF读一下,写的很不错,也可以买买原著读读,提醒下,这本书的中文译本也已经出了.为什么叫“浅读”,一方面是愚安并不是专业javascrip…
Seven habits of effective text editing(via) Bram Moolenaar November 2000 If you spend a lot of time typing plain text, writing programs or HTML, you can save much of that time by using a good editor and using it effectively. This paper will present g…
Effective TensorFlow Table of Contents TensorFlow Basics Understanding static and dynamic shapes Scopes and when to use them Broadcasting the good and the ugly Feeding data to TensorFlow Take advantage of the overloaded operators Understanding order…
Effective Go  高效的go语言 Introduction 介绍 Examples 例子 Formatting 格式 Commentary 评论 Names 名字 Package names 包名 Getters Interface names 接口名 MixedCaps Semicolons 分号 Control structures 控制结构/循环结构 If Redeclaration and reassignment For Switch Type switch Function…
<Item 18> Make interfaces easy to use correctly and hard to use incorrectly 1.That being the case, if they use one incorrectly, your interface is at least partially to blame. Ideally, if an attempted use of an interface won't do what the client expe…
阅读effective c++ 04 (30页) 提到的static对象和堆与栈对象.看了看侯老师的内存管理视频1~3.有点深. 了解一下. 目录 1 内存管理 1.1 C++内存管理详解 1.1.1 内存分配方式 1.1.2 控制C++的内存分配 1.1.3 常见的内存错误及其对策 1.1.4 指针与数组的对比 1.1.5 指针参数是如何传递内存的? 1.1.6 杜绝"野指针" 1.1.7 有了malloc/free为什么还要new/delete? 1.1.8 内存耗尽怎么办? 1.…