By Davide Di Gennaro
Complex Metaprogramming in vintage C++ bargains a close investigate C++ template metaprogramming (TMP); TMP is gifted within the e-book as a suite of thoughts that might carry a brand new sort in C++ and making it exceedingly transparent and effective. The e-book offers with language facets, layout styles, examples and functions (seen as case studies). specific emphasis is wear small reusable thoughts that might increase the standard of day-by-day work.
The e-book 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 approach, permitting the reader to realize tricky fabric with out the burdens of compiler error, and different pointless complexities and allowing a way more excessive therapy of the topic. In so doing, all next additions to the C++ language are totally appropriate with the code during this e-book and clients acquainted with them can leverage the techniiques brought in C++ XX to make the styles during this booklet much more robust. there's a bankruptcy even though that discusses matters concerning the more moderen standards.
What makes the e-book extraordinary is the extent of realizing of the suggestions concerned imparted via the writer. this isn't only a rote evaluation of metaprogramming. you are going to actually comprehend tricky subject matters like static assertions, easy methods to write metafunctions, overload answer, lambda expressions, and so forth. greater than that, you'll paintings via them with functional examples guided through the author's frank causes. This publication calls for you to imagine and to benefit and to appreciate the language that you can software at the next level.
What you’ll learn
What templates and the small item toolkit are, and the way to exploit them
the way to do overload resolution
how one can do metaprogramming with interfaces, algorithms, functors and refactoring
the right way to paintings with code generators
what's opaque sort precept and the way to exploit it
the right way to paintings with debugging templates and more
A bankruptcy dedicated to concerns surrounding C++0x and C++14
Who this booklet is for
This publication is for skilled C++ programmers who are looking to study more.
Table of Contents
2. Small item Toolkit
3. Static Programming
4. Overload Resolution
7. Code Generators
9. Opaque style Principle
11. Debugging Templates
13. Appendix A: Exercises
14. Appendix B: Bibliography
Read or Download Advanced Metaprogramming in Classic C++ (3rd Edition) PDF
Best programming books
It is a publication for these people who believed that we didn’t have to study Perl, and now we all know it truly is extra ubiquitous than ever. Perl is very versatile and strong, and it isn’t scared of internet 2. zero or the cloud. initially touted because the duct tape of the web, Perl has in view that advanced right into a multipurpose, multiplatform language current completely all over the place: heavy-duty internet functions, the cloud, platforms management, common language processing, and monetary engineering.
- Stochastic Programming 84, part 1
- Einführung in die Programmiersprache FORTRAN 77: Anleitung zum Selbststudium
- CLR via C# (Pro-Developer)
- Processing 2: Creative Programming Cookbook
Extra info for Advanced Metaprogramming in Classic C++ (3rd Edition)
The suffix _t, which in C originally means typedef, is also widely used for (private) typedefs standing for template instances: template
B : a; } template
Macros Macros play a special role in TMP. Some programmers consider them a necessary evil and indeed they are necessary, but it’s not obvious they are also evil. Macros must: • Allow the reader to recognize them • Prevent name collisions As discussed in , usually member function names should be actions. Thus empty should be a synonym for make_empty and not for is_empty. However, STL convention is established and universally understood. When in doubt, do as std::vector does. 27 41 Chapter 1 ■ Templates The easiest way to satisfy both requirements is to choose a unique and sufficiently ugly common prefix for all macros and play with lower/uppercase to give extra meaning to the name.