Converting to Zola

Zola I haven't had (or taken really) the time to write anything technical in the last few years. The pandemic definitely did have an impact on me, but also work. I was not in a frame of mind to program at home, much less write about it. But lately, I've felt better and I am getting back into that hobby of mine. In the interim, the static site generator that I was using (Hugo) upgraded quite a few

Continue Reading »

One of std::string ctor

std::string from C style string ctor In writing a function template having to create a std::string from a char[], I have had to use the following constructor of std::string: basic_string( CharT const* s, size_type count, Allocator const& alloc = Allocator() ); which you can find documentation for in the standard or on cppreference.com. In using this constructor, I have had a "off by one" problem with the count parameter. The function template I originally wrote used the constructor

Continue Reading »

Invoking a callable in C++

Invoking a callable in C++ This is my exploration of the std::invoke utility of C++17. I started with something vaguely related (which I am discussing here) and ended up reading the standard library implementation of std::invoke (and that of Google's Abseil library). The funny thing is that in the end, I decided I did not really need any of it for my original motivation, but I did gain some knowledge along the way, so worth the

Continue Reading »

Python's range in C++

Exploring loops: Python's range in C++ In spite of what Sean Parent would like (i.e. no raw loops ;-) ), loops are a common control flow in programming. So common that most languages have more than one loop syntax: for loop, while loop, do while loop... Given their prevalence, loops might seem uninteresting, but when I decided to look into creating a range function1 for C++ which would behave like Python's range object, I learned a thing or two and decided

Continue Reading »

Mixed types arithmetic in C++

Arithmetic on mixed fundamental types in C++ For a weekend project of mine, I have had to think about mixed type arithmetic on fundamental types in C++. In the process, I made sense of a few fundamental things (no pun intended ;-) ) and I have decided to write them down. Hopefully, writing about it will allow me to both clarify my thoughts and remember the information! Arithmetic conversions Applying binary operators to different types might seem trivial in

Continue Reading »