C++ Weekly Episode 28: C++17's [[fallthrough]] Attribute—Jason Turner
Episode 28 of C++ Weekly.
C++17's [[fallthrough]] Attribute
by Jason Turner
About the show:
Understanding the new [[fallthrough]] attribute added in C++17 through examples.
March 19-21, Madrid, Spain
April 1-4, Bristol, UK
June 16-21, Sofia, Bulgaria
By Jason Turner | Sep 16, 2016 01:26 PM | Tags: c++17 basics
Episode 28 of C++ Weekly.
C++17's [[fallthrough]] Attribute
by Jason Turner
About the show:
Understanding the new [[fallthrough]] attribute added in C++17 through examples.
By Andrey Karpov | Sep 15, 2016 05:11 AM | Tags: c++17 c++11 basics
One of the main problems with C++ is having a huge number of constructions whose behavior is undefined, or is just unexpected for a programmer. Let's see which techniques in modern C++ help writing not only simple and clear code, but make it safer and more reliable.
How to avoid bugs using modern C++
by Pavel Belikov
From the article:
Of course, there are some flaws in the range-based for: it doesn't allow flexible management of the loop, and if there is more complex work with indexes required, then for won't be of much help to us. But such situations should be examined separately. We have quite a simple situation: we have to move along the items in the reverse order. However, at this stage, there are already difficulties. There are no additional classes in the standard library for range-based for. Let's see how it could be implemented.
By Adrien Hamelin | Sep 12, 2016 01:43 PM | Tags: community basics
Here is a beginner's guide:
Starting With the Poco Libraries
by Arne Mertz
From the article:
Recently I started to use the web server functionality of Poco. Today I’ll describe my first experiences with the library.
By Adrien Hamelin | Sep 9, 2016 12:06 PM | Tags: c++11 basics
Let's review the basics!
Great Expectations
by Glennan Carnie
From the article:
Previously, we’ve looked at the basic concepts of function parameter passing, and we’ve looked at the mechanics of how parameters are passed at the Application Binary Interface (ABI) level.
Far too often we focus on the mechanisms and efficiency of parameter passing, with the goal: if it’s efficient then it’s good; that’s all there is to it. In this article I want to move past simple mechanics and start to explore function parameter design intent – that is, what can I expect (to change) about the objects I use as function arguments; and what can I expect to be able to do with an object as a function implementer.
To that end, we’ll take a look at parameter passing from the perspective of the mutability (ability to be modified) of the parameters from both a caller’s and a function’s (callee’s) point of view...
By Jason Turner | Sep 8, 2016 08:10 PM | Tags: c++17 basics
Episode 27 of C++ Weekly.
C++17 Changes To Sequence Containers
by Jason Turner
About the show:
This week Jason covers what changes to expect to the sequence containers (for example, std::vector) in the upcoming C++17 standard.
By Adrien Hamelin | Sep 7, 2016 02:37 PM | Tags: c++11 basics
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 errorEven if a custom
unique_ptr
would take a const rvalue-reference it would be impossible to implement.
By Andrey Karpov | Sep 1, 2016 02:01 AM | Tags: static code analysis pvs-studio gcc bugs basics
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.
By Meeting C++ | Sep 1, 2016 12:58 AM | Tags: user group community basics
The monthly overview on upcoming C++ User Group meetings by Meeting C++:
C++ User Group meetings in September
by Jens Weller
From the article:
Another month, another round of User Group Meetings! September has lots of User Groups meeting (32 in total), and offers a highlight of the C++ year: CppCon!
There are 2 new C++ User Groups: Cary, NC and Bangalore (Qt)...
By Adrien Hamelin | Aug 29, 2016 11:34 AM | Tags: efficiency basics
This article changed my vision about exceptions:
Top 15 C++ Exception handling mistakes and how to avoid them
by Deb Haldar
From the article:
Do you use exception handling in your C++ code?
If you don’t, why not?
Perhaps you’ve been conditioned to believe that exception handling is bad practice in C++. Or maybe you think that it’s prohibitively expensive in terms of performance. Or maybe it’s just not the way your legacy code is laid out and you’re stuck in the rut.
Whatever your reason is, it’s probably worth noting that using C++ Exceptions instead of error codes has a lot of advantages. So unless you’re coding some real-time or embedded systems, C++ exceptions can make your code more robust, maintainable and performant in the normal code path (yes performant, you read that right !).
In this article we’re going to look at 15 mistakes that a lot of developers make when just stating off with C++ exceptions or considering using C++ exceptions...
By Mantosh Kumar | Aug 23, 2016 09:30 PM | Tags: c++17 basics
Episode 25 of C++ Weekly.
C++17's Aggregate Initializations
by Jason Turner
About the show:
In this episode Jason introduces C++17's Aggregate Initializations.