草庐IT

invalid-argument

全部标签

c++ - 错误 : Use of class template requires template argument list

当我尝试运行我的程序时,此错误显示为“errorC2955:'FOURTEEN':useofclasstemplaterequirestemplateargumentlist”#includeusingnamespacestd;templateclassFOURTEEN{private:Ta[n];public:voidReadData();voidDisplayData();};voidFOURTEEN::ReadData(){for(inti=0;i>a.[i];}voidFOURTEEN::DisplayData(){for(inti=0;i>a.[i]P;//Readdatai

猫头虎分享已解决Bug || docker: Error response from daemon: invalid mount config for type ‍

博主猫头虎的技术世界🌟欢迎来到猫头虎的博客—探索技术的无限可能!专栏链接:🔗精选专栏:《面试题大全》—面试准备的宝典!《IDEA开发秘籍》—提升你的IDEA技能!《100天精通鸿蒙》—从Web/安卓到鸿蒙大师!《100天精通Golang(基础入门篇)》—踏入Go语言世界的第一步!《100天精通Go语言(精品VIP版)》—踏入Go语言世界的第二步!领域矩阵:🌐猫头虎技术领域矩阵:深入探索各技术领域,发现知识的交汇点。了解更多,请访问:猫头虎技术矩阵新矩阵备用链接文章目录猫头虎分享已解决Bug||docker:Errorresponsefromdaemon:invalidmountconfigfo

c++ - xutility.h 错误 C2064 : term does not evaluate to a function taking 2 arguments

我有问题要问。我创建了一个名为AstarPlanlama的类并具有以下2个函数:boolAstarPlanlama::nodeComp(constNode*lhs,constNode*rhs){returnlhs->FF;}voidAstarPlanlama::enKucukFliNodeBul(std::list*OPEN){std::list::iteratorit=std::min_element(OPEN->begin(),OPEN->end(),&AstarPlanlama::nodeComp);OPEN->sort(&AstarPlanlama::nodeComp);Q=O

c++ - 错误 : Element <EnableEnhancedInstructionSet> has an invalid value of "NoExtensions"

我想在虚拟机WindowsXP下VS2010下打开别人的C++项目。问题是,我认为该项目似乎是在Windows7下的VS2012下开发的。我已经成功转换了它的相关配置,感谢互联网。但是现在,当我尝试构建这个项目时,出现了以下错误:C:\ProgramFiles\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets(147,5):error:Elementhasaninvalidvalueof"NoExtensions".似乎配置更改导致了这个问题。我所做的是将Project->Properties-

c++ - 候选函数不可行 : 1st argument ('const Node *' ) would lose const qualifier

我正在使用内置的C++编写有向图(有向图)类unordered_map>数据结构,其中Node和Edge是我自己定义的两个结构体。在类里面我写了一个containsNode()搜索Node的方法在图中。这是containsNode()方法体:boolDiGraph::containsNode(constNode*n)const{auto::const_iteratorit=digraph.find(n);return(it==digraph.end());}digraph是unordered_map>类型的DiGraph的私有(private)成员.但是,编译器会生成以下错误:erro

c++ - 将 initializer_list 插入 std::vector 时出现 "Invalid iterator range"

此代码在Ideone上按预期编译并运行良好:#include#include#includeintmain(){std::vectorstrVec;strVec.insert(strVec.end(),{L"black",L"white",L"red"});strVec.insert(strVec.end(),{L"blue",L"green"});//STLexceptionfor(auto&i:strVec){std::wcout但是,在MSVC(VisualStudio2013)中因“无效的迭代器范围”而失败。有什么见解吗?顺便说一句,插入更多元素是可行的,例如在第二个插入中,这

c++ - %llx 格式说明符 : invalid warning?

已编辑以删除第一个警告以下代码在mingw32下的g++4.4.0中按预期工作:#includeintmain(){longlongx=0xdeadbeefc0defaceLL;printf("%llx\n",x);}但是如果我使用-Wall启用所有警告,它会说:f.cpp:Infunction'intmain()':f.cpp:5:warning:unknownconversiontypecharacter'l'informatf.cpp:5:warning:toomanyargumentsforformat%lld也是一样。这在较新的版本中已修复吗?再次编辑添加:如果我指定-std

c++ - 了解 "template argument is invalid"错误消息

考虑代码:#include#includestructtest1{voidInvoke(){};};structtest2{templatevoidInvoke(){};};enumclassInvokableKind{NOT_INVOKABLE,INVOKABLE_FUNCTION,INVOKABLE_FUNCTION_TEMPLATE};templatestructget_invokable_kind{conststaticInvokableKindvalue=InvokableKind::NOT_INVOKABLE;};templatestructget_invokable_ki

c++ - 错误 : no instance of overloaded function "std::make_shared" matches the argument list

查看ApreviousstackQuestionstd:make_sharedvsstd::shared_ptr,我试图在一个uni项目中实现它。这是之前的“问题”:Ican'tthinkofanysituationwherestd::shared_ptrobj(newObject("foo",1));wouldbepreferredtoautoobj=std::make_shared("foo",1);因此我采用了这段代码:std::shared_ptrpT1(newTriangle(pCanvas,30,30,30,60,60,30,255,0,0));并将其修改为这段代码:aut

c++ - OpenCl 代码在一台机器上工作,但我在另一台机器上得到 CL_INVALID_KERNEL_ARGS

我有以下代码,它在一台机器上运行良好,但是当我尝试在另一台配备更好显卡的机器上运行它时,我遇到了错误:global[0]=512;global[1]=512;local[0]=16;local[1]=16;ciErrNum=clEnqueueNDRangeKernel(commandQueue,myKernel,2,NULL,global,local,0,NULL,&event);错误:Error@clEnqueueNDRangeKernel:CL_INVALID_KERNEL_ARGSError@clWaitForEvents:CL_INVALID_KERNEL_ARGS知道问题出在