2015-09-03 6 views

ответ

6

Нет, это не так. Специальности, перечисленные в [function.objects] являются:

// Hash function specializations 
template <> struct hash<bool>; 
template <> struct hash<char>; 
template <> struct hash<signed char>; 
template <> struct hash<unsigned char>; 
template <> struct hash<char16_t>; 
template <> struct hash<char32_t>; 
template <> struct hash<wchar_t>; 
template <> struct hash<short>; 
template <> struct hash<unsigned short>; 
template <> struct hash<int>; 
template <> struct hash<unsigned int>; 
template <> struct hash<long>; 
template <> struct hash<long long>; 
template <> struct hash<unsigned long>; 
template <> struct hash<unsigned long long>; 

template <> struct hash<float>; 
template <> struct hash<double>; 
template <> struct hash<long double>; 

template<class T> struct hash<T*>; 

Кроме того, что бы такая вещь вообще значит?

+0

И, кстати, это будет UB, чтобы специализировать его (как пользователь) для 'T &'. – Jarod42