This is part of my weekly C++ posts based on the daily C++ tips I make at my work. I strongly recommend this practice. If you dont have it in your company start it.
1. The first rule about performance
class Base
{
public:
Base(int x, int y) : x_(x), y_(y) {}
public:
int x_;
int y_;
};
class Derived : public Base
{
using Base::Base;
};
class Boo {
public:
auto getValueMultiplier() {
return [=](int multiplier) {
return value * multiplier;
};
}
private:
int value = 5;
};