This is the third post in my exploration of the package managers for C++ in Linux and Windows environments. This time I tested out the Hunter package manager with the same toy C++ program with h...
http://cpptruths.blogspot.com/2019/05/bootstrapping-cmake-project-based-on.html
This blog is part #2 in the series of trying out different package managers to bootstrap a cmake project. Checkout part #1 about Bootstrapping a vcpkg-based cmake project in Visual Studio . Part...
http://cpptruths.blogspot.com/2019/03/bootstrapping-vcpkg-based-cmake-project_31.html
After the last week's 2019 Microsoft MVP Summit , I decided to give Microsoft vcpkg a shot. I've a cmake project at work and we target Linux using the Hunter package manager . So vcpkg had been...
http://cpptruths.blogspot.com/2019/03/bootstrapping-vcpkg-based-cmake-project.html
Last year I reviewed the pre-print manuscript of Manning's Functional Programming in C++ written by Ivan Čukić. I really enjoyed reading the book. I enthusiastically support that the boo...
http://cpptruths.blogspot.com/2019/02/review-of-mannings-functional.html
Unit testing your template code comes up from time to time. (You test your templates, right?) Some templates are easy to test. No others. Sometimes it's not clear how to about injecting mock cod...
http://cpptruths.blogspot.com/2019/02/unit-testing-c-templates-and-mock.html
Currying is the technique of transforming a function that takes multiple arguments in such a way that it can be called as a chain of functions, each with a single argument. I've discussed Curryi...
http://cpptruths.blogspot.com/2018/12/simple-template-currying.html
C++ standard library has std::type_info and std::type_index to get run-time type information about a type. There are some efficiency and robustness issues in using them (especially when dynamica...
http://cpptruths.blogspot.com/2018/11/non-colliding-efficient.html
I discovered a reference lifetime extension gotcha. TL;DR; Chained functions (that return a reference to *this) do not trigger C++ reference lifetime extension. Four ways out: First, don't rel...
http://cpptruths.blogspot.com/2018/10/chained-functions-break-reference.html
The objective is to allow the following to be valid C++.
#include
http://cpptruths.blogspot.com/2018/09/convenient-deduction-guides-for.html
C++17 added std::variant and std::visit in its repertoire. They are worth a close examination. I've been wondering about whether they are always better than inheritance for modeling sum-types (...
http://cpptruths.blogspot.com/2018/02/inheritance-vs-stdvariant-based.html
There are plenty of reasons why functional APIs look and feel different than more common object-oriented APIs. A tell-tale sign of a functional APIs is existence of A CORE ABSTRACTION and a set ...
http://cpptruths.blogspot.com/2017/12/ground-up-functional-api-design-in-c.html
My previous talk on New Tools for a More Functional C++ ran into some audio issue during the meetup . I did not upload the video back then because it had no audio what-so-ever. I finally got ar...
http://cpptruths.blogspot.com/2017/12/the-video-of-new-tools-for-more.html
I presented the following slide deck at the ACCU meetup yesterday. NEW TOOLS FOR A MORE FUNCTIONAL C++ from SUMANT TAMBE Abstract: Variants have been around in C++ for a long time and C++...
http://cpptruths.blogspot.com/2017/09/new-tools-for-more-functional-c.html
I realized that std::function can be bound to member functions without requiring the *this object. Consider the following examples. // std::string::empty is a const function. All variab...
http://cpptruths.blogspot.com/2017/08/binding-stdfunction-to-member-functions.html
std::accumulate makes a ton of copies internally. In fact it's 2x the size of the number of elements in the iterator range. To fix, use std::ref and std::reference_wrapper for the initial state....
http://cpptruths.blogspot.com/2017/08/avoiding-intermediate-copies-in.html
While looking for some old photos, I stumbled upon my own presentation on C++ coroutines, which I never posted online to a broader audience. I presented this material in SF Bay ACCU meetup and ...
http://cpptruths.blogspot.com/2017/07/playing-with-c-coroutines.html
In the previous two blog posts (Understanding Fold Expressions and Folding Functions ) we looked at the basic usage of C++17 fold expressions and how simple functions can be folded to create a ...
http://cpptruths.blogspot.com/2017/01/folding-monadic-functions.html
In the last post we looked at basic usage of C++17 Fold Expressions. I found that many posts on this topic discuss simple types and ignore how folds may be applicable to more complex types as we...
http://cpptruths.blogspot.com/2016/12/folding-functions.html
C++17 has an interesting new feature called fold expressions . Fold expressions offer a compact syntax to apply a binary operation to the elements of a parameter pack. Here’s an example. tem...
http://cpptruths.blogspot.com/2016/12/understanding-fold-expressions.html
Just a few days ago I came across an intriguing blog-post about type-safe printf using dependent typing. The blog-post has since become inaccessible and therefore, I've copied an excerpt here....
http://cpptruths.blogspot.com/2016/11/dependently-typed-curried-printf.html
Covariance and Contravariance are concepts that come up often as you go deeper into generic programming. While designing a language that supports parametric polymorphism (e.g., templates in C++...
http://cpptruths.blogspot.com/2015/11/covariance-and-contravariance-in-c.html
In last couple of months I did a couple of presentations about my recent projects in C++. Session videos, slides, and code for all the presentations are now available online. Both projects have ...
http://cpptruths.blogspot.com/2015/11/cppcon15-and-silicon-valley-code-camp.html
This is part 4 in the series of FUN WITH LAMBDAS: C++14 STYLE. The previous posts are part 3 , part 2 , and part 1 . C++14 has a number of features that support functional-style design. By "f...
http://cpptruths.blogspot.com/2015/06/fun-with-lambdas-c14-style-part-4.html
Believe it or not, but the 9th Silicon Valley Code Camp is less than 2 weeks away and I can't wait to be at the largest software technology conference setup by developers for developers---and h...
http://cpptruths.blogspot.com/2014/09/fun-with-c14-lambdas-at-silicon-valley.html
This blog post is just a quick note that C++ offers (at least) two distinct ways to represent lazy computation that is lexically in the same scope but may execute lazily at a later time. In doin...
http://cpptruths.blogspot.com/2014/09/short-circuiting-overloaded-and-using.html