Template Partial Specialization with a Template?
Here is my problem. I am using one of the implementations of TR1 that
has a hash_map template.
for all the simple types hash_map<Key,Data> works because
If you want to write your own key type, you can:
I have a template class thus:
that will implicitly specialize any specialization of the generic TKey template.
The inner code should be very simple:
kind of template mechanism that allows me to specify that this should be
a generic template that can be specialized against a particular specialization
of a TKey.
Re: Template Partial Specialization with a Template?
My office mate and I found the answer last night...
so, given my key type:
that it is legal to nest template definitions and partial specializations.
That is what we are doing here; the outer 'template<>' is an indicator that
we want to do a partial specialization of our 'struct hash'. The inner
template<...> is a standard template definition, and the nesting of the two
allows us to specify a templated definition of the partial specialization,
|All times are GMT +5.5. The time now is 16:28.|