My office mate and I found the answer last night...
so, given my key type:
Code:
template<typename T_DataList,typename T_ColumnName,typename T_CDR>
class GenericDataContainerKey
{
.
.
.
size_t hash() { return m_datum << 3 + m_cdr.hash(); } // recursive data structure
};
the desired code snippet was:
Code:
namespace __gnu_cxx
{
template<>
template<typename T_DataList,typename T_ColumnName,typename T_CDR>
struct hash<GenericDataContainerKey<T_DataList,T_ColumnName,T_CDR> >
{
size_t operator() (const GenericDataContainerKey<T_DataList,T_ColumnName,T_CDR> &tk) const { return tk.hash(); }
};
};
This indicates a level of template behaviour that I was heretofore unaware, i.e.
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,
as desired.