template <size_t N> struct sieve {
vector<vector<int>> divs;
sieve() {
divs.resize(N + 1);
for (int i = 1; i <= N; i++) {
for (int j = i; j <= N; j += i)
divs[j].emplace_back(i);
}
}
vector<int>& operator[](int i) {
return divs[i];
}
};
is there any ways to make this sieve a constexpr-able type ?
because of vector resize thing it doesnt work that way , is there any alternative ways to store divisors and get it get calculated during compile time ?