MS DEBUGGER中可以显示标准C++类型信息,如vector等,对于自己定义的数组也是很容易实现的,只需要修改VS目录下COMM7\Packages\Debugger中的autoexp.dat 即可。
例如,我的数组:
1 template<typename T,typename SizeType=unsigned>
2 class Array
3 {
4 public:
5 ///ctor
6 ///...
7
8 ///dtor
9 ///...
10
11 inline T& operator[](SizeType &i){return mdata[i];}
12 inline const T& operator[]const(SizeType &i){return mdata[i];}
13
14 ///other codes
15 ///...
16
17 private:
18 T* mdata;
19 SizeType msize;
20 };
2 class Array
3 {
4 public:
5 ///ctor
6 ///...
7
8 ///dtor
9 ///...
10
11 inline T& operator[](SizeType &i){return mdata[i];}
12 inline const T& operator[]const(SizeType &i){return mdata[i];}
13
14 ///other codes
15 ///...
16
17 private:
18 T* mdata;
19 SizeType msize;
20 };