In the previous post, we started a series dedicated to familiarise C++ developers to the world of LISP meta-programming, based on the Clojure programming language. The goal is to offer a different perspective on meta-programming, how we can approach it, and the kind of use cases it can address. We started the series by an... Continue Reading →
LISP Meta-Programming for C++ Developers: Introduction
The standardization of C++ 11, 14 and 17 each brought some features to help developers doing meta-programming in C++. With these, meta-programming in C++ has come from a technical curiosity to becoming part of the language, and a growing subject of research. C++ is not the first language to invest in meta-programming. LISP dialects have... Continue Reading →
Weighted choice implementation
In the previous post, we developed the tiny_rand library as an extension of the STL random header. The goal was to build a minimal set of functions such that it would allow to randomly generate any kind of data: containers, classes, tuples, variants, and any combination of those. The tiny_rand library is built around concepts... Continue Reading →
Building on the STL random header
In today's post, we will discuss the design and implementation of a small headers only library, whose aim is to complete the STL random header with combinators to generate arbitrary random data. Throughout this post, we will first describe the motivations behind this library, and the its high level goals. These goals will imply design... Continue Reading →
Lost in permutation test complexity
In our lost in permutation complexity post, we talked about the std::is_permutation algorithm and its algorithmic complexity issue. We went over several use cases that seems like perfect matches for std::is_permutation. But because of its quadratic complexity, we made the argument that std::is_permutation is almost impractical: its costs is not worth the trade-off of manually... Continue Reading →
Still lost in permutation complexity
In our last post, we talked about the std::is_permutation algorithm and its algorithm complexity issue. We went over several use cases that seems like perfect matches for std::is_permutation. But because of its quadratic complexity, we made the argument that std::is_permutation is almost impractical: its costs is not worth the trade-off of manually coding the alternative.... Continue Reading →