Improve your existing C++ competencies quickly and efficiently with this advanced volume
Professional C++, 5th Edition raises the bar for advanced programming manuals. Complete with a comprehensive overview of the new capabilities of C++20, each feature of the newly updated programming language is explained in detail and with examples. Case studies that include extensive, working code round out the already impressive educational material found within.
Without a doubt, the new 5th Edition of Professional C++ is the leading resource for dedicated and knowledgeable professionals who desire to advance their skills and improve their abilities. This book contains resources to help readers:
Maximize the capabilities of C++ with effective design solutions
Master little-known elements of the language and learn what to avoid
Adopt new workarounds and testing/debugging best practices
Utilize real-world program segments in your own applications
Notoriously complex and unforgiving, C++ requires its practitioners to remain abreast of the latest developments and advancements. Professional C++, 5th Edition ensures that its readers will do just that.
A friend of mine published a new book, titled “C++ Lambda Story”. The book explains everything you need to know about lambda expressions in C++.
The book guides you through the evolution of C++ Lambda Expressions so that you can learn it step by step. It starts with C++03 and a motivation to have “ad-hoc” functors, and then moves into the latest C++ standards:
C++11 – early days of the feature. You’ll learn about all the essential aspects of lambdas and several tricks you might apply. This is the longest chapter as it needs to cover a lot of topics.
C++14 – updates. See how to use generic lambdas and captures with an initializer.
C++17 – more improvements, especially by handling ‘this’ pointer and allowing ‘constexpr’. You’ll also learn about the overloaded pattern and how to derive from lambda.
C++20 – in this section you’ll see all of the new features adopted for C++20 like template lambdas and how to use them with concepts and constexpr algorithms.
Additionally, throughout the chapters, you’ll learn about the following techniques:
Immediately Invoked Functional Expressions (IIFE)
How to instrument a default functor to gather extra information
Replacing std::bind1st, std::bind2nd and removed functional stuff
The Overloaded Pattern and how to inherit from a lambda
Passing C++ captureless lambda as a function pointer to C API
LIFTING with lambdas
Storing lambdas in a container
Variadic templates and arguments packs
Lambdas and asynchronous execution
and many more
The author, Bartłomiej Filipek, is giving a 28% discount to readers of my blog. This offer is valid until 27th of January 2021. Follow this link to use the coupon if you are interested in this offer.
My friend Peter Van Weert finished a new edition of “Beginning C++20” for which I was technical editor. It’s a great book to learn C++20 for programmers new to C++ and those who may be looking for a refresh primer on C++ in general.
Begin your programming journey with C++ , starting with the basics and progressing through step-by-step examples that will help you become a proficient C++ programmer. This book includes new features from the C++20 standard such as modules, concepts, ranges, and the spaceship operator. All you need are Beginning C++20 and any recent C++ compiler and you’ll soon be writing real C++ programs. There is no assumption of prior programming knowledge.
All language concepts that are explained in the book are illustrated with working program examples, and all chapters include exercises for you to test and practice your knowledge. Free source code downloads are provided for all examples from the text and solutions to the exercises.
This latest edition has been fully updated to the latest version of the language, C++20, and to all conventions and best practices of modern C++. Beginning C++20 also introduces the elements of the C++ Standard Library that provide essential support for the C++20 language.
What You Will Learn:
Begin programming with the C++20 standard
Carry out modular programming in C++
Work with arrays and loops, pointers and references, strings, and more
Write your own functions, types, and operators
Discover the essentials of object-oriented programming
Use overloading, inheritance, virtual functions, and polymorphism
Write generic function and class templates, and make them safer using concepts
Learn the ins and outs of containers, algorithms, and ranges
Use auto type declarations, exceptions, move semantics, lambda expressions, and much more
Visual Studio Code is a free highly-customizable code editor that runs on Linux, macOS, and Windows. The C++ extension brings a rich set of productivity features to VS Code for C++ developers, including IntelliSense smart code completion, debugging, refactoring, code navigation, and more! On top of that, these features are adaptable to various platforms, architectures and compilers, enabling all your cross-compiling and remote development scenarios.
Editing
For editing, the C++ extension brings, among others, IntelliSense, code navigation, refactoring support, code formatting, semantic colorization, …
Debugging
For debugging, the extension brings support for breakpoints, watch variables, stepping through code, debugging multi-threaded applications, debugging remote processes, …
I’ll be giving two sessions this year at CppCon 2020:
A keynote session titled “C++20: An (Almost) Complete Overview”: The technical work on C++20 was finished in January 2020, and is now being pushed through ISO certification. This presentation gives an overview of (almost) all new features in both the language and the Standard Library. Some more exotic features will be left out. New language features include modules, coroutines, concepts, templated lambdas, constexpr changes, designated initializers, the spaceship operator, string literals as template parameters, feature test macros, conditional explicit, immediate functions, and more. The second part of the session discusses the changes to the Standard Library. This includes topics such as ranges, atomic smart pointers, cancellable threads, a synchronization library, calendars, time zones, span, a formatting library, features test macros, and more. The material is mostly the same as the “C++20: What’s in it for you?” session from CppCon 2019, but it has been updated with the final standard. If you want a complete overview of all C++20 features, including references to other more deep-dive sessions at CppCon 2020 on certain topics, then this session is for you.
And a session titled “C++20 String Formatting Library: An Overview and Use with Custom Types”: C++20 introduced a nice formatting library with std::format(). This session will explain what the formatting library provides, how to use all of its functionality, and most importantly, how you can customize it so that you can use formatting strings that include your very own custom types and custom formatting parameters, and of course, how to handle errors.
I’m thrilled to announce that I’ll be giving a keynote presentation at this year’s CppCon. Here is the official announcement 😎
The title of my keynote talk is “C++20: An (Almost) Complete Overview”. C++20 is going be discussed quite a bit at this year’s conference and in addition to providing an overview of the new language/library changes, I will guide attendees to other CppCon talks related to C++20.
If you want a complete overview of all C++20 features, including references to other more deep-dive sessions at CppCon 2020 on certain topics, then this session is for you.
After this talk, you should have the confidence and familiarity you need to embrace the latest version of C++.
Part of the abstract:
This presentation gives an overview of (almost) all new features in both the language and the Standard Library. Some more exotic features will be left out. New language features include
Pure Virtual C++ 2020 is a free single-track one-day virtual conference for the whole C++ community. It is taking place on Thursday 30th April 2020 from 14:30 to 23:00 UTC. Sign up on the event website.
All
talks will be pre-recorded and streamed on YouTube Live with a live
Q&A session with the speakers. After the event, the talks will be
available to watch online for free.
The Pure Virtual C++ conference organized by Microsoft will be run under the Berlin Code of Conduct.
The preliminary schedule is (all times UTC):
14:30-15:30 – Dynamic Polymorphism with Metaclasses and Code Injection by Sy Brand
16:00-16:30 – Optimize Your C++ Development While Working From Home by Nick Uhlenhuth
16:30-17:00 – C++ Cross-Platform Development with Visual Studio and WSL by Erika Sweet
17:30-18:30 – Lucky 7 – Designing Text Encodings for C++ by JeanHeyd Meneide
19:00-20:00 – C++ Development with Visual Studio Code by Julia Reid
20:30-21:00 – Peeking Safely at a Table with Concepts by Gabriel Dos Reis
21:00-21:30 – Practical C++20 Modules and the Future of Tooling Around C++ Modules by Cameron DaCamara
22:00-23:00 – Update on MSVC’s implementation of the C++20 Standard Library by Mahmoud Saleh
This event is cancelled in light of the current state of the Covid-19 outbreak.
We will try to get our two international speakers, Greg and DeWang, back to Belgium at a future event.
The next meeting of the Belgian C++ Users Group is planned for Monday March 30th, 2020 at 18:00 at KU Leuven Department of Computer Science. The welcoming and reception takes place at Foyer Computerwetenschappen (room 00.191), while the sessions will take place in Auditorium Erik Duval (room 00.225)
18:30: Session 1: Amazing tricks with the GDB debugger (Greg Law) If you’re writing C++ for anything other than Windows, chances are
that you occasionally break out GDB. This session presents some of the
lesser known features of GDB that can change the way you debug. GDB has
come a long way in the last few years and now does so much more than
break, print, step and continue. Reversible debugging; Non-Stop Mode;
Multi-process Debugging; and Dynamic Printf are but some of its best
features, and its built-in Python scripting is particularly powerful.
Join Undo co-founder and CEO, Greg Law, as he takes you through a series
of demos to show some amazing tricks with GDB and some of its powerful
new (and not-so-new) features that you may not have heard of.
19:15: Session 2: Static analysis and Coverity (DeWang Li) The C/C++ code you create plays such a pivotal role on our planet,
and as such, companies are investing heavily into ensuring they are safe
and robust. One of the disciplines they invest in to ensure that is
static analysis. DeWang will explain the fundamentals of static
analysis, and using his favorite product, Coverity, demonstrate some of
its capabilities. He will share stories from working with some of the
top Silicon Valley companies and how they apply Coverity.
19:55: Break
20:10: Session 3: Interactive discussion on pointers (Lieven de Cock) Let’s have an exchange of thoughts on the topic of pointers: raw
pointers, smart pointers, std/boost::optional and
std::reference_wrapper.
How to express intent and how to avoid checking things that might not be needed to check?
We will present some use cases to get the discussion going. This is an
interactive session, so start thinking about questions or opinions you
might have.
20:50: Introduction to Dekimo, and KU Leuven Department of Computer Science, followed by a drink.
The next meeting of the Belgian C++ Users Group is planned for Wednesday January 29th, 2020 at 18:00 at OMP.
OMP ( https://www.omp.com/ ) is sponsoring this event by providing the location, drinks and catering.
The agenda is as follows:
18:00: Reception with food.
18:30: Session 1: Coroutines in C++20 (Johan Vanslembrouck) A coroutine is a function that can suspend execution to be resumed
later. Coroutines allow for sequential code that executes asynchronously
(e.g. to handle non-blocking I/O without explicit callbacks), and also
supports algorithms on lazy-computed infinite sequences and other uses.
Unlike most other languages that support coroutines, C++ coroutines are
open and not tied to any particular runtime or generator type and allow
libraries to imbue coroutines with meaning, whereas the compiler is
responsible solely for efficient transformation of a function to a state
machine that is the foundation of the coroutine.
The presentation will explain the C++ coroutines mechanism, i.e. code
generated by the compiler and the code to be written by a coroutine
developer. The presentation includes examples of an client-server
application using Boost ASIO in combination with C++ 20 coroutines and a
producer-consumer queue implemented with and without coroutines.
19:30: Break
19:45: Session 2: The evolution of the C++ Lambda (Lieven de Cock) Before C++11, we had to write function objects (functors) or free
standing functions to pass as the callable to several algorithms (for
example: for_each). The drawback was that we were introducing objects in
a bigger scope than actually needed, and it can be considered as rather
some boilerplate.
With the introduction of the lambda we can write (little) callables at
the moment we need them. Over the years (or better said over the new
standards) the lambdas gained extra power and became more user friendly.
In this talk we will have a look on the evolution of the lambda since
its birth in C++11.
On September 18th, 2019 I gave a presentation titled “C++20 What’s In It For You?” at CppCon 2019. The slides of my presentation can be downloaded below:
The next meeting of the Belgian C++ Users Group is planned for Thursday October 10th, 2019 at 18:00 at Brabanthal (room Luna).
think-cell ( https://www.think-cell.com/ ) is sponsoring this event by providing the location, drinks and catering.
The agenda is as follows:
18:00: Reception with food.
18:30: Session 1: C++20: What’s in it for you? (Marc Gregoire) With the current three-year pace of C++ releases, the next release is scheduled for 2020, C++20. This presentation gives an overview of what you can expect in the new standard. It starts with discussing the C++20 language features that will be added by the C++20 standard, such as concepts, coroutines, templated lambdas, the spaceship operator, pack expansion in lambda captures, string literals as template parameters, extra initializer for range-based for loop, modules, and more. Next, we’ll delve into the new Standard Library features, such as ranges, std::span, atomic smart pointers, and more. Depending on the outcome of the next C++ Standard Committee meeting, the list of new features might include improved futures, task blocks, and text formatting. If you want a concise overview of what the C++20 standard will offer, then this presentation is for you.
19:30: Break
19:45: Session 2: From Iterators To Ranges — The Upcoming Evolution Of the Standard Library (Arno Schödl) Pairs of iterators are ubiquitous throughout the C++ library. It is generally accepted that combining such a pair into a single entity usually termed Range delivers more concise and readable code. Defining the precise semantics of such Range concept proves surprisingly tricky, however. Theoretical considerations conflict with practical ones. Some design goals are mutually incompatible altogether.
20:45: Introduction to think-cell, followed by a drink.
Together with Peter Van Weert, we finished our new book titled “C++17 Standard Library Quick Reference”. It’s published by Apress.
Abstract
This quick reference is a condensed guide to the essential data structures, algorithms, and functions provided by the C++17 Standard Library. It does not explain the C++ language or syntax, but is accessible to anyone with basic C++ knowledge or programming experience. Even the most experienced C++ programmer will learn a thing or two from it and find it a useful memory-aid.
It is hard to remember all the possibilities, details, and intricacies of the vast and growing Standard Library. This handy reference guide is therefore indispensable to any C++ programmer. It offers a condensed, well-structured summary of all essential aspects of the C++ Standard Library. No page-long, repetitive examples or obscure, rarely used features. Instead, everything you need to know and watch out for in practice is outlined in a compact, to-the-point style, interspersed with practical tips and well-chosen, clarifying examples.
This new edition is updated to include all Standard Library changes in C++17, including the new vocabulary types std::string_view, any, optional, and variant; parallel algorithms; the file system library; specialized mathematical functions; and more.
What You Will Learn
Gain the essentials that the C++ Standard Library has to offer
Use containers to efficiently store and retrieve your data
Inspect and manipulate your data with algorithms
See how lambda expressions allow for elegant use of algorithms
Discover what the standard string class provides and how to use it
Write localized applications
Work with file and stream-based I/O
Prevent memory leaks with smart pointers
Write safe and efficient multi-threaded code using the threading libraries
Who This Book Is For
All C++ programmers, irrespective of their proficiency with the language or the Standard Library. A secondary audience is developers who are new to C++, but not new to programming, and who want to learn more about the C++ Standard Library in a quick, condensed manner.
The second Belgian LLVM Meetup will take place at the Guardsquare offices in Leuven, the 19th of June. Anyone who’s working with, or is simply interested in, the LLVM project or any of its tools; Clang, lldb, lld, Polly,… is invited. The evening starts off with three short talks on various LLVM related topics. Afterwards, there will be plenty of time to exchange experiences and get to know the local LLVM community.
Schedule:
20h00: Arrival
20h30: Talks ( +- 20min each )
Just compile it: High-level programming on the GPU with Julia.
Sim: a contract-based programming language for safety-critical software.
Processing complete iOS applications on top of LLVM.
The next meeting of the Belgian C++ Users Group is planned for Wednesday July 3rd, 2019 at 18:00 at CluePoints @ OFFBar | ONSpace.
CluePoints ( https://cluepoints.com/ ) is sponsoring this event by providing the location, drinks and catering.
The agenda is as follows:
18:00: Sandwiches.
18:30: Session 1: What’s new in Visual C++ 2019? (Marc Gregoire) Microsoft Visual Studio 2019 and Visual C++ 2019 come with a host of new features. In this session, we will have a look at the important changes and improvements for C++ developers.
19:30: Break
19:45: Session 2: Statistical Scientific programming: challenges in converting R to C++ (Olivia Quinet) Scientific programming is in itself a challenge due to several concomitant issues and requirements including low response time, low memory usage, minimizing numerical errors, error propagation. R is a programming language for statistical computation providing a wide set of packages for linear and non linear modeling, statistical tests, … This talk will focus on the different Object-Oriented strategies implemented to overcome those challenges, speed up the computation while reducing the memory footprint.
20:45: Introduction to CluePoints, followed by a drink.
I’m happy to announce that the number 1 university in China, the Tsinghua University, has finished with the translation work for my book “Professional C++ 4th Edition“.
On 2nd of April, Microsoft has released Visual Studio 2019. It comes with a host of IDE and performance improvements. For C++ developers, here are some new features:
Save time when writing C++ and XAML code by using Visual Studio IntelliCode, an optional extension that gives AI-assisted recommendations for your code.
Experience in-editor code analysis warnings. Code analysis runs automatically in the background and warnings display as green squiggles.
Try the new Template Bar, which uses the Peek Window UI and supports nested templates.
Configure your CMake projects using the new CMake Settings Editor, which provides an alternative to CMakeSettings.json.
Try out a host of backend improvements including OpenMP SIMD vectorization, link-time speedups, and more aggressive inlining.
Open existing CMake caches generated by external tools, such as CMakeGUI, or customized meta-build systems.
Improve analysis with /Qspectre for providing mitigation assistance for Spectre Variant 1 (CVE-2017-5753). For more information, see the Visual C++ Team Blog post.
Quickly switch between your previous sample arguments now
that the Template Bar for Template IntelliSense has a Most Recently Used
dropdown.
This is just a selection of some of the new features. The new release includes other productivity, CMake-related, and backend improvements for C++. The full release notes can be found here.