Archiv des Autors: oliverfunke

The Visitor Pattern – part 1: basics and introduction

The Visitor Pattern is one of the base implementation patterns in software development. It can solve a base use case which occurs in nearly all applications which use inheritance to implement a system of base classes and derived classes. But … Weiterlesen

Veröffentlicht unter C++ | Kommentar hinterlassen

Lambda Closures in C++

A closure is a concept of functional programming languages. C++ is a multi-paradigm language which offers features of different programming paradigms. But C++ isn’t a real functional language. There are huge differences between a pure functional language and C++. Most … Weiterlesen

Veröffentlicht unter C++ | Kommentar hinterlassen

lambdas and scope variables

A lambda expression can access local variables of the scope in which it is used. You can pass these variables by value or by reference to the lambda function. The following example shows how to sort a vector of signed … Weiterlesen

Veröffentlicht unter C++ | 1 Kommentar

functor vs. named lambda vs. anonymous lambda

A lambda expression is a mechanism for specifying a function. The primary use for a lambda is to specify a simple action. A lambda expression can be implemented directly as anonymous function, for example within an algorithm method, or it … Weiterlesen

Veröffentlicht unter C++ | 1 Kommentar

std::vector vs c-style array

Within this article I want to compare the base array type and the vector offered by the std library. I want to call these two types “c-style array” and “std::vector”. The comparison will show you the pros and cons of … Weiterlesen

Veröffentlicht unter C++ | Kommentar hinterlassen

std::array vs c-style array

Within this article I want to compare the base array type and the array offered by the std library. I want to call these two types “c-style array” and “std::array”. The comparison will show you the pros and cons of … Weiterlesen

Veröffentlicht unter C++ | 1 Kommentar

STL Algorithms

The STL algorithms offer a powerful way to solve some base programming use cases. If you know and use these algorithms you can write more clean, efficient and robust code. But unfortunately, it isn’t that easy to know or find … Weiterlesen

Veröffentlicht unter C++ | Kommentar hinterlassen