Advanced Metaprogramming in Classic C++ by Davide Di Gennaro

By Davide Di Gennaro

Advanced Metaprogramming in vintage C++ goals to be either an creation and a connection with C++ template metaprogramming (TMP); TMP is gifted within the ebook as a suite of innovations that may convey a brand new kind in C++ and make code highly transparent and effective. The booklet offers with language elements, layout styles, examples and functions (seen as case studies). particular emphasis is wear small reusable concepts that may increase the standard of day-by-day paintings.

What makes the booklet unparalleled is the extent of knowing of the ideas concerned imparted through the writer. this isn't only a rote evaluation of metaprogramming. you are going to actually comprehend tough themes like static assertions, tips on how to write metafunctions, overload solution, lambda expressions, etc. greater than that, you are going to paintings via them with sensible examples guided through the author's frank reasons. This booklet calls for you to imagine and to benefit and to appreciate the language that you should software at a better level.

Show description

Read Online or Download Advanced Metaprogramming in Classic C++ PDF

Best c & c++ books

Die C++-Standardbibliothek: Einführung und Nachschlagewerk GERMAN

Die C++-Standardbibliothek, deren interessantester Teil die average Template Library (STL) ist, revolutioniert die C++-Programmierung. Der korrekte und effiziente Einsatz stellt eine gro? e Herausforderung dar, die nur mit fundiertem Wissen zu meistern ist. In diesem Buch wird die Funktionsweise und Implementierung der einzelnen Komponenten (Container, Iteratoren, Algorithmen, Funktionsobjekte, Strings, Streams usw.

Advanced Topics in Java: Core Concepts in Data Structures

Java is among the most generally used programming languages at the present time. It was once first published by means of solar Microsystems in 1995. through the years, its acceptance has grown to the purpose the place it performs a massive position in so much of our lives. From laptops to facts facilities, video game consoles to clinical supercomputers, cellphones to the net, Java is in every single place!

Advanced MS DOS programming : the Microsoft guide for Assembly language and C programmers

This consultant addresses key programming subject matters, together with personality units, mass garage, reminiscence administration and approach administration. The reference part info each one MS-DOS functionality name and interrupt and the BIOS interrupts. New and increased fabric during this version contains, procedure features for all present types of MS-DOS, ROM BIOS info for fastened disk, EGA, VGA, PC/AT and PS/2, model four.

Data structures using C++

Facts buildings utilizing C++ is designed to function a textbook for undergraduate engineering scholars of desktop technological know-how and data expertise in addition to postgraduate scholars of machine purposes. The booklet goals to supply a complete insurance of the entire subject matters concerning facts constructions.

Additional info for Advanced Metaprogramming in Classic C++

Sample text

Empty()) throw std::runtime_error("failure"); } Most readers will describe this fragment as, “If the multidimensional vector is not empty, then throw an exception”. However, nothing in the code states that this is the intended behavior except style. 27 The naming convention is a big component of style. The following example lists some ideas for how to convey extra meaning when building the name of an object. It is not intended as a set of axioms, and in particular no item is worse/better than its opposite, but it’s a detailed example of how to assemble a style that can help you diagnose and solve problems.

X T::get() const; X T::base() const The name get is used when type T wraps a simpler type X. A smart pointer’s get would thus return the internal plain pointer. The function base instead is used to return a copy of the wrapped object, when the wrapper is just a different interface. Since a smart pointer typically adds some complexity (for example, a reference count), the name base would not be as appropriate as get. On the other hand, std::reverse_iterator is an interface that swaps ++ and -- of an underlying iterator, so it has a base().

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). h struct MySpecialScalarType // 'project-level' class – mixed case { // ... 30 A functor is said to be modifying if it takes arguments by non-const references.

Download PDF sample

Rated 4.11 of 5 – based on 41 votes
Categories C C