The Ranges library proposal has been accepted for C++20 at the San Diego meeting of the standard committee in November last year. The library provides components for handling ranges of values aimed at simplifying our code. Unfortunately, the Ranges library is not very well documented, which makes it harder to grasp for those that want to learn it. This post is intended as an introduction based on examples of code written with and without Ranges.

Read More C++ code samples before and after Ranges

I have recently come across a website that proposes a series of programming challenges throughout December, until Christmas. It’s called Advent of Code and this is the fourth year it runs this competition. Every day, a new challenge is made available, and each challenge has two parts. You only get the second part after completing the first. It does not matter what programming language you use for solving the challenge, nor how the code looks or how fast it executes. The only thing that matters is the result.

Read More Advent of Code 2018

The C++ community has worked hard in the past decade and more to move the language forward, to enrich but also simplify it, and to adopt new paradigms and coding styles. Yet, a single topic, a simple matter of style is splitting the community, in a pure Swiftian manner: the use of the const qualifier that some prefer it on the left of what it modifies, as it has been the de facto standard for decades, and which is now called West const, or to the right of that it modifies, that is a style that more and more people are adopting, and which is now called East const. I don’t particularly like this terms, I would rather use left const and right const, but if this is what the community prefers to use let’s call them so for consistency.

Read More Join the East Const revolution!

I have been working lately on a C++ library for handling monetary values, currencies, rounding and other related features. It is called moneycpp and it’s a C++ 17 header-only, cross-platform library available on GitHub.

The library is intended for being used in a variety of types of application including ERP systems, banking, finance, insurance, games, and others.

The following is a list of its core requirements:

Read More moneycpp – a C++ library for handling monetary values

Although this feature is available for years in Visual Studio, I only recently discovered this gem that allows rapid generation of C# classes from either JSON or XML.

Here is how it works:

  1. Copy the JSON or XML code to the clipboard.
  2. In Visual Studio, go to Edit > Past Special and chose either Paste JSON as classes or Paste XML as classes.
Read More JSON and XML to C# classes in Visual Studio