#include <algorithm>
#include <iostream>
class sig
{
public:
sig()
{
struct Functor
{
Functor() : value(0) {};
int operator ()() { return value++; };
int value;
};
std::generate(p_list, p_list + 4, Functor());
}
int p_list[4];
};
int main(int argc, char **argv)
{
sig a;
for (int i = 0; i < 4; ++i)
{
std::cout << a.p_list[i] << ' ';
}
return 0;
}
I2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPGlvc3RyZWFtPgoKY2xhc3Mgc2lnCnsKcHVibGljOgogICAgc2lnKCkKICAgIHsKICAgICAgICBzdHJ1Y3QgRnVuY3RvcgogICAgICAgIHsKICAgICAgICAgICAgRnVuY3RvcigpIDogdmFsdWUoMCkge307CiAgICAgICAgICAgIGludCBvcGVyYXRvciAoKSgpIHsgcmV0dXJuIHZhbHVlKys7IH07CiAgICAgICAgICAgIGludCB2YWx1ZTsKICAgICAgICB9OwogICAgICAgIHN0ZDo6Z2VuZXJhdGUocF9saXN0LCBwX2xpc3QgKyA0LCBGdW5jdG9yKCkpOwogICAgfQoKICAgIGludCBwX2xpc3RbNF07Cn07CgppbnQgbWFpbihpbnQgYXJnYywgY2hhciAqKmFyZ3YpCnsKCXNpZyBhOwoKCWZvciAoaW50IGkgPSAwOyBpIDwgNDsgKytpKQoJewoJCXN0ZDo6Y291dCA8PCBhLnBfbGlzdFtpXSA8PCAnICc7Cgl9CgoJcmV0dXJuIDA7Cn0=