请问下面的警告是什么意思?

he_sl he_sl 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

#if !defined(AFX_MYINTSET_H__4B298077_5306_4DC5_BFDF_8487121E5C0C__INCLUDED_)
#define AFX_MYINTSET_H__4B298077_5306_4DC5_BFDF_8487121E5C0C__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif

#include<set>
#include<cassert>
#include<iostream>
using namespace std;

typedef set<int> INTSET;


class MyIntSet:public INTSET
{
public:
MyIntSet(){}

virtual ~MyIntSet(){}

//重载操作符[],取得集合指定位置的元素
int operator[] (int i)
{
assert(i>=0 && i<size());
MyIntSet::iterator p=begin();
for(int j=0;j<i;j++)
p++;
return *p;
}

//重载操作符+,求两个集合的并运算
MyIntSet operator+ (MyIntSet& myIntSet)
{
MyIntSet result=*this;
for(int i=0;i<myIntSet.size();i++)
result.insert(myIntSet[i]);
return result;
}

//重载操作符-,求两个集合的差运算
MyIntSet operator- (MyIntSet& myIntSet)
{
MyIntSet result=*this;
for(int i=0;i<myIntSet.size();i++)
result.erase(myIntSet[i]);
return result;
}

//重载操作符*,求两个集合的交运算
MyIntSet operator* (MyIntSet& myIntSet)
{
return (*this)-(*this-myIntSet );
}
};

//定义整型集合类的输出算子
inline std::ostream& operator<<(std::ostream& os,MyIntSet& myIntSet)
{
for(int i=0;i<myIntSet.size();i++)
os<<myIntSet[i]<<" ";
return os;
}

#endif



上面是我自己继承的整型集合类。在应用的时候:
#include "stdafx.h"
#include "MyIntSet.h"

int main(int argc, char* argv[])
{
MyIntSet ceshi;
printf("Hello World!\n");
return 0;
}



总是会出现下面的警告:

--------------------Configuration: MySetTest - Win32 Debug--------------------
Compiling...
MySetTest.cpp
d:\work\工作区域\工作区域3(仓库货物存储优化)\测试汇总\测试区域\杂项\mysettest\myintset.h(57) : warning C4786: 'std::pair<std::_Tree<int,int,std::set<int,std::less<int>,std::allocator<int> >::_Kfn,std::less<int>,std::allocator<int> >::const_iterator,
std::_Tree<int,int,std::set<int,std::less<int>,std::allocator<int> >::_Kfn,std::less<int>,std::allocator<int> >::const_iterator>' : identifier was truncated to '255' characters in the debug information
Linking...

MySetTest.exe - 0 error(s), 1 warning(s)


请问是为什么?

...全文
评论 1
收藏 已收藏
分享
返回顶部
he_sl
VC/MFC 16,550 成员 421,606 内容