#include <iostream>
#include <functional>
struct execute {
const unsigned long long n;
void operator() (std::function<void()> what) {
for (auto i = 0; i < n; i++)
what();
}
void operator() (std::function<void(unsigned long long)> what) {
for (auto i = 0; i < n; i++)
what(i);
}
};
execute operator"" _times(unsigned long long n) {
return execute{n};
}
int main() {
3_times([]{
std::cout << "bla" << std::endl;
});
auto twice = 2_times;
twice([]{
std::cout << "blup" << std::endl;
});
3_times([](auto i) {
std::cout << "counting: " << i << std::endl;
});
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8ZnVuY3Rpb25hbD4KCnN0cnVjdCBleGVjdXRlIHsKICAgIGNvbnN0IHVuc2lnbmVkIGxvbmcgbG9uZyBuOwoKICAgIHZvaWQgb3BlcmF0b3IoKSAoc3RkOjpmdW5jdGlvbjx2b2lkKCk+IHdoYXQpIHsKICAgICAgICBmb3IgKGF1dG8gaSA9IDA7IGkgPCBuOyBpKyspCiAgICAgICAgICAgIHdoYXQoKTsKICAgIH0KCiAgICB2b2lkIG9wZXJhdG9yKCkgKHN0ZDo6ZnVuY3Rpb248dm9pZCh1bnNpZ25lZCBsb25nIGxvbmcpPiB3aGF0KSB7CiAgICAgICAgZm9yIChhdXRvIGkgPSAwOyBpIDwgbjsgaSsrKQogICAgICAgICAgICB3aGF0KGkpOwogICAgfQp9OwoKZXhlY3V0ZSBvcGVyYXRvciIiIF90aW1lcyh1bnNpZ25lZCBsb25nIGxvbmcgbikgewogICAgcmV0dXJuIGV4ZWN1dGV7bn07Cn0KCmludCBtYWluKCkgewogICAgM190aW1lcyhbXXsKICAgICAgICBzdGQ6OmNvdXQgPDwgImJsYSIgPDwgc3RkOjplbmRsOwogICAgfSk7CgogICAgYXV0byB0d2ljZSA9IDJfdGltZXM7CgogICAgdHdpY2UoW117CiAgICAgICAgc3RkOjpjb3V0IDw8ICJibHVwIiA8PCBzdGQ6OmVuZGw7CiAgICB9KTsKCiAgICAzX3RpbWVzKFtdKGF1dG8gaSkgewogICAgICAgIHN0ZDo6Y291dCA8PCAiY291bnRpbmc6ICIgPDwgaSA8PCBzdGQ6OmVuZGw7CiAgICB9KTsKfQo=