Archiv der Kategorie: C++

The Visitor Pattern – part 3: dispatcher visitor

This article is one part of a series about the Visitor pattern. Please read the previous articles to get an overview about the pattern and to get the needed basics to understand this article. The example implementation of this article … Weiterlesen

Veröffentlicht unter C++ | Kommentar hinterlassen

The Visitor Pattern – part 2: enumerator visitor

This article is one part of a series about the Visitor pattern. Please read the previous articles to get an overview about the pattern and to get the needed basics to understand this article. The example implementation of this article … Weiterlesen

Veröffentlicht unter C++ | Kommentar hinterlassen

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