Project

General

Profile

const-correctness in C++

Added by Kretz, Matthias almost 8 years ago

On Wednesday (April, 1st) we'll have our next C++ user group meeting. (15:00 in 0|200 at FIAS)

I have prepared a talk (~30 min) on “const-correctness in C++”:

The const keyword (and related facilities, such as mutable and const_cast) is one of the things in C++ that look easy and straightforward. However, once you take a deeper look, the feature may appear confusing or even counterproductive. (The C++ FAQ recommends to sit down and ensure that no "sharp implements [are] nearby" before it explains the core issue.)

This talk will present a thorough introduction of the syntax and semantics of const. This will ultimately lead to the question of the intended use of const. The second part of the talk therefore explains how const is used correctly, how this leads to const-correct interfaces, and why this improves maintainability and reduces coding errors.

Following the talk we will have time for open discussion on C++ topics. So, if you have a C++ programming question, bring it along!


Comments