#include <iostream>
#include <functional>
struct execute {
const unsigned long long n;
template<typename F, class Check = decltype((*(F*)nullptr)())>
void operator() (F what, ...) {
for (auto i = 0; i < n; i++)
what();
}
template<typename F, class Check = decltype((*(F*)nullptr)(0))>
void operator() (F 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([](unsigned long long i) {
std::cout << "counting: " << i << std::endl;
});
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8ZnVuY3Rpb25hbD4KCnN0cnVjdCBleGVjdXRlIHsKICAgIGNvbnN0IHVuc2lnbmVkIGxvbmcgbG9uZyBuOwoKCXRlbXBsYXRlPHR5cGVuYW1lIEYsIGNsYXNzIENoZWNrID0gZGVjbHR5cGUoKCooRiopbnVsbHB0cikoKSk+CiAgICB2b2lkIG9wZXJhdG9yKCkgKEYgd2hhdCwgLi4uKSB7CiAgICAgICAgZm9yIChhdXRvIGkgPSAwOyBpIDwgbjsgaSsrKQogICAgICAgICAgICB3aGF0KCk7CiAgICB9CgoJdGVtcGxhdGU8dHlwZW5hbWUgRiwgY2xhc3MgQ2hlY2sgPSBkZWNsdHlwZSgoKihGKiludWxscHRyKSgwKSk+CiAgICB2b2lkIG9wZXJhdG9yKCkgKEYgd2hhdCkgewogICAgICAgIGZvciAoYXV0byBpID0gMDsgaSA8IG47IGkrKykKICAgICAgICAgICAgd2hhdChpKTsKICAgIH0KfTsKCmV4ZWN1dGUgb3BlcmF0b3IiIiBfdGltZXModW5zaWduZWQgbG9uZyBsb25nIG4pIHsKICAgIHJldHVybiBleGVjdXRle259Owp9CgppbnQgbWFpbigpIHsKICAgIDNfdGltZXMoW117CiAgICAgICAgc3RkOjpjb3V0IDw8ICJibGEiIDw8IHN0ZDo6ZW5kbDsKICAgIH0pOwoKICAgIGF1dG8gdHdpY2UgPSAyX3RpbWVzOwoKICAgIHR3aWNlKFtdewogICAgICAgIHN0ZDo6Y291dCA8PCAiYmx1cCIgPDwgc3RkOjplbmRsOwogICAgfSk7CgogICAgM190aW1lcyhbXSh1bnNpZ25lZCBsb25nIGxvbmcgaSkgewogICAgICAgIHN0ZDo6Y291dCA8PCAiY291bnRpbmc6ICIgPDwgaSA8PCBzdGQ6OmVuZGw7CiAgICB9KTsKfQo=