调试 错误信息

1, 

set_difference(s1.begin(), s1.end(), s2.begin(), s2.end(),
               std::inserter(s3, s3.begin()));
//             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Example: http://ideone.com/B4Cc1

By putting s3.begin() as the output iterator, you would mean that you want to overwrite the front region of the set with the set difference. Overwriting requires the size of set being larger than the result, which is obviously not true most of the time; even if the set is not empty, you can't use s3.begin() as output because the iterator is read-only (otherwise it would destroy the sorted order).

OTOH, std::inserter(x, cit) means that, whenever this output iterator is assigned (*it = y), the insert method will be called (x.insert(cit, y)), which is what you really want: populate a set from empty.




2,   coupon_type = atoi(req[string("coupon_type")].c_str());




funpoint.cc:619:31: error: passing ‘const std::map<std::basic_string<char>, std::basic_string<char>     >’ as ‘this’ argument of ‘std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _C    ompare, _Alloc>::operator[](std::map<_Key, _Tp, _Compare, _Alloc>::key_type&&) [with _Key = std::bas    ic_string<char>; _Tp = std::basic_string<char>; _Compare = std::less<std::basic_string<char> >; _All    oc = std::allocator<std::pair<const std::basic_string<char>, std::basic_string<char> > >; std::map<_    Key, _Tp, _Compare, _Alloc>::mapped_type = std::basic_string<char>; std::map<_Key, _Tp, _Compare, _A    lloc>::key_type = std::basic_string<char>]’ discards qualifiers [-fpermissive]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值