C++ in 2015
My yearly overview on the things that might come:
C++ in 2015
by Jens Weller
From the article:
The year is still young, so lets have an outlook about what is going to happen in C++ Land in 2015...
By Meeting C++ | Jan 15, 2015 07:32 AM | Tags: community c++14 basics
My yearly overview on the things that might come:
C++ in 2015
by Jens Weller
From the article:
The year is still young, so lets have an outlook about what is going to happen in C++ Land in 2015...
By Mantosh Kumar | Jan 14, 2015 06:58 PM | Tags: None
Discussion on how to use/replace auto for loop index variables.
Reader Q&A: auto and for loop index variables
by Herb Sutter
From the reader's question:
So I’ve been reading all I can about c++11/c++14 and beyond when time permits. I like auto, I really do, I believe in it. I have a small problem I’m trying to decide what to do about. So in old legacy code we have things like this:
for (int i = 0; i < someObject.size(); i++) { … }
By Adrien Hamelin | Jan 14, 2015 03:26 PM | Tags: intermediate c++11
Sasha Goldshtein begins to show us how to implement the basis of a useful tool from the STL: the tuple.
Implementing std::tuple From The Ground Up – Part 1
by Sasha Goldshtein
From the article:
std::tuple is a very nice facility originally introduced in C++ TR1. It is a heterogenous container of elements that has a statically known size. In C++ 11, std::tuple can be implemented using variadic templates; a single std::tuple class can support an arbitrary number of template type arguments. In this series of blog posts we will implement std::tuple from first principles. The purpose of this exercise is not to provide the best-performing or most-conformant tuple implementation, but rather to see what foundational concepts are required to implement it...
By Blog Staff | Jan 14, 2015 11:37 AM | Tags: None
Toward using a more modern C++ compiler:
Raspberry Pi -- Install GCC 4.9 and compile C++14 programs
by Sol
From the article:
... I will show you next how to install only GCC 4.9 and his dependencies from Jessie and keep Wheezy as the default source for all the other packages. I’ve tested the next steps on a Raspberry Pi revision B+, but it should work on older models too...
By Blog Staff | Jan 14, 2015 10:33 AM | Tags: intermediate
Quick A: Inherit from enable_shared_from_this
.
Recently on SO:
Cast 'this' to std::shared_ptr
I have a method on a class to make a particular instance an "active" instance:
void makeActive() { activeInstance = this; }However it doesn't work since
activeInstance
has typestd::shared_ptr< ClassName >
. How can I cast this tostd::shared_ptr<ClassName>
?
By Blog Staff | Jan 14, 2015 10:24 AM | Tags: None
Slides are now available from last month's Belgian C++ user group meeting:
Slides of the 17th of December 2014 BeCPP Meeting
by Marc Gregoire
There were two talks -- kudos for the pun in the second talk title:
By Blog Staff | Jan 12, 2015 05:02 PM | Tags: None
Note that the questions raised are good ones even if we would normally use &
parameters for the non-null case.
Today on Andrzej's blog:
Defensive programming
by Andrzej Krzemieński
From the article:
Have you ever asked yourself, or participated in a discussion on whether “defensive programming”is a good or a bad thing? The issue is controversial, and recently, while watching talk “Defensive Programming Done Right, Part I” by John Lakos, I realized (I think) why. Term “undefined behavior” means different things to different people...
By Jeremy Wright | Jan 12, 2015 10:06 AM | Tags: variant python intermediate boost
A useful application of boost::variant with boost::python by Mario Lang.
boost::python and boost::variant
by Mario Lang
From the post:
However, there is one aspect of C++ data types that I couldn't figure out how to interface with Python, which are C++ discriminated unions, or more specifically, heterogeneous containers. While Python has no problems with containers containing objects of different types, C++ does not make this very easy by default.
By Mantosh Kumar | Jan 11, 2015 08:36 AM | Tags: None
This is a catalog of reusable pieces of C++ knowledge, similar to the book on design patterns by GoF.
[An interesting experiment... Note that some material is dated, but it's a wiki. -- Ed.]
More C++ Idioms
C++ has indeed become too "expert friendly" -- Bjarne Stroustrup, The Problem with Programming, Technology Review, Nov 2006.
Stroustrup's saying is true because experts are intimately familiar with the idioms in the language. With the increase in the idioms a programmer understands, the language becomes friendlier to him or her. The objective of this open content book is to present modern C++ idioms to programmers who have moderate level of familiarity with C++, and help elevate their knowledge so that C++ feels much friendlier to them. It is designed to be an exhaustive catalog of reusable idioms that expert C++ programmers often use while programming or designing using C++. This is an effort to capture their techniques and vocabulary into a single work. This book describes the idioms in a regular format: Name-Intent-Motivation-Solution-References, which is succinct and helps speed learning. By their nature, idioms tend to have appeared in the C++ community and in published work many times. An effort has been made to refer to the original source(s) where possible; if you find a reference incomplete or incorrect, please feel free to suggest or make improvements.
The world is invited to catalog reusable pieces of C++ knowledge (similar to the book on design patterns by GoF). The goal here is to first build an exhaustive catalog of modern C++ idioms and later evolve it into an idiom language, just like a pattern language. Finally, the contents of this book can be redistributed under the terms of the GNU Free Documentation License.Aimed toward: Anyone with an intermediate level of knowledge in C++ and supported language paradigms
By simon ferquel | Jan 8, 2015 04:29 PM | Tags: intermediate experimental
[This article is interesting not only because it's about work being proposed for consideration in the Concurrency TS, but also because it's interesting that we seem to be seeing a trend of articles being published on GitHub instead of on a blog... --Ed.]
Await, coroutines, what could that bring for game development
This article shows how we can use
await
in way not related to threading, tasks, or asynchronous I/O, but in the context of a game, to write game logic-related code spanning accross many frames in a sequencial way, without introducing any threads with little to no performance penalty.