STL map 的关键字key 的类型有限制吗?可以是类类型吗?
可以是类类型,但是你的类要实现operator <
bool operator<(const a& a1, const a& a2) { if ( a1.m_a>=a2.m_a ) return false; return true; }