Friday, June 8, 2007

编译器如何区分含有const关键字的重载?

template < typename T, int n >
class Array
{
public:
T & operator [] (int i) { return a_[i];}
const T & operator [] (int i) const { return a_[i];}
private:
T a_[n];
};

No comments: