£32.79
  • RRP: £40.99
  • You Save: £8.20 (20%)
FREE Delivery in the UK.
Only 4 left in stock (more on the way).
Dispatched from and sold by Amazon. Gift-wrap available.
Quantity:1
Modern+C+++Design%3A+Generi... has been added to your Basket
Have one to sell?
Flip to back Flip to front
Listen Playing... Paused   You're listening to a sample of the Audible audio edition.
Learn more
See all 3 images

Modern C++ Design: Generic Programming and Design Patterns Applied: Applied Generic and Design Patterns (C++ in Depth) Paperback – 13 Feb 2001

4.4 out of 5 stars 9 customer reviews

See all formats and editions Hide other formats and editions
Amazon Price
New from Used from
Kindle Edition
"Please retry"
Paperback
"Please retry"
£32.79
£15.42 £22.95
Note: This item is eligible for click and collect. Details
Pick up your parcel at a time and place that suits you.
  • Choose from over 13,000 locations across the UK
  • Prime members get unlimited deliveries at no additional cost
How to order to an Amazon Pickup Location?
  1. Find your preferred location and add it to your address book
  2. Dispatch to this address when you check out
Learn more
£32.79 FREE Delivery in the UK. Only 4 left in stock (more on the way). Dispatched from and sold by Amazon. Gift-wrap available.
click to open popover

Special Offers and Product Promotions


Frequently Bought Together

  • Modern C++ Design: Generic Programming and Design Patterns Applied: Applied Generic and Design Patterns (C++ in Depth)
  • +
  • Effective Modern C++: 42 Specific Ways to Improve Your Use of C++11 and C++14
  • +
  • The C++ Programming Language
Total price: £93.14
Buy the selected items together

Enter your mobile number below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
Getting the download link through email is temporarily not available. Please check back later.

  • Apple
  • Android
  • Windows Phone

To get the free app, enter your mobile phone number.




Product details

  • Paperback: 352 pages
  • Publisher: Addison Wesley; 01 edition (13 Feb. 2001)
  • Language: English
  • ISBN-10: 0201704315
  • ISBN-13: 978-0201704310
  • Product Dimensions: 18.8 x 2.3 x 23.1 cm
  • Average Customer Review: 4.4 out of 5 stars  See all reviews (9 customer reviews)
  • Amazon Bestsellers Rank: 242,548 in Books (See Top 100 in Books)
  • See Complete Table of Contents

Product Description

From the Back Cover

Modern C++ Designis an important book. Fundamentally, it demonstrates ‘generic patterns’ or ‘pattern templates’ as a powerful new way of creating extensible designs in C++–a new way to combine templates and patterns that you may never have dreamt was possible, but is. If your work involves C++ design and coding, you should read this book. Highly recommended.
–Herb Sutter

What’s left to say about C++ that hasn’t already been said? Plenty, it turns out.
–From the Foreword by John Vlissides

In Modern C++ Design, Andrei Alexandrescu opens new vistas for C++ programmers. Displaying extraordinary creativity and programming virtuosity, Alexandrescu offers a cutting-edge approach to design that unites design patterns, generic programming, and C++, enabling programmers to achieve expressive, flexible, and highly reusable code.

This book introduces the concept of generic components–reusable design templates that produce boilerplate code for compiler consumption–all within C++. Generic components enable an easier and more seamless transition from design to application code, generate code that better expresses the original design intention, and support the reuse of design structures with minimal recoding.

The author describes the specific C++ techniques and features that are used in building generic components and goes on to implement industrial strength generic components for real-world applications. Recurring issues that C++ developers face in their day-to-day activity are discussed in depth and implemented in a generic way. These include:

  • Policy-based design for flexibility
  • Partial template specialization
  • Typelists–powerful type manipulation structures
  • Patterns such as Visitor, Singleton, Command, and Factories
  • Multi-method engines

For each generic component, the book presents the fundamental problems and design options, and finally implements a generic solution.

In addition, an accompanying Web site, http://www.awl.com/cseng/titles/0-201-70431-5, makes the code implementations available for the generic components in the book and provides a free, downloadable C++ library, called Loki, created by the author. Loki provides out-of-the-box functionality for virtually any C++ project.

Get a value-added service! Try out all the examples from this book at www.codesaw.com. CodeSaw is a free online learning tool that allows you to experiment with live code from your book right in your browser.



0201704315B11102003

About the Author

Andrei Alexandrescu is the author of the award-winning book Modern C++ Design (Addison-Wesley, 2001) and is a columnist for C/C++ Users Journal.



See all Product Description

Customer Reviews

4.4 out of 5 stars
Share your thoughts with other customers

Top Customer Reviews

Format: Paperback
Every couple of years there appears a classic, Stroustrupp, Advanced C++, the GOF patterns book, Eff C++ and More Eff C++, now there is this. Everyone has an opinion, and mine is this. Modern C++ Design is top of the list. It deserves to be no more than an arms length away from every serious programmer, designer, academic or teacher. Inside this you will find breath-taking displays of sheer wizardry, creativity, and inventiveness from a master craftsman. If I were to single out my favourite features of this book it would have to be the following, and don't be put off if you don't know what they are, just accept it that they are astonishing programming techniques and design tools. Policy classes. An astonishingly simple but elegant programming technique that enforces design time decisions completely. Typelists and a family of algorithms for manipulating them. Simply astonishingly, jaw-droppingly elegant structures for manipulating lists of types. The best description, and certainly the best implementation, of some of the GOF patterns I have ever seen. Have you read the consequences of a pattern and just singled in on one item which is exactly what you need. Then in another project, you can't use that implementation because you need to implement a different feature. E.g., single threaded in one project and multi-threaded in another or creating objects on the stack and then needing to use the heap. These implementations show you how to do all this, and more, in one suite of code. The Abstract Factory and Multi Method chapters are quite simply astonishing feats of engineering. It contains the best description of smart pointers I have ever seen. Ever wondered why std::string does not convert to a const char* but other string classes do?. Ever tried to write no-intrusive pre and post conditions.Read more ›
Comment 69 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback
This is 300 pages of the hardest of hardcore template metaprogramming you could currently hope to read. As a result, there is a risk you may find more to admire and speculate upon from afar, than to actually use. Various factors will decide this, from the robustness of your compiler, your comfort with far-out template wackiness, and your confidence in debugging and maintaining the result.

One thing is not in doubt: C++ metaprogramming is devilishly clever. That's part of its appeal. It's also capable of producing flexible, efficient families of software. Modern C++ Design pushes the boundaries of TMP further than the more specialised matrix domain detailed in Czarnecki and Eisenecker's Generative Programming (a recommended prologue to this book). Here, the aim is implementing entire design patterns. This is a fairly bold claim, as the received wisdom on design patterns is that there isn't a canonical form that can be presented in code.

And that still holds true. Instead, the code in Modern C++ Design is metacode built on two big ideas: policies and typelists, which are described in the opening chapters, along with some other useful tools. The hard intellectual work is done here, especially the typelist chapter, although previous exposure to the likes of Generative Programming definitely softens the blow. Policies are what Java programmers know as Dependency Injection, except one level of abstraction up (the relationship between classes and objects in DI is done with templates and classes with policies), and with the template instantiation and specialisation rules of C++ providing an extra layer of flexibility. Typelists are exactly as the name suggests - a list of types, but they exist only at compile time.
Read more ›
Comment 21 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback
This is an excellent book, well written well structured and very interesting. The Library and the techniques described may not be of every day use but on those occasions when they are of use they would be very handy to have. The one problem is that these are advanced techniques and a lot of compilers (specifically Visual C++ 6/7) can't currently build the code. It is possible to rewrite the library to get around the compiler issues but it's a lot of extra work. That aside, compilers will be coming online that can use it soon so it is worth reading now in order to be able to start using it as soon as possible.
Comment 11 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback Verified Purchase
This book is about template metaprogramming. Even if you can't see a use for that technique, merely reading this book will tax your brain to the maximum and expand your programming horizons.

I first read this book about a decade ago as some light (ahem) holiday reading and I'll be the first to confess that I didn't 'get it' first time. There were many 'how the ...?' and 'what the ...?' moments. Now a decade and a lot more experience later I've re-read it and finally it makes sense.

Andrei taxes the language and the compilers to the maximum in ways that you may not want to do in production code as the number of people that will be able to maintain it will be small, but as an intellectual exercise this book should be up there with Knuth's classics.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback
Modern C++ Design builds on some of the ideas presented in the classic Design Patterns book, and attempts to improve them specifically for C++. The examples fail to make a case for preferring Alexandrescu's patterns over the originals or other alternatives - while they are a clever use (some would say misuse) of templates, they result in unreadable, unmaintainable code. It's therefore quite disconcerting to see this book receive a number of glowing, uncritical reviews. Loki (the library that is described in the book), has not become a common tool for C++ programmers in the years since 2001 when one of the reviews on this page predicted it would. Instead, C++ programmers, compiler writers and standards committees have struggled to make templates usable for anything more than "containers of x". Perhaps that's where the experimentation should have ended, and we may have got an elegant library rather than the half baked Standard Template Library we have now.
Comment 11 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse


Feedback