Category Archive for C++

Visual Studio 2017 Released

Next BeCPP UG Meeting Planned For April 11th, 2017

The next meeting of the Belgian C++ Users Group is planned for Tuesday April 11th, 2017 at 18:00 at VUB.

SoftKinetic ( https://www.softkinetic.com/ ) is sponsoring this event by providing the location, drinks and catering.

SoftKinetic Logo
The agenda is as follows:

  • 18:00: Sandwiches.
  • 18:30: Session 1: Challenges in Modern Embedded Development Using C++ (Glyn Matthews)
    This talk will cover things such as constrained systems (e.g. CPU, cache, memory), older compilers affecting the use of library and language features from the 2011 standard and beyond, porting, testing etc. One theme will be that what’s “standard” and “modern” is not what you need to get your software working. In some ways, I’d like to push back a bit on the trend to more modern code bases, because it turns out it’s quite rare for developers to have access to the latest language features (and by “latest” I mean 6 years old…)
  • 19:30: Break
  • 19:45: Session 2: SFINAE and type traits: In the Mix (Lieven de Cock)
    The journey will start with a test drive of simple method overloading, shortly later enriched with some ‘templates’ laps. Then we shift gears and we add type traits to the mix. In order to arrive at the finish line, some SFINAE herbs are added to spice up the mix. And as the proof of the pudding is in the eating, a small use case, which will bring things together, will be served.
    In the end the main question remaining is: do we std::enable_if some drinks afterward?
  • 20:45: Short presentation and demo by SoftKinetic 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 April 4th, 2017!

Share

Next BeCPP UG Meeting Planned For January 24th, 2017

The next meeting of the Belgian C++ Users Group is planned for Tuesday January 24th, 2017 at 18:00 at Nobel Biocare.

Nobel Biocare ( https://www.nobelbiocare.com/ ) is sponsoring this event by providing the location, drinks and catering.

Nobel Biocare Logo
The agenda is as follows:

  • 18:00: Sandwiches.
  • 18:30: Session 1: What’s new in C++17, Part 2? (Peter Van Weert)
    This talk will continue the talk from November 2016, giving an overview of all the new features scheduled to be included in C++17. This second part will focus more on library changes.
  • 19:30: Break
  • 19:45: Session 2: Coming to terms with C++ in a huge financial application (Cosmin Cremarenco)
    Murex is a large financial application – ~15M lines of code of C/C++. Migrating from C to C++ has come with enormous challenges. Essential components had to be upgraded to what a C++ programmer naturally expects today. A legacy object framework based on C had to be deprecated in favour of C++, the build system had to be upgraded, proper testing put in place, processes devised to how third-party libraries are introduced in our codebase and used and, finally, a performant serialization system that is in-line with today’s expectations on latency and throughput when communicating between components written in different or same programming language.
  • 20:45: Short presentation/demo by Nobel Biocare 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.

C++ Standard Library Quick Reference

We will be giving away a copy of C++ Standard Library Quick Reference.

Note: The deadline for registrations is January 20th, 2017!

Share

CppCon 2016 Videos Available Online


CppCon 2016 was again a great success. I’m looking forward to next year’s edition.
In the meantime, all sessions are now available on the CppCon YouTube video channel.
Enjoy all the material 🙂

Share

Next BeCPP UG Meeting Planned For November 24th, 2016

The next meeting of the Belgian C++ Users Group is planned for Thursday November 24th, 2016 at 18:00 at Nikon Metrology HQ.

Nikon Metrology ( http://nikonmetrology.com/ ) is sponsoring this event by providing the location, drinks and catering.

Nikon Metrology Logo

The agenda is as follows:

  • 18:00: Sandwiches.
  • 18:30: Session 1: What’s new in C++17? (Peter Van Weert)
    This talk will give an overview of all the new features scheduled to be included in C++17.
  • 19:30: Break
  • 19:45: Session 2: Mobile App Development for Multiple Platforms with Visual C++, 2016 (Marc Gregoire)
    Visual C++ supports mobile app development for Windows, Android, and iOS from a single code base, optionally with a thin platform-specific UI layer. The resulting binaries can be deployed to an emulator or to a real device and debugged on both, all from within Visual C++. This presentation is a follow up of my previous BeCPP presentation, and as such the session will only briefly cover the basics of cross-platform mobile app development. Please view https://www.youtube.com/watch?v=2Y47g8xNE1o or https://channel9.msdn.com/events/CPP/CppCon-2015/CPPConD02V019 for this material in depth. In this follow up, we go over the new features added for cross-platform development since last year. Additionally, we continue where last year’s session ended, and will go deeper on how to write your applications to have a native look-and-feel UI on each of the different platforms.
  • 20:45: Short presentation and guided tour of Nikon Metrology 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.

C++ Standard Library Quick Reference

We will be giving away a copy of C++ Standard Library Quick Reference.

Note: The deadline for registrations is November 20th, 2016!

Share

Slides of my CppCon 2016 Presentation “Mobile App Development for Multiple Platforms with Visual C++, 2016″

On September 22th, 2016 I gave a presentation titled “Mobile App Development for Multiple Platforms with Visual C++, 2016” at CppCon 2016.
The slides of my presentation can be downloaded below:


Looking forward to next year’s edition of CppCon, which has been announced to be on September 25th-29th in Bellevue, Washington 🙂

Share

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.

Share

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
Share

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 ( http://www.newtec.eu/ ) is sponsoring this event by providing the location, drinks and catering.

Newtec

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!

Share

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

GDG-program-logo
 

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

Share

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.

Share

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 ( https://www.selligent.com/ ) 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!

Share

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 🙂

Share

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).

Share

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.


Share

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.

Share

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 ( https://ompartners.com/ ) 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.

cppdependlogo2

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!

Share

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 ( http://www.tomra.com/ ) is sponsoring this event by providing the location, drinks and catering

TOMRA

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!

Share

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 🙂

Share

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[]) 
{ 
    coro().get(); 
}

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.

Share