Articles & Books

Foreign Constructors--Gerard Meier

A nice technique to initialize complex objects simply with one constructor:

Foreign Constructors

by Gerard Meier

From the article:

Recently I found myself extending a game engine with font rendering support. Fonts have a lot of properties, so naturally I created a tidy structure to hold all parameters. Whenever drawing a piece of text: I'd simply pass this structure along.

A philosophy I follow, is one of programmer convenience. For example: I always specify default values; when you instantiate a class without any parameters, it is directly usable. Following from that, whenever you call an method or constructor - you should not have to specify not used parameters. This adds a practical issue: it requires all kinds of constructors...

 

Bitesize Modern C++: std::initializer_list--Glennan Carnie

Do you know how to use initializer lists?

Bitesize Modern C++: std::initializer_list

by Glennan Carnie

From the article:

An aggregate type in C++ is a type that can be initialised with a brace-enclosed list of initialisers. C++ contains three basic aggregate types, inherited from C:

  • arrays
  • structures
  • unions

Since one of the design goals of C++ was to emulate the behaviour of built-in types it seems reasonable that you should be able to initialise user-defined aggregate types (containers, etc.) in the same way...

QWidgets and data

The sixt part of my series takes a look at QWidgets and how to exchange data:

QWidgets and data

by Jens Weller

From the article:

The sixt part of my series about writing applications in C++ using Qt and boost is about my thoughts on widgets and how to interact with data from them.

Overload 128 is now available

ACCU’s Overload journal of August 2015 is out. It contains C++ related articles.

Overload 128

From the journal:

Don’t Design for Performance Until It’s Too Late: People claim optimisation can cause unreadable code. Andy Balaam argues good performance should be at the core of code design. by Andy Balaam

Template Programming Compile Time String Functions: Practising old exercises in new ways can keep you sharp. Nick Weatherhead demonstrates some well-known code katas using C++ compile time tricks. by Nick Weatherhead

A generic context menu class for Qt

An unplanned 5th entry in my series on writing applications in C++ using Qt and boost:

A generic context menu class for Qt

by Jens Weller

From the article:

I didn't plan to write a second post on menus. But a reply on twitter caused me to over think my code I presented yesterday. Its not an very important part, so that I moved on once it did run. So, the simple question, why I would not connect the menus to a slot instead of using a switch was a good one. It would restructure the code, and slots are also callable from the outside world, while the switch buries the code inside a method...

Menus and Widgets in Qt

The fourth part of my series about developing applications with C++ using Qt and boost:

Menus and Widgets in Qt

by Jens Weller

From the article:

Lets start with how Qt sees and handles menus. You can easily create a window menu in the RAD Editor of QtCreator, and then add a slot for its triggered() signal. But for a context menu...

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