by KayEss · 7y ago · 0 comments
class odd {...};
class even {...};
std::variant<odd, even> p(int a) {
if (a&1) return odd{a};
else return even{a};
}
Now which of `even` or `odd` you get is based on the value of `a`.No comments yet.