We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
g++ 4.2.1
../Utility.h:31:19: error: declaration of 'T1' shadows template parameter template <class T1, class T2>
template<class T1, class T2> struct pair{ public: typedef T1 first_type; typedef T2 second_type; public: T1 first; T2 second; public: pair(){} template<class U, class V> pair(const pair<U, V>& pr); pair(const first_type& a, const second_type& b); pair& operator= (const pair& pr); void swap(pair& pr); public: template <class T1, class T2> friend bool operator== (const pair<T1, T2>& lhs, const pair<T1, T2>& rhs); template <class T1, class T2> friend bool operator!= (const pair<T1, T2>& lhs, const pair<T1, T2>& rhs); template <class T1, class T2> friend bool operator< (const pair<T1, T2>& lhs, const pair<T1, T2>& rhs); template <class T1, class T2> friend bool operator<= (const pair<T1, T2>& lhs, const pair<T1, T2>& rhs); template <class T1, class T2> friend bool operator> (const pair<T1, T2>& lhs, const pair<T1, T2>& rhs); template <class T1, class T2> friend bool operator>= (const pair<T1, T2>& lhs, const pair<T1, T2>& rhs); template <class T1, class T2> friend void swap(pair<T1, T2>& x, pair<T1, T2>& y); };
应该是友元函数的模版形参使用T1、T2会屏蔽外层的T1、T2? Accessing template parameters of the member templates
The text was updated successfully, but these errors were encountered:
恩,改完就能通过了
public: template <class U, class V> friend bool operator== (const pair<U, V>& lhs, const pair<U, V>& rhs); template <class U, class V> friend bool operator!= (const pair<U, V>& lhs, const pair<U, V>& rhs); template <class U, class V> friend bool operator< (const pair<U, V>& lhs, const pair<U, V>& rhs); template <class U, class V> friend bool operator<= (const pair<U, V>& lhs, const pair<U, V>& rhs); template <class U, class V> friend bool operator> (const pair<U, V>& lhs, const pair<U, V>& rhs); template <class U, class V> friend bool operator>= (const pair<U, V>& lhs, const pair<U, V>& rhs); template <class U, class V> friend void swap(pair<U, V>& x, pair<U, V>& y); };
Sorry, something went wrong.
No branches or pull requests
g++ 4.2.1
应该是友元函数的模版形参使用T1、T2会屏蔽外层的T1、T2?
Accessing template parameters of the member templates
The text was updated successfully, but these errors were encountered: