September 2016

CppCon 2016 Call for Open Content

Do you have something to say to C++ programers?

CppCon 2016 Call for Open Content

by Michael Caisse

From the call:

Open Content is just that, open! Attendees and regular program speakers alike can propose sessions on anything that interests them.

 

Quick Q: Marking std::unique_ptr class member as const

Quick A: It prevents you of being able to move your class.

Recently on SO:

Marking std::unique_ptr class member as const

Because of the nature of a std::unique_ptr (sole ownership of an object) it's required to have no copy constructor whatsoever. The move constructor(6) only takes non-const rvalue-references which means that if you'd try to make your _child const and move it you'd get a nice compilation error smile

Even if a custom unique_ptr would take a const rvalue-reference it would be impossible to implement.

Quick Q: Is the std::array bit compatible with the old C array?

Quick A: Yes, you can copy bitwisely from one to the other.

Recently on SO:

Is the std::array bit compatible with the old C array?

The requirement on the data() method is that it return a pointer T* such that:

[data(), data() + size()) is a valid range, and data() == addressof(front()).

This implies that you can access each element sequentially via the data() pointer, and so if T is trivially copyable you can indeed use memcpy to copy sizeof(T) * size() bytes to/from an array T[size()], since this is equivalent to memcpying each element individually.

However, you cannot use reinterpret_cast, since that would violate strict aliasing, as data() is not required to actually be backed by an array - and also, even if you were to guarantee that std::array contains an array, since C++17 you cannot (even using reinterpret_cast) cast a pointer to an array to/from a pointer to its first member (you have to use std::launder).

CppCon 2015 Pruning Error Messages From Your C++ Template Code--Roland Bock

Have you registered for CppCon 2016 in September? Don’t delay – Registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2015 for you to enjoy. Here is today’s feature:

Pruning Error Messages From Your C++ Template Code

by Roland Bock

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Many template libraries are regarded with ambivalent feelings by developers: On the one hand, such libraries can offer wonderful functionality. On the other hand, they are dreaded for the sheer amount of error messages spilled out by the compiler when there is even a small bug in the developer's code. This talk will demonstrate several techniques to drastically reduce the amount of compiler output in case of errors (with real-life examples, of course).

Announcing the Meeting C++ Student Program

The Meeting C++ Student Program is live:

Announcing the Meeting C++ Student Program

by Jens Weller

From the article:

Rules

  • You are between 18 and 25 years old (Will be checked during registration at the event!)
  • 25 "Students" will be selected from all participants (randomly)
  • Definition of Student: I don't want to define or check who is a student or not. Hence age is only requirement. Age will be checked at the event.
  • The program covers the ticket, but not costs for travel and accomondation
  • Workshops are not included
  • No cheating or manipulation in any form (exclusion from program)
  • The ticket is not transferable, no refund for purchased tickets
  • There is no recourse to legal action

Can you sponsor Meeting C++ 2016?

The last call for sponsors for this years Meeting C++ conference:

Can you sponsor Meeting C++ 2016?

by Jens Weller

From the article:

A final call for sponsors! With only a few weeks left, its a good time to come on board as a sponsor!

With my trip to the Andels Hotel in Berlin I saw that this year Meeting C++ will also offer plenty of space for booth and hence companies to present themself to this years attendees! Also two more talk slots are available, and a few other options to present yourself as a sponsor at Meeting C++ are available!

CppCon 2015 Secure C++ Programming--Gwendolyn Hunt

Have you registered for CppCon 2016 in September? Don’t delay – Registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2015 for you to enjoy. Here is today’s feature:

Secure C++ Programming

by Gwendolyn Hunt

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Security vulnerabilities are fundamentally defects in our code. We know many of these defects stem from string processing, buffer overflows and integer underflow and overflows. These defects become security vulnerabilities when an attacker can crash an application, cause undefined behavior that leads to a Denial of Service, privilege escalation or hidden installation of rogue software.

So how do we build more secure C++ software? It starts by gaining an understanding of the basics of security vulnerabilities and how to identify them using the rich set of tools we now have available. With this foundation we can build a development culture where security considerations are pervasive and treated as important as program and algorithm correctness.

This session begins with a survey of common C/C++ string, integer and STL container issues and mitigations for these vulnerabilities. Follows with two detailed examples of vulnerabilities and how to fix their problems. Finishes with a survey of tools and references we have available today.

CppCon 2015 Demystifying Floating Point--John Farrier

Have you registered for CppCon 2016 in September? Don’t delay – Registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2015 for you to enjoy. Here is today’s feature:

Demystifying Floating Point

by John Farrier

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Every day we develop software that relies on math while we often overlook the importance of understanding the implications of using our IEEE floats. From the often cited “floating point error” to unstable algorithms, this talk will explain the importance of floats, understanding their storage, the impact of the IEEE floats on math, and designing algorithms better. Finally, the talk will conclude with a quick case study of storing time for games and simulations.

Bugs found in GCC with the help of PVS-Studio

I regularly check various open-source projects to demonstrate the abilities of the PVS-Studio static code analyzer (C, C++, C#). Now it is time for the GCC compiler to get checked.

Bugs found in GCC with the help of PVS-Studio

by Andrey Karpov

From the article:

This part could also be called "Example number one thousand, why macros are bad". I really don't like macros and always urge people to avoid using them if possible. Macros make it difficult to read the code, provoke errors, and make the work of static analyzers harder. As best I can tell, from a brief interaction with the GCC code, the authors are big fans of macros. I was really tired looking at what the macros are expanded to, and perhaps missed quite a number of interesting errors. I should confess that I was lazy at times. But still, I will demonstrate a couple of errors, connected with macros.