Deduction guide with non-type template parameter

70 Views Asked by At

In this simplified example, how can I achieve this kind of deduction guide ?

template<bool even>
struct Num {
    const int i;
};

template<int i>
Num(int) -> Num<i%2>; // Num(2) -> Num<true> ;; Num(3) -> Num<false>

int main() {
    const Num a{3};
}
0

There are 0 best solutions below