std::set 用法
A. typedef std::set<BaseDlg*> DlgSet
能帮我具体讲下这句话都是什么意思?
谢谢~
B.
<>是指定模板参数。如:
#include<iostream>
using namespace std;
template < typename T >
class A
{
private:
T a;
public:
A( T aa ):a(aa){}
~A(){}
void print(){ cout<<a<<endl; }
};
int main()
{
A<int> a(10);
a.print();
A<double> b( 230.442 );
b.print();
return 0;
}
这里就是从此以后有DlgSet的地方就可以用set<BaseDlg*>来代替,省点打代码的时间。