A better date and time C++ library--Marius Bancila

Did you know that library?

A better date and time C++ library

by Marius Bancila

From the article:

C++11 added a date and time utility library called chrono, available in namespace std::chrono and header <chrono>. The problem with it is that the library is a general purpose one and therefore lacks many useful features, such as working with dates, weeks, calendars, timezones and other related features. Fortunately, a rich date and time library based on chrono has been created by Howard Hinnant and is available on github...

Coroutines Internals--Marco Alesiani

What are coroutines and why should you care?

Coroutines Internals

    by Marco Alesiani

From the article:

Coroutines provide a powerful abstraction to offer the same level of concurrency one would get with asynchronous callbacks by offering at the same time a chance to write more maintainable code..

Quick Q: Is there a case where ellipsis(vararg) should be preffered over variadic templates?

Quick A: There are several special cases where you may want that, but in general no.

Recently on SO:

Is there a case where ellipsis(vararg) should be preffered over variadic templates?

  1. If you provide a C API with C++ implementation, then templates are not an option for the API. Varargs are.
  2. If you need to support a compiler that doesn't support C++11 or newer standard, then variadic templates are not available. Varargs are.
  3. If you need a compilation firewall. I.e. you need to hide the implementation of the function from the header, then variadic template is not an option. Varargs are.
  4. On memory constrained systems (embedded), the different functions generated by the template may introduce too much bloat. That said, such systems are typically also real time, in which case varargs might also unacceptable due to branching and stack usage.

38 C++ User Group Meetings in November

The monthly overview on upcoming C++ User Group meetings

C++ User Group meetings in November 2016

by Jens Weller

From the article:

This month features 38 C++ User Group meetings already! Plus several C++ Conferences, including Meeting C++ 2016! I included since this month also the LLVM groups which are meeting, there are a few. This is why this month has also 12 new User Groups, with the latest additions of a new group in London and Melbourne!

There are 12 new C++ User Groups: Kitchener, OT, Brussels, Cluj (Qt), Berlin (llvm), St. Petersburg (llvm), Paris (llvm), Bay area (llvm), Cambridge (llvm), Denver, Minsk, London and Melbourne.

Finding bugs in the code of LLVM project with the help of PVS-Studio

Let's take a look at the suspicious fragments in the LLVM code which PVS-Studio detected.

Finding bugs in the code of LLVM project with the help of PVS-Studio

by Andrey Karpov

From the article:

LLVM developers, of course, will be able to understand if there is a bug here or not. I have to play detective. Looking at the code, I was thinking in the following direction: The function should read the opening bracket '<', then it reads the identifiers and commas in the loop. If there is no comma, we expected a closing bracket. If something goes wrong, then the function returns an error code. I reckon there was supposed to be the following algorithm of the function work (pseudocode).

CppCast Episode 76: Embedded Development with Dan Saks

Episode 76 of CppCast the only podcast for C++ developers by C++ developers. In this episode Rob and Jason are joined by Dan Saks from Saks & Associates to discuss state of C++ in the embedded development industry.

CppCast Episode 76: Embedded Development with Dan Saks

by Rob Irving and Jason Turner

About the interviewee:

Dan Saks is the president of Saks & Associates, which offers training and consulting in C and C++ and their use in developing embedded systems. He has been a columnist for The C/C++ Users Journal, The C++ Report, Embedded Systems Design, embedded.com and several other publications. Dan served as the first secretary of the C++ Standards Committee and contributed to the CERT Secure Coding Standards for C and C++.

Modern C++ Features – User-Defined Literals--Arne Mertz

Learn more about litterals.

Modern C++ Features – User-Defined Literals

by Arne Mertz

From the article:

User-defined literals are a convenient feature added in C++11.

C++ always had a number of built-in ways to write literals: Pieces of source code that have a specific type and value. They are part of the basic building blocks of the language:

32 043 0x34   //integer literals, type int
4.27 5E1      //floating point literals, type double
'f', '\n'     //character literals, type char
"foo"         //string literal, type const char[4]
true, false   //boolean literals, type bool

These are only the most common ones, there are many more, including some newcomers in the newer standards. Other literals are nullptr and different kinds of prefixes for character and string literals. There also are suffixes we can use to change the type of a built-in numeric literal:

32u     //unsigned int
043l    //long
0x34ull //unsigned long long
4.27f   //float
5E1l    //long double