April 2015

CppCon 2014 Exception-Safe Code, Part IIIā€”Jon Kalb

While we wait for CppCon 2015 in September, we’re featuring videos of some of the 100+ talks from CppCon 2014. Here is today’s feature:

Exception-Safe Code, Part III

by Jon Kalb

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Are you 100% confident that your code is exception-safe?

Safe usage of exceptions is a non-trivial problem that the industry has struggled with for the better part of two decades. If you have fear, uncertainty, or doubt about exception safety or just want to see the best practices for using exceptions in C++ and/or C++11/14, this session is for you. We’ll start with “What is the problem we are trying to solve?” and discuss alternatives, acknowledge the challenges associated with exception usage, and cover some well-meaning but misguided attempts at safety. I will then present a set of guidelines that are the basis for safe exception usage and solid implementation techniques, including how to transition from an exception-unsafe legacy code base.

When we are finished you will know how to produce code that is easier to write, easier to understand, faster, and 100% robust in the face of exceptions.

CppCon 2014 Exception-Safe Code, Part II--Jon Kalb

While we wait for CppCon 2015 in September, we’re featuring videos of some of the 100+ talks from CppCon 2014. Here is today’s feature:

Exception-Safe Code, Part II

by Jon Kalb

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Are you 100% confident that your code is exception-safe?

Safe usage of exceptions is a non-trivial problem that the industry has struggled with for the better part of two decades. If you have fear, uncertainty, or doubt about exception safety or just want to see the best practices for using exceptions in C++ and/or C++11/14, this session is for you. We'll start with "What is the problem we are trying to solve?" and discuss alternatives, acknowledge the challenges associated with exception usage, and cover some well-meaning but misguided attempts at safety. I will then present a set of guidelines that are the basis for safe exception usage and solid implementation techniques, including how to transition from an exception-unsafe legacy code base.

When we are finished you will know how to produce code that is easier to write, easier to understand, faster, and 100% robust in the face of exceptions.

Don't blame initializer_list prematurely -- Marco Arena

A post on three common pitfalls regarding initializer_list...or not? 

Don't blame initializer_list prematurely

by Marco Arena

From the article:

“Cannot convert initializer list argument to ‘int*'”. People started trying to figure out why initializer_list was not covertible to int[]. [...] A gentleman spotted the following in the dark corners of the codebase:

vector<YahtzeeGame> games;
games.push_back(make_tuple(5, 6, 2));
games.push_back(make_tuple(5, 6, 3));
games.push_back(make_tuple(5, 6, 4));
// other stuff

Excited about C++11, he tried to refactor:

vector<YahtzeeGame> games = { {5, 6, 2}, {5, 6, 3}, {5, 6, 4} };
And does it compile? ...

Regular expression in c++11/14 -- GuoJiufu

Overview on Regular Expression Support in Modern C++.

   Regular expression in c++11/14

   by GuoJiufu

From the article:

Regular expression is a useful string process utility for handling both pure text and markup language text like html. There are a few useful tools that are designed to use regular expression, such as  grep and sed. In development language, most script languages, for example, javascript or perl, support regular expression. Regular expression has also been introduced into java as module for a long time. In C, the most famous regular expression library among many of those libraries developed would be POSIX regular expression API. As for C++, boost regular expression library was developed a few years ago. Then in C++11, regular expression was introduced into the standard library as <regex>.  This blog is going to explain what is regular expression and how it is supported in c++11/14.

boost 1.58 - a short overview -- Jens Weller

Short overview on the new libraries introduced in boost 1.58.

   boost 1.58 - a short overview

   by Jens Weller

From the article:

A new version of boost has been released, version 1.58 brings two new libraries and a lot of bug fixes (fixes for 28 libraries are listed). Also, a good resource for boost is the new and updated book about the boost libraries from Boris Schäling, which is also available online. Not included in this release is boost.compute, a library earlier this year accepted into boost and presented at C++Now, maybe it will be in 1.59 later this year.

Making Boost.Signals2 More OOP-Friendly -- Pavel Frolov

This article shows how modern C++ features, notably variadic templates and perfect forwarding, can be used to implement a generic variant of observer pattern without the help of either macros or proprietary compiler extensions.

Making Boost.Signals2 More OOP-Friendly

by Pavel Frolov

From the article:

The observer design pattern is by far the most popular and widely known among behavioural patterns. Unfortunately, unlike other mainstream languages out there, the C++ standard library doesn’t provide out of the box observer implementation. Luckily, Boost contains Signals2, a signal/slot library which can serve as a basis for an observer. Using Signals2 as it is, however, is not so convenient in object-oriented program due to the need of manually coded register and notify class methods for each of signal/slot pairs. This article suggests an observable mixin which attempts to solve the outlined problem.

CppCon 2014 Exception-Safe Code, Part I--Jon Kalb

While we wait for CppCon 2015 in September, we’re featuring videos of some of the 100+ talks from CppCon 2014. Here is today’s feature:

Exception-Safe Code, Part I

by Jon Kalb

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Are you 100% confident that your code is exception-safe?

Safe usage of exceptions is a non-trivial problem that the industry has struggled with for the better part of two decades. If you have fear, uncertainty, or doubt about exception safety or just want to see the best practices for using exceptions in C++ and/or C++11/14, this session is for you. We'll start with "What is the problem we are trying to solve?" and discuss alternatives, acknowledge the challenges associated with exception usage, and cover some well-meaning but misguided attempts at safety. I will then present a set of guidelines that are the basis for safe exception usage and solid implementation techniques, including how to transition from an exception-unsafe legacy code base.

When we are finished you will know how to produce code that is easier to write, easier to understand, faster, and 100% robust in the face of exceptions.

Boost Version 1.58 Released

The next version of boost is released.

Boost 1.58

From the release note:

These new libraries were added:

  • Endian: Types and conversion functions for correct byte ordering and more regardless of processor endianness.
  • Sort: Includes spreadsort, a general-case hybrid radix sort that is faster than O(n*log(n))

A huge number of bugfixes and improvements were implemented for the existing libraries.

 

Many thanks to all contributors and maintainer!

CppCast Episode 8: Biicode and Turbo with Manuel Sanchez

Episode 8 of CppCast the only podcast by C++ developers for C++ developers. In this episode Manuel Sanchez joins Rob Irving to talk about Biicode, the C++ dependency manager and Manuel's Template Metaprogramming Library Turbo.

CppCast Episode 8: Biicode and Turbo with Manuel Sanchez

by Rob Irving

About the interviewee:

As a CS undergraduate at the University of Madrid (Spain) and self taught C++ programmer, Manuel Sanchez has been working on personal projects related to Modern C++ during his free time, most of them related to template metaprogramming and his own efforts to give high level features for C++ metaprogramming: The Turbo Metaprogramming Library. Manuel has been working for biicode since September 2014, he assist his fellow biis by dealing with C++ idiosyncrasies while manage very successful posts about template metaprogramming and his work on Turbo.

biicode Dependency Manager released to Open Source

biicode just released the client code of their C++ Dependency Manager into OpenSource.

C/C++ Dependency Manager

From the Website:

biicode manages your project’s dependencies so you can use the libs you need (Curl, Catch, Fann, OpenSSL, OpenCV, POCO, Boost, Libuv, GTest ...) as you wish within your project. biicode uses CMake to configure and build your projects and it is compatible with many IDEs, version control systems and compilers.