#include <iostream>
#include <vector>
#include <algorithm>
struct B
{
int blah;
void Blah()
{
std::cout << blah << std::endl;
}
};
struct A
{
B *bp;
A(B *youmakethewayalittlebetter) : bp(youmakethewayalittlebetter)
{
}
void Meh()
{
bp->Blah();
}
};
int main()
{
B b {7};
std::vector<A> av (10, &b);
std::for_each(av.begin(), av.end(), [](A &a)
{
a.Meh();
});
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8YWxnb3JpdGhtPgoKc3RydWN0IEIKewogICAgaW50IGJsYWg7CiAgICB2b2lkIEJsYWgoKQogICAgewogICAgICAgIHN0ZDo6Y291dCA8PCBibGFoIDw8IHN0ZDo6ZW5kbDsKICAgIH0KfTsKCnN0cnVjdCBBCnsKICAgIEIgKmJwOwogICAgQShCICp5b3VtYWtldGhld2F5YWxpdHRsZWJldHRlcikgOiBicCh5b3VtYWtldGhld2F5YWxpdHRsZWJldHRlcikKICAgIHsKICAgIH0KICAgIHZvaWQgTWVoKCkKICAgIHsKICAgICAgICBicC0+QmxhaCgpOwogICAgfQp9OwoKaW50IG1haW4oKQp7CiAgICBCIGIgezd9OwogICAgc3RkOjp2ZWN0b3I8QT4gYXYgKDEwLCAmYik7CiAgICBzdGQ6OmZvcl9lYWNoKGF2LmJlZ2luKCksIGF2LmVuZCgpLCBbXShBICZhKQogICAgewogICAgICAgIGEuTWVoKCk7CiAgICB9KTsKfQo=