Functional programming in C++

Functional programming becomes more prominent even in C++ these days, but sometimes the resulting code can feel awkward — especially with all the iterators one has to provide for the STL algorithms. FunctionalPlus (a small header-only library) can help overcome this issue and make your code concise and readable again.

This article is targeted towards C++ programmers new to FunctionalPlus and with little experience in functional programming. It will show how the HackerRank challenge “Gemstones” can be solved elegantly with the FunctionalPlus approach. Continue reading