Effective C++: 50 Specific Ways to Improve Your Programs and by Scott Meyers

By Scott Meyers

The 1st variation of potent C++ bought approximately 100,000 copies and used to be translated into 4 languages. it is simple to appreciate why. Scott Meyers' sensible method of C++ defined the foundations of thumb hired via the experts-the issues they frequently do or typically keep away from doing-to produce transparent, right, effective code. each one of this book's 50 guidance summarizes the way to write higher C++, and the accompanying discussions are subsidized by way of particular examples. For this re-creation, Meyers transformed each guide within the publication. the result's extraordinary adherence to C++'s Draft overseas ordinary, present compiler expertise, and the newest insights into using C++ for real-world purposes

Show description

Read Online or Download Effective C++: 50 Specific Ways to Improve Your Programs and Design PDF

Best c & c++ windows programming books

The standard C library

Prentice Hall's most crucial C programming identify in years. A spouse quantity to Kernighan & Ritchie's c program languageperiod. a set of reusable features (code for development info constructions, code for appearing math services and medical calculations, and so on. ) in order to shop C programmers time and cash specifically while engaged on huge programming initiatives.

C++ in a Nutshell

To-the-point, authoritative, no-nonsense suggestions have continually been a hallmark of O'Reilly books. The In a Nutshell books have earned a great attractiveness within the box because the well-thumbed references that take a seat beside the an expert developer's keyboard. C++ in a Nutshell lives as much as the In a Nutshell promise.

ASP.NET 2.0 Revealed

* in addition to those that obtain the preview at PDC, it really is expected that each one different ASP. internet builders might be hungry for info at the re-creation. * could be one of many first actual books on ASP. web 2. zero, on hand once the know-how itself turns into on hand to a much broader viewers. * Very fast paced, since it assumes previous wisdom of ASP.

Pro SharePoint 2013 Branding and Responsive Web Development

Seasoned SharePoint 2013 Branding and Responsive internet improvement is the definitive reference at the applied sciences, instruments, and methods wanted for construction responsive web content and purposes with SharePoint 2013. The booklet specializes in options that supply the simplest browser event for the myriad of units, browsers, and reveal orientations and resolutions.

Extra info for Effective C++: 50 Specific Ways to Improve Your Programs and Design

Sample text

Add support for inheritance in member ver- sions of the functions, and presto! - you're done. IteDl 9: Avoid hiding the "normal" form of new. f() ; I I calls X: : f This is unsurprising and normally causes no confusion, because global and member functions are usually invoked using different syntactic forms. Ho\vever, if you add to this class an operator new taking additional parameters, the result is likely to be an eye-opener: class X { public: void f () ; II operator new allowing specification of a II new-handling function static void * operator new(size_t size, new_handler p); }; void specialErrorHandler(); X *pxl = new (specialErrorHandler) X; X *px2 II definition is elsewhere = new X; II calls X: : operator new II error!

653; This approach works like a charm. There are two special cases worth mentioning, however. First, things can get a bit tricky when defining constant pointers. Because constant definitions are typically put in header files (where many different source files will include them), it's important that the pointer be declared canst, usually in addition to what the pointer points to. To define a constant char* -based string in a header file, for example, you have to write canst twice: canst char * const authorName = "Scott Meyers"; For a discussion of the meanings and uses of canst, especially in conjunction with pointers, see Item 21.

Not return, typically by calling abort or exi t, both of which are found in the standard C library (and thus in the standard c++ library - see Item 49). These choices give you considerable flexibility in implementing newhandler functions. Sometimes you'd like to handle memory allocation failures in different ways, depending on the class of the object being allocated: class X { public: static void outOfMemory()i }; Memory Management Item 7 29 class Y { public: static void outOfMemory(); }; X* pl new X; y* p2 = new Y; II II II II if allocation is unsuccessful, call X::outOfMemory if allocation is unsuccessful, call Y::outOfMemory C++ has no support for class-specific new-handlers, but it doesn't need to.

Download PDF sample

Rated 4.06 of 5 – based on 27 votes