Articles & Books

Overload 139 is now available

ACCU’s Overload journal of June 2017 is out. It contains the following C++ related articles.

Overload 139 is now available

From the journal:

I am not a number
Description : When is a number not a number? Frances Buontempo counts the ways this happens. by Frances Buontempo

Allocator for (Re)Actors with Optional Kinda-Safety and Relocation
How do you deal with memory for (Re)Actors? Sergey Ignatchenko proposes an allocation scheme. by Sergey Ignatchenko

Initialization in C++ is Bonkers
Uninitialised variables can cause problems. Simon Brand reminds us how complicated it can get. by Simon Brand

Vulkan and you – Khronos’ successor to OpenGL
Various graphics APIs exist. Andy Thomason unravels the mysteries of Vulkan, the latest 3D Graphics API from Khronos, the custodians of OpenGL. by Andy Thomason

Kotlin for C++ Developers
What could a language the originated on the JVM possibly offer C or C++ devs? Hadi Hariri tells us. by Hadi Hariri

Getting Tuple Elements with a Runtime Index
Accessing a tuple with a runtime index is a challenge. Anthony Williams shows us his approach. by Anthony Williams

Afterwood
What makes programming fun? Chris Oldwood ponders what floats his boat. by Chris Oldwood

Quick Q: When is an rvalue evaluated?

Quick A: When it is assigned.

Recently on SO:

When is an rvalue evaluated?

s2 binds to the expression s1 + s1, but is this evaluated at the time s2 is assigned

Yes.

And also would s2 hold memory for a temporary string?

Precisely, s2 is bound to a temporary std::string.

s1 + s1 will produce a temporary std::string, which will be bound to the reference s2 (and its lifetime is extended to the lifetime of the reference). Then s2 += "Test";, performs operator+=() on  s2, i.e. the temporary std::string.

C++ Online Compilers--Arne Mertz

Did you ever use them?

C++ Online Compilers

by Arne Mertz

From the article:

Online compilers can be useful tools to quickly compile a snippet of code without having to install a proper compiler on our computer. They can be especially useful to play with the newest language features, to share code snippets online or to compare different compilers...

A self-contained Pool in C++14--Jens Weller

How to do a pool?

A self-contained Pool in C++14

by Jens Weller

From the article:

During C++Now I started writing a small application, that plays around with dlibs face recognition features. More on this later, the program uses the QThreadPool, and some researched showed that calling dlib::get_frontal_face_detector() is a very expensive operation. So I decided to write a thread safe pool to share the face detection object between threads, only loading as many as needed. The main thread owns the pool which owns the detection objects...

Accelerating your C++ on GPU with SYCL -- Simon Brand

A post on writing GPGPU code in C++ using the SYCL standard from the Khronos group.

Accelerating your C++ on GPU with SYCL

By Simon Brand

From the article:

Leveraging the power of graphics cards for compute applications is all the rage right now in fields such as machine learning, computer vision and high-performance computing. Technologies like OpenCL expose this power through a hardware-independent programming model, allowing you to write code which abstracts over different architecture capabilities. The dream of this is “write once, run anywhere”, be it an Intel CPU, AMD discrete GPU, DSP, etc. Unfortunately, for everyday programmers, OpenCL has something of a steep learning curve; a simple Hello World program can be a hundred or so lines of pretty ugly-looking code. However, to ease this pain, the Khronos group have developed a new standard called SYCL, which is a C++ abstraction layer on top of OpenCL. Using SYCL, you can develop these general-purpose GPU (GPGPU) applications in clean, modern C++ without most of the faff associated with OpenCL.

C++Now 2017--Michael Park

Trip report!

C++Now 2017

by Michael Park

From the article:

I just returned from C++Now 2017 in Aspen, CO. This was my second time attending the conference and it was just as amazing as last year. My girlfriend decided to come along this time, since Aspen is such a beautiful place. We flew into Denver, rented a car and took the beautiful 4-hour drive into Aspen. She was very happy ��. Strongly recommended...