[問題] VC6, binary_function, and virtual
各位板友好,下面的程式碼我在 VC6 上面執行會當掉,在 DevC++4980 不會。
在 VC6 上面只要將紫色部份任選一個刪除就可以正常執行,
請教各位大大,這是我的程式碼有錯或是 VC6 的問題呢?
謝謝大家的幫忙! Orz
#include <functional>
using std::binary_function;
#include <vector>
using std::vector;
#include <algorithm>
using std::sort;
class CSmaller : public binary_function<int, int, bool>
{
public:
virtual bool operator()(int lhs, int rhs) const
{
return lhs < rhs;
}
};
int main()
{
vector <int> pop(17, 1);
sort(pop.begin(), pop.end(), CSmaller());
return 0;
}
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.160.149.152
推
06/13 15:08, , 1F
06/13 15:08, 1F
推
06/13 15:40, , 2F
06/13 15:40, 2F
推
06/13 15:44, , 3F
06/13 15:44, 3F
→
06/13 16:20, , 4F
06/13 16:20, 4F
→
06/13 16:21, , 5F
06/13 16:21, 5F
推
06/13 16:41, , 6F
06/13 16:41, 6F
→
06/13 16:41, , 7F
06/13 16:41, 7F
→
06/13 16:42, , 8F
06/13 16:42, 8F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章