【发布时间】:2012-02-20 21:05:22
【问题描述】:
我有一些代码在 VS 10.0 中编译得很好,但是在下面的 Orders 映射中插入一些项目后,我在 Microsoft 调试库中收到“无效的运算符
typedef struct MY_orderID_t
{
char orderID[8];
} MY_orderID_t;
struct std::less<MY_orderID_t>
{
bool operator()(const MY_orderID_t& k1, const MY_orderID_t& k2) const
{
for( int i=0; i < 8; i++ )
{
if( k1.orderID[i] < k2.orderID[i] )
return( true );
}
return( false );
}
};
std::map< MY_orderID_t, MY_order_t > Orders[5];
【问题讨论】:
标签: c++ dictionary stl strict-weak-ordering