C++


CppCon 2017 Talks I enjoyed

I spent a recent holiday listening to several CppCon talks. I’m hooked! I was impressed by the generally high quality of the talks. The lack of “use my/my company’s framework which is so awesome!” talks was refreshing. In addition, the use cases where C++ trumps most competition are often either performance sensitive, or correctness sensitive under strong constraints. Of course, this means contending with the syntactic and semantic complexities C++ throws at you.

Macros for Observers

Here are two little macros too make implementing the Observer design pattern less repetitive. This is C++ File: observermacros.h #ifndef DDM_OBSERVERMACRO_H #define DDM_OBSERVERMACRO_H #define MAKE_OBSERVABLE( obscls ) \ private:\ std::listm_observers;\ public:\ void addObserver( obscls *obs ) {\ m_observers.push_back( obs );\ }\ void delObserver( obscls *obs ) {\ m_observers.remove( obs );\ } #define NOTIFY( obscls, obsmethod, argument ) \ for( std::list::const_iterator it = m_observers.begin();\ it != m_observers.end(); it++ )\

Introducing Ricochet

I've finally finished the game I was working on. World, meet Ricochet. Ricochet is a tile based game in which you use various kinds of mirrors to guide a photon from the launcher and switch on all the switches. After a lot of segfaults and architecture changes due to my intermediate knowledge of C++, it finally seems to be bugfree. The only thing left to do is add a help, add more levels and make a few small changes, after which it will be released.

Books

I got two new books today, Practical C++ Programming and Code Complete 2/e . Both are supposed to be really good, so lets see what knowledge I gain from it