Service Delivery Manager and Scrum Master at Sii Poland company.

Since 2007 C++ enthusiast. C++11/14 evangelist - learn modern ways of developing in C++. Teaching TDD and agile way of coding.

  • googleplus
  • linkedin
  • twitter

This is continuation of posts:  http://cppcodereviewers.com/bitwise-operations-part-2-first-trivial-approach/  http://cppcodereviewers.com/bitwise-operations/ Challenge: Decode raw bytes Decode data from raw bytes to some data structure which is easy to use and is resource friendly. You get  n  bytes of data in which in each byte there is  0bFDDDFDDD  where  F  is some flag and  DDD  represents data. Lets assume you get pointer to data… Read More


This is continuation of post: http://cppcodereviewers.com/bitwise-operations/ Continuation of this topic is here: http://cppcodereviewers.com/bitwise-operations-part-3-save-resources/ Challenge: Decode raw bytes Decode data from raw bytes to some data structure which is easy to use and is resource friendly. You get  n  bytes of data in which in each byte there is  0bFDDDFDDD  where  F  is some flag and  DDD  represents data. Lets assume you… Read More


Continuation of this topic is here:  http://cppcodereviewers.com/bitwise-operations-part-2-first-trivial-approach/ http://cppcodereviewers.com/bitwise-operations-part-3-save-resources/ I decided to create some new category – C++ Challenge. I would like to put here some problems which I would like to have solved the best way possible. If possible put solution in comments – remember to put your code in <pre></pre>.   Do not hesitate… Read More


Edit: Thanks to comments of Mateusz and A I have corrected code in this post (copy & paste error) Covariant Return Types is language feature which allows you to change return type of your virtual function to covariant type ie. pointer to derived class instead of pointer to base class – see example below:

Read More


Problem There are situations where we need to change or refactor some part of code where dependencies are impossible to replace in runtime for testing (ie. using dependency injection technique). Sometimes we have only header files of such entities with libraries available but only for different platform then we are working on. Such situation happens… Read More


Problem In one of previous posts (Readable for_each loop for maps) I have written such code which iterates over range of pairs and “explode” them into the lambda arguments list:

This code is good but it is limited only to containers with pairs (types with defined first and second  attributes). What we would like to have… Read More


Junior task – sum of integers in vector Assume that we have vector of integers ie.

and we want to write function which will sum up all its elements.

In which cases it will work?

Middle task – sum of elements in vector no matter what type Let’s make it more generic… Read More


Problem I have been talking with my colleague about traversing std::map and we both agree that using first-second attributes as a key-value pair is not the most readable solution.

It is not so bad but we would like to write something like this:

Solution I found a way of writing code similar to… Read More