Download C++ Template Metaprogramming: Concepts, Tools, and by David Abrahams PDF

By David Abrahams

Abrahams and Gurtovoy have written anything with reference to a vintage… amazing enjoyable to read…
learn the total booklet assessment by Jack J. Woehr, Dr. Dobbs magazine, June 03, 2005

"If you are like me, you are concerned about what humans do with template metaprogramming (TMP) yet are pissed off on the loss of transparent tips and robust instruments. good, this can be the publication we've got been looking forward to. With support from the superb enhance Metaprogramming Library, David and Aleksey take TMP from the laboratory to the place of work with readable prose and useful examples, exhibiting that "compile-time STL" is as capable as its runtime counterpart. Serving as an academic in addition to a guide for specialists, this is often the booklet on C++ template metaprogramming."
—Chuck Allison, Editor, The C++ resource

C++ Template Metaprogramming sheds gentle at the strongest idioms of modern C++, in the end supplying sensible metaprogramming instruments and strategies into the arms of the typical programmer.

A metaprogram is a software that generates or manipulates application code. Ever due to the fact accepted programming was once brought to C++, programmers have came upon myriad "template tips" for manipulating courses as they're compiled, successfully doing away with the barrier among software and metaprogram. whereas pleasure between C++ specialists approximately those services has reached the neighborhood at huge, their functional software is still out of achieve for many programmers. This publication explains what metaprogramming is and the way it's best used. It presents the basis you have to to exploit the template metaprogramming successfully on your personal work.

This publication is aimed toward any programmer who's happy with idioms of the normal Template Library (STL). C++ power-users will achieve a brand new perception into their latest paintings and a brand new fluency within the area of metaprogramming. Intermediate-level programmers who've realized a couple of complex template innovations will see the place those tips slot in the massive photo and may achieve the conceptual beginning to take advantage of them with self-discipline. Programmers who've stuck the smell of metaprogramming, yet for whom it truly is nonetheless mysterious, will eventually achieve a transparent knowing of the way, while, and why it really works. All readers will depart with a brand new software of unheard of strength at their disposal—the increase Metaprogramming Library.

The significant other CD-ROM includes all develop C++ libraries, together with the improve Metaprogramming Library and its reference documentation, in addition to the entire book's pattern code and wide supplementary material.

Read Online or Download C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond PDF

Best c & c++ windows programming books

C++: A Dialog: Programming with the C++ Standard Library

From the 1st time I encountered this publication i used to be inspired with the assumption and process of educating anyone with out heritage whatever. This virtually assured a accomplished insurance of a language that certainly has its complexities. The publication as an entire, with its supply and take among the writer and his pupil, permit the nooks and crannies of just about the entire matters lined to be uncovered and defined simply.

.NET e-Business Architecture

It is a okay publication, however the obtain code dose now not paintings. The publication is lifeless with out the code. and do not count on any support from the writer, you will not get any! So retailer your cash and purchase one other publication as an alternative!

Microsoft .NET - Architecting Applications for the Enterprise

A software program architect’s digest of center practices, pragmatically utilized Designing potent structure is your top procedure for dealing with venture complexity–and bettering your effects. however the ideas and practices of software program architecting–what the authors name the “science of challenging decisions”–have been evolving for cloud, cellular, and different shifts.

Extra resources for C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond

Example text

1) as the iterator's value type. Okay, but how do we name that type? 1 Using a Direct Approach In case you already know the answer chosen by the authors of the standard library, we'll ask you to forget it for the time being; we have a couple of deeper points to make. Instead, imagine we're implementing the standard library ourselves and choosing its method of handling iterators. We're going to end up writing a lot of algorithms, and many of them will need to make an association between an iterator type and its value type.

The two iterators will have the samevalue_type—with its own efficient swap—but since the iterators themselves are different types, the fastiter_swap overload that uses it won't be called. What's needed here is a way to get iter_swap to work on two different iterator types that share a singlevalue_type. Since we're playing "standard library implementor," we can always try rewriting swap so it works on two different types: template void swap(T1& a, T2& b) { T1 tmp = a; a = b; b = tmp; } This simple fix will handle most of the cases our users encounter.

If we were going to represent these powers for manipulation at runtime, we could use an array of seven ints, with each position in the array holding the power of a different fundamental dimension: [1] Divisors just contribute negative exponents, since 1/x = x-1. typedef int dimension[7]; // m l t ... dimension const mass = {1, 0, 0, 0, 0, 0, 0}; dimension const length = {0, 1, 0, 0, 0, 0, 0}; dimension const time = {0, 0, 1, 0, 0, 0, 0}; ... In that representation, force would be: dimension const force = {1, 1, -2, 0, 0, 0, 0}; -2 that is, mlt .

Download PDF sample

Rated 4.35 of 5 – based on 32 votes

admin