M
m0shbear
I'm using 'typename...' to preserve "extra" template arguments which
have a default value so that I can do class partial specialization for
identity purposes:
namespace std { template <class T, typename... _> class vector; }
namespace stxxl { template <class T, typename... _> class vector; }
template <typename vc>
struct ident {
static bool has_bulk_iterator();
};
template <typename... _> struct ident<stxxl::vector<char, _> > {
static bool has_bulk_iterator() {
return false;
}
};
template <typename... _> struct ident<std::vector<char, _> > {
static bool has_bulk_iterator() {
return true;
}
};
However, typename... doesn't greedily gobble up _Alloc (for std) and
[5 template args] (for stxxl), and <T,...> is incompatible with <T,
_Alloc = ...<T>>.
Is there a solution that allows implementation of match-and-ignore
template spec'n as opposed to match-and-assume?
have a default value so that I can do class partial specialization for
identity purposes:
namespace std { template <class T, typename... _> class vector; }
namespace stxxl { template <class T, typename... _> class vector; }
template <typename vc>
struct ident {
static bool has_bulk_iterator();
};
template <typename... _> struct ident<stxxl::vector<char, _> > {
static bool has_bulk_iterator() {
return false;
}
};
template <typename... _> struct ident<std::vector<char, _> > {
static bool has_bulk_iterator() {
return true;
}
};
However, typename... doesn't greedily gobble up _Alloc (for std) and
[5 template args] (for stxxl), and <T,...> is incompatible with <T,
_Alloc = ...<T>>.
Is there a solution that allows implementation of match-and-ignore
template spec'n as opposed to match-and-assume?