Immutability — Raw vs Smart Pointers

A note on immutability of raw and smart pointers in C++

June 7, 2022 · 3 min · Navin Mohan

Playing around with OpenMP and C++ - Parallelizing for-loops

Yesterday, I came across an interesting repository on my GitHub feed. It is a simple and functional header-only C++ library that lets you apply transformations like map, reduce and filter to standard C++ containers. Well, yes I’m aware of the fact that it is possible to perform all three transformations using just STL. Map - std::transform Filter - std::copy_if Reduce - std::accumulate This stackoverflow answer explains them in detail. But that is not why I was interested....

April 19, 2019 · 6 min · Navin Mohan

Dealing with endianness in C++

If you have ever dealt with binary data, then the chances are that you must have come across the term endianness at least once. Let’s take a deeper dive and see how you can keep your bytes in order. If you’re here for the code, then skip ahead to methods. What is endianness? Endianness is basically the sequential order in which bytes are organized in a word. Generally, the computer memory is byte addressable therefore it doesn’t care how the constituent bytes are organized....

December 31, 2018 · 7 min · Navin Mohan