Is it possible to have a default templated value before a templated parameter pack.
I.e:
#include <tuple>
template<int n = 0, typename... Pack>
struct bad {
static constexpr int k_n = n;
using pack_t = std::tuple<Pack...>;
};
using success = bad<0, int, int>;
using fail = bad<int, int>; // Is there a way to achieve this?
Fails with:
error: template argument for non-type template parameter must be an expression
using fail = bad<int, int>;
Although it is documented that parameter packs may follow default templated parameters
Is there a way to get the equivelent behavior of:
using works = bad<int, int>;
static_assert(works::k_n == 0);
static_assert(std::is_same<works::pack_t, std::tuple<int, int>>::value);
?