By Davide Di Gennaro

ISBN-10: 1484210115

ISBN-13: 9781484210116

Complicated Metaprogramming in vintage C++ deals an in depth inspect C++ template metaprogramming (TMP); TMP is gifted within the ebook as a collection of strategies that would carry a brand new type in C++ and making it quite transparent and effective. The e-book bargains with language features, layout styles, examples and purposes (seen as case studies). distinct emphasis is wear small reusable concepts that may enhance the standard of day-by-day work.

The ebook teaches metaprogramming utilizing vintage C++, that's, now not utilizing the 2 more moderen criteria. this can be performed to maximise compatibility and obviously illustrate the process, permitting the reader to understand tough fabric with out the burdens of compiler error, and different pointless complexities and allowing a way more severe remedy of the topic. In so doing, all next additions to the C++ language are totally suitable with the code during this e-book and clients conversant in them can leverage the techniiques brought in C++ XX to make the styles during this ebook much more robust. there's a bankruptcy notwithstanding that discusses matters concerning the more recent standards.

What makes the booklet unprecedented is the extent of realizing of the strategies concerned imparted through the writer. this isn't only a rote assessment of metaprogramming. you are going to really comprehend tough subject matters like static assertions, easy methods to write metafunctions, overload solution, lambda expressions, etc. greater than that, you'll paintings via them with useful examples guided through the author's frank causes. This e-book calls for you to imagine and to benefit and to appreciate the language so you might software at a better level.

What you’ll learn

What templates and the small item toolkit are, and the way to exploit them
find out how to do overload resolution
the best way to do metaprogramming with interfaces, algorithms, functors and refactoring
find out how to paintings with code generators
what's opaque kind precept and the way to take advantage of it
tips on how to paintings with debugging templates and more
A bankruptcy dedicated to matters surrounding C++0x and C++14

Who this e-book is for

This booklet is for knowledgeable C++ programmers who are looking to research more.
Table of Contents

Part I

1. Templates

2. Small item Toolkit

Part II

3. Static Programming

4. Overload Resolution

5. Interfaces

6. Algorithms

7. Code Generators

8. Functors

9. Opaque style Principle

Part III

10. Refactoring

11. Debugging Templates

12. C++0X

13. Appendix A: Exercises

14. Appendix B: Bibliography

Show description

Read or Download Advanced Metaprogramming in Classic C++ (3rd Edition) PDF

Similar programming books

Christian Queinnec's Lisp in Small Pieces PDF

It is a entire account of the semantics and the implementation of the entire Lisp relations of languages, particularly Lisp, Scheme and similar dialects. It describes eleven interpreters and a pair of compilers, together with very fresh concepts of interpretation and compilation. The booklet is in elements. the 1st starts off from an easy review functionality and enriches it with a number of identify areas, continuations and side-effects with commented versions, whereas even as the language used to outline those positive aspects is lowered to an easy lambda-calculus.

Get Application Interoperability: Microsoft .NET and J2EE PDF

Get the easiest info on hand for permitting program interoperability among the Microsoft . web and Java 2 firm version (J2EE) improvement structures. This booklet bargains useful and prescriptive assistance for builders liable for developing enterprise-level company strategies the place platform interoperability is a demand and a truth.

Verified Software: Theories, Tools, Experiments: First IFIP by Tony Hoare, Jay Misra (auth.), Bertrand Meyer, Jim Woodcock PDF

This cutting-edge survey is an consequence of the 1st IFIP TC 2/WG 2. three operating convention on established software program: Theories, instruments, Experiments, VSTTE 2005, held in Zurich, Switzerland, in October 2005. This was once a ancient occasion collecting many best foreign specialists on systematic equipment for specifying, development and verifying high quality software program.

Get Analysis of Cache Performance for Operating Systems and PDF

As we proceed to construct speedier and quick. er desktops, their functionality is be­ coming more and more depending on the reminiscence hierarchy. either the clock velocity of the desktop and its throughput consistent with clock rely seriously at the reminiscence hierarchy. The time to complet. e a cache acce88 is oft. en the issue that det.

Extra info for Advanced Metaprogramming in Classic C++ (3rd Edition)

Sample text

This simple classification may turn out important for (human) debuggers. If any piece of code is considered a “system utility,” then it’s implicitly trusted and it may usually be “stepped over” during debug. On the other hand, project-specific code is possibly less tested and should be “stepped in”. We can agree that stable symbols should follow the STL naming conventions (lowercase, underscores, such as stable_sort, hash_map, and so on). This often will be the case for class templates. The rest should be camel case (the Java convention is fine).

Template struct A { typedef double type; }; // if A::type is double, X could be anything A dummy argument can be added to enforce consistency: template void f(std::vector&, typename std::vector::iterator); The compiler will deduce T from the first argument and then verify that the second argument has the correct type. begin()); Experience shows that it’s better to minimize the use of function templates with non-deduced parameters. Automatic deduction usually gives better error messages and easier function lookup; the following section lists some common cases.

Template struct A { typedef double type; }; // if A::type is double, X could be anything A dummy argument can be added to enforce consistency: template void f(std::vector&, typename std::vector::iterator); The compiler will deduce T from the first argument and then verify that the second argument has the correct type. begin()); Experience shows that it’s better to minimize the use of function templates with non-deduced parameters. Automatic deduction usually gives better error messages and easier function lookup; the following section lists some common cases.

Download PDF sample

Advanced Metaprogramming in Classic C++ (3rd Edition) by Davide Di Gennaro


by John
4.2

Rated 4.52 of 5 – based on 17 votes