#include <iostream>
template <class T>
class Maybe {
bool is_ = false;
T value_;
public:
constexpr Maybe() = default;
constexpr Maybe(T value) : is_(true), value_(value) {}
constexpr bool is() const { return is_; }
};
Maybe<int> not_set_;
Maybe<int> is_set_(2);
template <const Maybe<int>& parm>
struct Test {
void say() const {
std::cout << "parm is " << (parm.is() ? "set" : "not set") << ".\n";
}
};
int main() {
Test<not_set_> not_set;
Test<is_set_> is_set;
not_set.say();
is_set.say();
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdGVtcGxhdGUgPGNsYXNzIFQ+CmNsYXNzIE1heWJlIHsKICAgIGJvb2wgaXNfID0gZmFsc2U7CiAgICBUIHZhbHVlXzsKCiAgcHVibGljOgogICAgY29uc3RleHByIE1heWJlKCkgPSBkZWZhdWx0OwogICAgY29uc3RleHByIE1heWJlKFQgdmFsdWUpIDogaXNfKHRydWUpLCB2YWx1ZV8odmFsdWUpIHt9CgogICAgY29uc3RleHByIGJvb2wgaXMoKSBjb25zdCB7IHJldHVybiBpc187IH0KfTsKCk1heWJlPGludD4gbm90X3NldF87Ck1heWJlPGludD4gaXNfc2V0XygyKTsKCnRlbXBsYXRlIDxjb25zdCBNYXliZTxpbnQ+JiBwYXJtPgpzdHJ1Y3QgVGVzdCB7CiAgICB2b2lkIHNheSgpIGNvbnN0IHsKICAgICAgICBzdGQ6OmNvdXQgPDwgInBhcm0gaXMgIiA8PCAocGFybS5pcygpID8gInNldCIgOiAibm90IHNldCIpIDw8ICIuXG4iOwogICAgfQp9OwoKaW50IG1haW4oKSB7CiAgICBUZXN0PG5vdF9zZXRfPiBub3Rfc2V0OwogICAgVGVzdDxpc19zZXRfPiBpc19zZXQ7CgogICAgbm90X3NldC5zYXkoKTsKICAgIGlzX3NldC5zYXkoKTsKfQo=