API Design for C++的笔记(6)

>我来写笔记

按有用程度 按页码先后 最新笔记

  • Cynosure

    Cynosure (油腻的中年男子)

    2011-10-20 10:36   2人喜欢

  • Cynosure

    Cynosure (油腻的中年男子)

    Use explicit size-based types. The size of various types can differ by platform, compiler, and whether you are building a 32-bit or a 64-bit application. If you want to specify the exact size of a member variable, then you should use a type that specifically enforces this rather than assuming that types such as bool, short, or int will be a specific size. Unfortunately, the way to declare a f...

    2012-02-06 16:13

  • Cynosure

    Cynosure (油腻的中年男子)

    6.5.3 Adding Operators to a Class class Currency { public: explicit Currency(unsigned int value); Currency::~Currency(); Currency(const Currency &obj); Currency &operator (const Currency &rhs); Currency &operator þ (const Currency &rhs); Currency &operator (const Currency &rhs); Currency &operator * (const Currency &rhs); Currency &operator /...

    2012-02-03 17:53

  • Cynosure

    Cynosure (油腻的中年男子)

    CH 6.4.3 Explicit Instantiation API Design If you want to provide only a predetermined set of template specializations for your API and disallow your users from creating further ones, then you do in fact have the option of completely hiding your private code. In this case, you can put your template definitions into a .cpp file and use explicit template instantiation to instantiate those spec...

    2012-02-03 14:01

  • Cynosure

    Cynosure (油腻的中年男子)

    CH4.7 Function Design 4.7.4 Error Handling P148 By comparison, exceptions let your clients separate their error handling code from the normal flow of control, making for more readable code. They offer the benefit of being able to catch one or more errors in a sequence of several function calls, without having to check every single return code, and they let you handle an error higher u...

    2012-02-02 14:08

  • 豆瓣酱

    豆瓣酱

    Chapter2.Qualities What are the basic qualities of a good API? don't go over the top and try to create an object model that is more general than you need. 2.1Providing a abstracting interface 2.2 Hide implementation details physical and logical hiding. A declaration introduces the name and type of a symbol to the compiler. A definition provides the full details for that symbol, be i...

    2012-01-19 15:21

笔记是你写在书页留白边上的内容;是你阅读中的批注、摘抄及随感。

笔记必须是自己所写,不欢迎转载。摘抄原文的部分应该进行特殊标明。

API Design for C++

>API Design for C++