Performance Improvements with Visual Studio 2015 Update 2

Visual Studio 2015 Update 2, released on March 30 2016, brought a couple of performance improvements.

  • Enabled a new database engine; now, C++ Project load should be faster and experience fewer UI delays.
  • Increased the speed of extracting floating-point numbers with iostreams (in other words, “stream >> dbl”). It’s now up to 19x faster, and all bits of the extracted value are now correct.
  • Increased the speed of std::vector reallocation and std::copy(); they are up to 9x faster as they call memmove() for trivially copyable types (including user-defined types).
  • Increased the speed of std::vector, which is up to 11x faster.
  • Increased the speed of std::string::replace(), which is enormously faster when replacing same-size substrings.
  • Increased the speed of std::string::push_back(), which is up to 3x faster.
  • Increased the speed of std::sub_match comparisons, as they now avoid constructing temporary std::strings.
  • Increased the speed of std::function’s copy constructor; it is slightly faster with a reduced codegen size.

The full official release notes can be found here.


New Book “C++ Standard Library Quick Reference” Now Available

My brand new book “C++ Standard Library Quick Reference” co-authored with Peter Van Weert and published by Apress is now available:

Here is the abstract:

This quick reference is a condensed reference guide to the essential data structures, algorithms, and functions provided by the C++ Standard Library. Used by millions of C++ programmers on a daily basis, the C++ Standard Library features core classes for strings, I/O streams, and various generic containers, as well as a comprehensive set of algorithms to manipulate them. In recent years, the C++11 and C++14 standards have added even more efficient container classes, a new powerful regular expression library, and a portable multithreading library featuring threads, mutexes, condition variables, and atomic variables.

Needless to say, it is hard to know and remember all the possibilities, details, and intricacies of this vast and growing 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. The book 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 though will learn a thing or two from it and find it a useful memory-aid. Among the topics covered are:

  • The essentials that the C++ Standard Library has to offer
  • How to use containers to efficiently store and retrieve your data
  • How to use algorithms to inspect and manipulate your data
  • How lambda expressions allow for elegant use of algorithms
  • What the standard string class provides and how to use it
  • How to write localized applications
  • What functionality the library provides for file and stream-based I/O
  • What smart pointers are and how to use them to prevent memory leaks
  • How to write safe and efficient multi-threaded code using the C++11 threading libraries

Next BeCPP UG Meeting Planned For June 30th, 2016

NOTE: Due to a logistics problem, the date has changed. The event will now take place on Thursday June 30th and not on June 23rd!

The next meeting of the Belgian C++ Users Group is planned for Thursday June 30th, 2016 at 18:00 at Newtec.

Newtec ( ) is sponsoring this event by providing the location, drinks and catering.


The agenda is as follows:

  • 18:00: Sandwiches.
  • 18:30: Session 1: Build a database-independent cross-platform persistence layer with Qt (Johan Decorte) Most applications need some kind of persistence. Often relatonal databases are a good choice to store and retrieve data. Besides a cross-platform IDE Qt also provides extensive general-purpose libraries including a database-independent, object-oriented and clean SQL Module API. You can decide even at runtime wether your target database is e.g. Oracle, MS SQL Server or mySQL. Both plain SQL and stored procedure calls are supported.
  • 19:30: Break
  • 19:45: Session 2: Objects? No Thanks! (Wouter van Ooijen) Micro-controller programming can benefit from compile-time polymorphism without paying a run-time price by using static class templates. For small micro-controllers (kilobytes of memory) C++ run-time polymorphism (using objects and virtual methods) is often deemed too expensive in ROM, RAM, and run-time overhead. This talk shows how templates can be used to implement compile-time polymorphism, and static classes to avoid the need for run-time objects. This technique can produce highly modular and composable code that is still as efficient as dedicated C code, but offers better prospects for re-use. This approach is illustrated with an abstraction for GPIO (General Purpose Input Output) pins and ports, with an implementation on an LPC1114 microcontroller, and a number of decorators for pins and numbers.
  • 20:45: Short presentation and guided tour by Newtec.
  • 21:00: Drink

The event is free for everyone, but you need to register for it.

There are 50 seats available for this event.

Professional C++, 3rd Edition

We will be giving away a copy of Professional C++, 3rd Edition.

Note: The deadline for registrations is June 27th, 2016!


Slides GDG Presentation Cross-Platform Mobile App Dev with VC++


On Tuesday 15th of March I gave a presentation for the GDG Brussels (Google Developer Group) in Belgium titled “Cross-Platform Mobile App Development with Visual C++ 2015”. Below you can download the slides.


Marc Gregoire - GDG - Cross-Platform Mobile App Development with Visual C++ 2015


Milestone: VS 2015 Update 2’s Standard Library is C++11, C++14, and C++17-so-far Feature Complete

The C++ Standard Library in the Visual Studio 2015 Update 2 release is C++11, C++14, and C++17-so-far feature complete. This includes all features from C++17 that are currently in that standard proposal: SFINAE-friendly result_of, improvements to pair and tuple, shared_mutex, removal of deprecated iostreams aliases, variable templates for type traits (is_same_v, …), as_const(), logical operator type traits (conjunction, …), owner_less<>, variadic lock_guard, and additions to <chrono>: floor(), ceil(), round(), and abs().
More information, including a detailed list can be found here.


Videos are online of the Windows 10 Dev Day Belgium

The Windows 10 Developer Day brought together more than 300 developers across 3 locations in Belgium (Brussels, Hasselt and Gent). The sessions in Hasselt were recorded and are now available online.

Dive into the benefits that come with the Universal Windows Platform and learn how to have your app run on any device regardless of screen size.

Be amazed about the ease of making the web work for you on Windows 10. Get to know the advantages of building a cloud-connected, mobile experience and see for yourself what the future computing looks like!

Watch the videos on Channel 9.


Next BeCPP UG Meeting Planned For December 3th, 2015

The next meeting of the Belgian C++ Users Group is planned for Thursday December 3th, 2015 at 18:00 at Selligent.

Selligent ( ) is sponsoring this event by providing the location, drinks and catering.

OM Partners

The agenda is as follows:

  • 18:00: Sandwiches.
  • 18:30: Session 1: Move semantics && rvalue references, part 2 (Bert Rodiers) In this presentation we will continue where we left off a year ago. First we will discuss some alternative implementations for the move operators and briefly talk about how to pass arguments. The rest of the talk dives into rvalue references in combination with deduced types and perfect forwarding.
  • 19:30: Break
  • 19:45: Session 2: Cross-Platform Mobile App Development with Visual C++ 2015 (Marc Gregoire) Visual C++ 2015 supports the development of apps for the Windows platform as well as for Android and iOS. A single code base, possibly with a thin platform-specific UI layer, can be compiled to run on Windows, Android, and iOS. The resulting binary can be published to a device and debugged, all from within Visual C++ 2015. This presentation introduces you to such cross-platform mobile app development, including debugging and emulation, and includes a number of demos.
  • 20:45: Short presentation by Selligent.
  • 21:00: Drink

The event is free for everyone, but you need to register for it.

There are 50 seats available for this event.

Professional C++, 3rd Edition

We will be giving away 2 copies of Professional C++, 3rd Edition.

Note: The deadline for registrations is November 27th, 2015!


Slides of my CppCon 2015 Presentation “Cross Platform Mobile App Development in VC++2015”

On September 22th, 2015 together with Ankit Asthana from Microsoft I gave a presentation titled “Cross-Platform Mobile App Development with Visual C++ 2015” at CppCon 2015.
The slides of our presentation can be downloaded below:

Looking forward to next year’s edition of CppCon 🙂


CppCon 2015 Program

The CppCon 2015 program is almost complete. The program contains over 100 one-hour sessions by over 80 speakers. This year, the opening keynote will be given by C++ creator Bjarne Stroustrup on Writing Good C++14.

I’ll be giving a presentation myself titled “Cross-Platform Mobile App Development with Visual C++ 2015” on Tuesday, September 22 (3:15pm – 4:15pm).


VC++ 2015 RC Includes a Dynamic Dialog Layout Feature

The VC++2015 Release Candidate includes an extremely long overdue new feature for MFC: Dynamic Dialogs.

It’s now finally possible to define how controls should move and resize when an MFC dialog is resized. The behavior can be configured with the dialog resource editor.

Artur Laksberg has written an article about the new feature.


C++11/14/17 Features In VS 2015 RC

Stephan T. Lavavej has published an updated table detailing the C++11/14/17 support in VC++ 2015 RC.

Already quite a few C++17 features are included.

Read it here.


Next BeCPP UG Meeting Planned For June 18th, 2015

The next meeting of the Belgian C++ Users Group is planned for Thursday June 18th, 2015 at 18:00 at OM Partners.

OM Partners ( ) is sponsoring this event by providing the location, drinks and catering.

OM Partners
The agenda is as follows:

  • 18:00: Sandwiches.
  • 18:30: Session 1: The C++ Memory Model and Atomics. (Peter Van Weert) Learn more about the C++ memory model introduced by C++11. Get answers to questions such as what exactly is this C++ memory model? What does it provide and guarantee? What are atomics? How do atomics relate to the memory model? How to use atomics to write thread-safe code? And more.
  • 19:30: Break
  • 19:45: Session 2: Portable C++ File System abstraction (Lieven de Cock) Via the standard library we can open and close files, we can read and write to them, be it old style FILE* or fstream. So content manipulation is available in a portable way. But how about File (and Directory) Management. On Posix you might have done stat, opendir, readdir, closedir, …. Others might be acquainted with Windows Api methods like FindFirstFile, CreateFile,  CopyFile, … But nothing portable. There are however several libraries who can bring a lot of such functionality for File and Directory Management. We will look at 2 such libraries, boost::FileSystem and Poco::FileSystem. Finishing up with a sneak peak on the upcoming C++ library standard proposal for File System. So it is time to code in a portable way now, and the future will even be more bright. Get yourself a new HD or SSD because we are managing the files from within the C++ code in a portable way.
  • 20:45: Short presentation by OM Partners.
  • 21:00: Drink

The event is free for everyone, but you need to register for it.

There are 80 seats available for this event.


CppDepend is also sponsoring this event by providing a number of free licenses for their CppDepend product. When you register for the BeCPP event, there will be a checkbox that you can check if you are interested in such a license. By checking that checkbox you allow us to provide CppDepend with your email address so that they can create your license. We have 23 licenses available on a first-come-first-served basis. These are 20 personal licenses and 3 commercial licenses. From all interested people, 3 will be selected at random to receive a commercial license.

Professional C++, 3rd Edition

We will also be giving away 2 copies of Professional C++, 3rd Edition.

Note: The deadline for registrations is June 14th, 2015!


Next BeCPP UG Meeting Planned For December 17th, 2014

The next meeting of the Belgian C++ Users Group is planned for Wednesday December 17th, 2014 at 18:00 at TOMRA.

TOMRA ( ) 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 VC++2015? (Marc Gregoire) An overview of new features and functionality in Microsoft Visual C++ 2015.
  • 19:30: Break
  • 19:45: Session 2: Move semantics && rvalue references, part 1 (Bert Rodiers) In this presentation we will be going deeper into move semantics and rvalue references. A large part of the presentation will talk about how to enable move support, discuss under which conditions it is applied and will point-out some potential pitfalls. We will also discuss Lambda generalized capture, which can be used to capture variables in a lambda expression using move semantics.
  • 20:45: Presentation and/or guided tour of the TOMRA facilities for interested people followed by a drink.

The event is free for everyone, but you need to register for it.

There are 50 seats available for this event.

Note: The deadline for registrations is December 15th, 2014!


Visual C++ 2015 – Speeding up the Incremental Developer Build Scenario

Ankit Asthana published an interesting blog post on the Visual C++ Team Blog about Speeding up the Incremental Developer Build Scenario.
The developer incremental scenario is one where a developer changes a single or multiple source files (while fixing bugs) and builds. This scenario for Visual C++ is roughly equivalent to the amount of time spent in linking the executable (.dll or .exe).
The blog post discusses the following new features:

  • Incremental Linking for Static Libraries (/incremental linker switch)
  • /Zc:inline and Algorithmic improvements (/Zc:inline compiler switch, 2X Faster Links)
  • Fast Program Database (PDB) generation (/debug:FASTLINK linker switch, 2X Faster Links)
  • Incremental Link Time Code Generation (iLTCG) (/LTCG:incremental linker switch, 4x faster links)

It’s definitely worth reading his post, it includes some impressive benchmarks 🙂


Visual C++ 2015 – Resumable Functions

Visual C++ 2015 includes a general purpose solution to implement resumable functions based on the concept of coroutines. A coroutine is a generalized routine entity which supports operations like suspend and resume in addition to the traditional invoke and return operations.
These resumable functions are being proposed for inclusion in ISO C++17.
For the VC++ 2015 Preview, the feature only works for 64-bit targets, and requires adding the /await switch to your compiler command-line.
Such resumable functions have several use cases:

  • Asynchronous operations
  • Generator pattern
  • Reactive Streams

Here is a simple example demonstrating an asynchronous operation:

#include <future>
#include <thread>
#include <experimental\resumable>

using namespace std; 
using namespace std::chrono; 
// this could be some long running computation or I/O
future<int> calculate_the_answer() 
    return async([] { 
        this_thread::sleep_for(1s); return 42; 
// Here is a resumable function
future<void> coro() { 
    printf("Started waiting... \n"); 
    auto result = __await calculate_the_answer(); 
    printf("got %d. \n", result); 
int _tmain(int argc, _TCHAR* argv[]) 

The important line here is line 17. The function calculate_the_answer() is an asynchronous function which immediately returns by returning a future. Thanks to the __await keyword on line 17, the rest of the coro() function can be implemented as if you are simply programming synchronously! No need anymore to mess around with task continuations or what not. This makes asynchronous programming much easier 😀

Read the full explanation here.


Visual Studio 2015 Preview

Microsoft has released a preview of Visual Studio 2015.
There are a lot of C++ changes included in this preview. You can read the full release notes here.

Here is a short version quoted from a blog post from Eric Battalio from Microsoft:

  • C++ Cross-Platform Mobile Development. C++ is attractive because it offers portability and a chance to reuse the same code on different platforms. With Visual Studio 2015 Preview, modern application developers can use the Visual C++ tool chain (c1xx, c2) to target Microsoft Windows Platforms and Clang / LLVM for targeting Android (with plans to support iOS in the near future). This makes it even easier to re-use existing C++ libraries to target multiple platforms (Android/Windows/iOS), share cross-platform code, and create high-quality Xamarin Native Android and Native-Activity applications using all of the power of Visual Studio. For a closer look, see Cross-Platform Mobile Development with Visual C++.
  • C++11, C++14, C++17 (proposed) compatibility. Standards support across compilers improves portability. With Visual Studio 2015 Preview, Visual C++ is even more compliant with user-defined literals (C++11), generic lambdas (C++14), and await (C++17 proposed). For a view of VS conformance in table form, see this post by Stephan Lavavej (STL). Also check out Details About Some of the New C++ Language Features, Improvements to Warnings in the C++ Compiler, and Resumable Functions in C++.
  • Enhanced productivity & build-time improvements. “Productivity” and “C++” are not often used in the same sentence except to criticize some aspect of the IDE, build process or diagnostics. Friction in any of these areas slows down the development process. With Visual Studio 2015 Preview, you get improvements in each including refactoring for C++ and improved IntelliSense database buildup and simplified QuickInfo for template deduction (IDE); incremental linking for static libs, new fast PDB generation techniques, multithreading in the linker (build); and dedicated space for analyzing graphics space using the Visual Studio Graphics Analyzer (VSGA) and you can view the impact of shader code changes without re-running the app (diagnostics). For more details about incremental build, see Speeding up the Incremental Build Scenario.
  • Improved performance. Most of the C++ developers we spoke with needed code to run fast, often as part of intensive data transformation or analysis or real-time control. Visual Studio 2015 Preview builds on the AVX2 support in Visual Studio 2013 to bring more general optimizations like loop-if unswitching, Vectorization of control flow, and increased support for Vectorization (including when optimizing in favor of smaller code). In addition we have a number of ARM32 compiler code generation improvements.

See Eric’s blog post here for a couple more links.
Download the Visual Studio 2015 Preview.


Visual Studio Community 2013

Microsoft announced the availability of Visual Studio Community 2013.
This Community edition replaces the Express editions.
You no longer have to decide which Express edition to use because the Community edition supports all kinds of development, web, mobile, desktop, …
Visual Studio Community 2013 includes all the functionality of Visual Studio Professional 2013.
Unlike the Express editions, the Community edition supports extensions.

Of course there are some restrictions on who can use this edition, but not many:

Here’s how individual developers can use Visual Studio Community:

  • Any individual developer can use Visual Studio Community to create their own free or paid apps.

Here’s how Visual Studio Community can be used in organizations:

  • An unlimited number of users within an organization can use Visual Studio Community for the following scenarios: in a classroom learning environment, for academic research, or for contributing to open source projects.
  • For all other usage scenarios: In non-enterprise organizations, up to 5 users can use Visual Studio Community. In enterprise organizations (meaning those with >250 PCs or > $1MM in annual revenue), no use is permitted beyond the open source, academic research, and classroom learning environment scenarios described above.

Download and get more information from here.


CppCon 2015 Announced

After the great success of CppCon 2014, CppCon 2015 has already been announced.
It will be held September 20-25 2015 in Bellevue, Washington, USA.
I highly recommend attending this conference if you are a C++ developer, so mark your calendars 🙂


CppCon 2014 Slides of Sessions

CppCon 2014 was a great success. There were over 100 sessions spanning 5 fully packed days.
All sessions were professionally recorded and will be available online in a month or so.
However, the slides and other material such as source code is already becoming available for download. Not everything is there yet. In the coming days, more material will become available as soon as the organizers receive the documents from the different speakers.
Download them here.


CppCon 2014

Two pictures of me at CppCon 2014.