2015-09-03 22 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

相關問題