Articles & Books

19 C++ User Group Meetings in August

The monthly overview on upcomging C++ User Group meetings:

19 C++ User Group Meetings in August

by Jens Weller

A short overview:

5.8 C++ UG Saint Louis - "Fun with Lambdas" Lightning Talk\, Interview Questions and more
5.8 C++ UG Austin - Introduction to the QT Framework using C++ and QML
6.8 C++ UG Edinburgh - C++ Edinburgh
10.8 C++ UG Denver - Denver Tech Center C++ Developers
12.8 C++ UG Utah - Regular Monthly Meeting
12.8 C++ UG San Francisco/ Bay area - Presentation and Q&A
12.8 C++ UG Washington, DC - Q & A / Info Sharing
17.8 C++ UG Austin - North Austin Monthly C/C++ Pub Social
17.8 C++ UG Juce - Deploy Pure Data patches to any OS with JUCE
18.8 C++ UG Berlin - TBA
19.8 C++ UG Düsseldorf - Treffen der C++ User Gruppe NRW
19.8 C++ UG Hamburg - constexpr
20.8 C++ UG Ruhrgebiet - August Meetup - std::advance(CodingStandard, Modern::c++)
24.8 C++ UG Göteborg - Let's meetup and discuss the format for this group
25.8 C++ UG Chicago - Using NuGet to manage external dependencies in Visual C++ builds
26.8 C++ UG San Francisco/ Bay area - Workshop and Discussion Group
26.8 C++ UG Washington, DC - Q & A / Info Sharing
26.8 C++ UG Aarhus - Access Guards
27.8 C++ UG Munich - Pruning Error Messages From Your C++ Template Code

Bitesize Modern C++: Uniform initialization--Glennan Carnie

Do you know how the uniform initialization?

Bitesize Modern C++: Uniform initialization

by Glennan Carnie

From the article:

C++98 has a frustratingly large number of ways of initialising an object.

(Note: not all these initialisations may be valid at the same time, or at all. We’re interested in the syntax here, not the semantics of the class X)

One of the design goals in C++11 was uniform initialisation syntax...

Trees, tree models and treeviews in Qt

The first part in my series on writing applications with C++ using Qt and boost:

Trees, tree models and treeviews in Qt

by Jens Weller

From the article:

On Tuesday I've announced this new series, this is the first installment showing the progress. The first thing I did when I started to work on my new application, was to implement a generic tree class, that then is exposed through not so generic tree model to Qt. The QTreeView then simply displays the data in the tree. My goals are, that the class containing the tree it self, is independent from Qt. Yet as its used in Qt, there are a few design decisions which reflect the needs of the Qt Model View system...

Building Applications with Qt and boost

I'm starting a series on my blog and youtube channel, about building an application in C++:

Building Applications with Qt and boost

by Jens Weller

From the article:

This is the start of a series of posts, in which I'll try to document my weekly work on a new application, build with Qt and boost. This first post is rather short, but I'd quickly try to give you an overview, why I use both Qt and boost in the same application. Regarding Qt, I wrote an introduction a two years ago, also for boost, there is an excellent website/tutorial about boost by Boris Schäling (buy his book! wink). This series is not meant as a general introduction, yet I try to show you how and what I use of Qt and boost.

std::shared_ptr's secret constructor -- Anthony Williams

std::shared_ptr has a secret: the aliasing constructor, that most users don't even know exists, but which is surprisingly useful. 

std::shared_ptr's secret constructor

by Anthony Williams

From the article:

What does this secret constructor do for us? It allows us to construct a new shared_ptr instance that shares ownership with another shared_ptr, but which has a different pointer value...

 

 

boost::variant and a general, generic visitor class

Starting a new project with boost::variant, I got into thinking about a general generic visitor for boost::variant...

boost::variant and a general, generic visitor class

by Jens Weller

From the article:

So, I started a new project, and I do use boost::variant to be able to stick otherwise unrelated classes into the same container. Actually a tree, but that doesn't matter here. With boost::variant, you simply derive your visitor class from the static_visitor class, which lets you visit the types in a boost::variant via the call operator. When you want to do always the same for all types, you simply can add a template method version of the call operator...

Time Zone Database Parser -- Howard Hinnant

This page fully documents a library to handle time zones in C++11 and C++14.

The library documentation

by Howard Hinnant

From the article:

Introduction

I had just completed writing date, which is a library for extending <chrono> into the realm of calendars, and I was looking around for the most challenging date time problem I could find with which I could demonstrate the power of this new library. "I know," I said to myself, "I'll handle all the world's time zones, and maybe even leap seconds!" Thus began my journey into a rabbit hole which I knew existed, but had never truly appreciated the intricacies of.

This library adds timezone and leap second support to this date library. This is a separate library from date because many clients of date do not need timezone nor leap second support, and this support does not come for free (though the cost is quite reasonable).

This library is a complete parser of the IANA Time Zone Database. This database contains timezone information that represents the history of local time for many representative locations around the globe. It is updated periodically to reflect changes made by political bodies to time zone boundaries, UTC offsets, and daylight-saving rules. The database also maintains a list of leap seconds from 1972 through the present.

The IANA Time Zone Database contains four specific types of data:

Zone: A geographic location with a human-readable name (e.g. "America/New_York") which specifies the offset from UTC and an abbreviation for the zone. This data includes daylight saving rules, if applicable, for the zone. This data is not only the rules currently in effect for the region, but also includes specifications dating back to at least 1970, and in most cases dating back to the mid 1800's (when uniform time was first introduced across regions larger than individual towns and cities).

Rule: A specification for a single daylight-saving rule. This helps implement and consolidate the specifications of Zones.

Link: This is an alternative name for a Zone.

Leap: The date of the insertion of a leap second.

The library documented herein provides access to all of this data, and offers efficient and convenient ways to compute with it. And this is all done based on the date library, which in turn is based on the C++11/14 <chrono> library. So once you've learned those fundamental libraries, the learning curve for this library is greatly eased.

A date and time library for use with C++11 and C++14 -- Howard Hinnant

This paper fully documents a date and time library for use with C++11 and C++14.

Library documentation:

by Howard Hinnant

From the article:

Implementation

This entire library is implemented in a single header: date.h and is open source (with generous open source terms — not generous enough? Contact me, I'm flexible).

It uses the algorithms from chrono-Compatible Low-Level Date Algorithms. If you want detailed explanations of the algorithms, go there.

It performs best with C++14, which has vastly improved constexpr rules. However, the library will auto-adopt to C++11, sacrificing several constexpr declarations. In C++11, this will effectively transfer some computations that should be done at compile-time to run-time. Porting to C++98/03 has not been attempted.

Overview

This library builds date and date/time support on top of the <chrono> library. However it does not support timezones nor leap seconds. A separate library is provided, built on top of this one, for timezone and leap second support. Thus you only pay for such support if you need it.