Monatsarchiv: Juli 2018

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