草庐IT

不明显

全部标签

c++ - 不明确的符号 - 无法从 ado::DataTypeEnum 转换为 DataTypeEnum

尝试编译包含SQL库的C++项目并出现以下错误:errorC2664:'CNCQuickADO::ConvertADOType':cannotconvertparameter1from'ado20::DataTypeEnum'to'DataTypeEnum'ConversiontoenumerationtyperequiresanexplicitcasterrorC2664:'CNCQuickADO::ConvertADOType':cannotconvertparameter1from'ado20::DataTypeEnum'to'DataTypeEnum'Conversiontoe

c++ - 当类的多重继承本身在其层次结构中具有菱形继承时,功能继承不明确

文字描述(下面的代码):我有一个提供类集合的库。对于每组类,我们有两个具体类型,(ClassA_Partial,ClassA),(ClassB_Partial,ClassB)等。这些分别实现(Interface_Partial、Interface)。此外,Interface是一个Interface_Partial并且每个Class?是一个Class?_Partial-创建一个菱形继承模式,其中顶部是虚拟继承的。为什么在同时继承ClassA和ClassB时,Interface_Partial函数不明确?structInterface_Partial{virtual~Interface_P

C++11 自动/我不明白的东西

好的。这是我的代码:CShop::~CShop(){TPacketGCShoppack;pack.header=HEADER_GC_SHOP;pack.subheader=SHOP_SUBHEADER_GC_END;pack.size=sizeof(TPacketGCShop);Broadcast(&pack,sizeof(pack));GuestMapType::iteratorit;it=m_map_guest.begin();while(it!=m_map_guest.end()){LPCHARACTERch=it->first;ch->SetShop(NULL);++it;}M

c++ - 使用枚举基编写枚举时出现不明确的重载,但仅使用 clang

我想使用operator#includeenummyenum:uint16_t{X=0,};intmain(){std::coutgcc4.8和visualstudio2015没有这个问题。clang++-3.6错误#clang++-3.6-std=c++11-O0ostream.cpp-otest.exeostream.cpp:18:29:error:useofoverloadedoperator'>'and'myenum')std::cout总的来说,在严格遵守方面,我倾向于相信clang,所以也许使用确实是模棱两可的。枚举当然可以转换为其他类型的整数。我希望编译器更喜欢与枚举的基

c++ - 为什么这些方法调用不明确?

#includeusingString=std::string;classBase{protected:Stringvalue;};classReadonly:virtualBase{public:constString&method()const{returnvalue;}String&method(){returnvalue;}};classWriteonly:virtualBase{public:Writeonly&method(constString&value){this->value=value;return*this;}Writeonly&method(String&&v

c++ - 第一次填充 QTableWidget 时,一切都很好,但是当我重新填充它时,速度明显变慢

代码:populateTable(){tableWidget->clearContents();tableWidget->setRowCount(stringList.size());for(inti=0;isetItem(i,0,newQTableWidgetItem(stringList.at(i)));}}问题:第一次运行populateTable()时,一切正常。但是接下来的时间,它的运行速度明显比以前慢。讨论:经过仔细测试后,我怀疑clearContents()是问题所在。因为简单地改变代码从tableWidget->clearContents();到:tableWidget

c++ - 在 C++11 中,引用在运行时明显发生变化

考虑以下C++11中的简单代码,摘自C++Primer,5thEdition:#include#includeusingstd::cout;usingstd::string;usingstd::endl;intmain(){strings("HelloWorld!!!");for(auto&c:s)//foreverycharins(note:cisareference)c=toupper(c);//cisareference,sotheassignmentchangesthecharcout该代码使用rangefor循环遍历string中的每个字符并将其更改为大写,这非常简单。令我困

c++ - 全局函数和不明确的参数 NULL 与 char* 在 vs 2013 和 GCC 之间

我试图了解当前C++14标准关于解决模糊函数调用的内容,主要是因为我看到GCC4.9.1和VisualStudio2013更新3之间的差异这是代码(MS和GCC完全相同):#includeusingnamespacestd;voidf(char*str,intchars){coutVisualStudio使用默认vs标志调用f(char*,int)GCC给了我一个编译器错误:重载'f(char*&,NULL)'的调用不明确。gcc仅使用-std=c++11标志。 最佳答案 这取决于NULL的定义。MSVC将其定义为0,因此int重载

c++ - 解决 C++ 中不明确的 this 指针

我正在尝试从旧类派生新类。基类声明如下所示:classDriver:publicPlugin,publicCmdObject{protected:Driver();public:staticDriver*GetInstance();virtualEngine&GetEngine();public://Pluginmethods...virtualboolInitPlugin(Mgr*pMgr);virtualboolOpen();virtualboolClose();//CmdObjectvirtualboolExecObjCmd(uint16cmdID,uint16nbParams,

c++ - 对不带参数的可变参数模板函数的调用不明确?

运行时:templatestructCodeByType{staticconstint32_tValue=7;};templatestructCodeByType{staticconstint32_tValue=1;};templateint32_tSum(){//ThecompilercomplainsonthislinereturnSum()+Sum();}templateint32_tSum(){returnCodeByType::Value;}intmain(){autosum=Sum();}我得到:ErrorC2668'Sum':ambiguouscalltooverload