草庐IT

matches_stage

全部标签

C++ 模板和 "no matching function to call"

我遇到了一个奇怪的错误。我有以下签名的功能:templatestaticboolConvertCbYCrYToRGB(constCharacteristicspace,constDATA*input,DATA*output,constintpixels){后来这样称呼:casekByte:returnConvertCbYCrYToRGB(space,(constU8*)input,(U8*)output,pixels);casekWord:returnConvertCbYCrYToRGB(space,(constU16*)input,(U16*)output,pixels);casek

c++ - 谷歌模拟 : How to configure custom message to explain match failure

如果匹配失败,Googlemock会打印如下消息:test.cpp:112:EXPECT_CALL(mock_obj,foo(MyMatcher(bar)))...Expectedarg#0:isequalto[1,2;3,4]Actual:{1}Expected:tobecalledonceActual:nevercalled-unsatisfiedandactive使用自定义匹配器MyMatcher我可以定义一个描述字符串,用于在匹配失败时生成失败消息。但它只定义了消息的Expectedarg#0部分。有什么方法可以自定义Actual的打印方式吗?在我的例子中,我不能为bar的类重

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++ - 当 regex_search 返回 true 时,零是否始终匹配 "matches"?

以下是C++11标准中的一些引用:28.11.3regex_search[re.alg.search]m是regex_search的参数,类型为match_results。2Effects:Determineswhetherthereissomesub-sequencewithin[first,last)thatmatchestheregularexpressione.Theparameterflagsisusedtocontrolhowtheexpressionismatchedagainstthecharactersequence.Returnstrueifsuchasequence

【愚公系列】2023年12月 HarmonyOS教学课程 048-Stage模型(卡片数据交互)

🏆作者简介,愚公搬代码🏆《头衔》:华为云特约编辑,华为云云享专家,华为开发者专家,华为产品云测专家,CSDN博客专家,CSDN商业化专家,阿里云专家博主,阿里云签约作者,腾讯云优秀博主,腾讯云内容共创官,掘金优秀博主,51CTO博客专家等。🏆《近期荣誉》:2023年华为云十佳博主,2022年CSDN博客之星TOP2,2022年华为云十佳博主等。🏆《博客内容》:.NET、Java、Python、Go、Node、前端、IOS、Android、鸿蒙、Linux、物联网、网络安全、大数据、人工智能、U3D游戏、小程序等相关领域知识。🏆🎉欢迎👍点赞✍评论⭐收藏文章目录🚀一、卡片数据交互🔎1.卡片数据交互

c++ - 错误 : no matching function for call to ‘to_string(std::basic_string<char>&)’

即使在模板中我可以有任何类型,函数to_string对基本字符串不起作用:例如:std::stringstr("mystring");my_class(str);用这个仿函数定义:templatevoidoperator()(valuetypevalue){...private_string_field=std::to_string(value);不起作用。这是错误:error:nomatchingfunctionforcallto‘to_string(std::basic_string&)’避免它的最佳方法是什么。事先,我要求避免仅仅因为一些常见的关键字就链接到不相关的问题。

c++ - "no matching function for call to ‘async(std::launch, <unresolved overloaded function type>, std::string&)’“

我正在尝试使用std::async创建线程,但我不断收到错误“没有匹配函数调用‘async(std::launch,,std::string&)’”在行上ConnectFuture=std::async(std::launch::async,Connect_T,ip);这是产生这种行为的代码:#includeclasslibWrapper{public:voidConnect(std::stringip);voidConnect_T(std::stringip);private:std::futureConnectFuture;};voidlibWrapper::Connect(std

c++ - 错误 : no matching member function for call to 'push_back'

为什么我在最后两行收到错误?目标是在集合中找到对象,并修改其内容。usingnamespacestd;structmystruct{intid;vectory;mystruct(constintid):id(id){}booloperatorsx;mystructx(1);x.y.push_back(1);x.y.push_back(2);sx.insert(x);//set::iteratori=sx.find(1);constmystruct*x1=&(*i);constmystructx2=*x1;couty)y)y.push_back(4);}好像迭代器返回的是常量对象,不让我

c++ - 错误 : no matching function for call to . .. 在返回语句

我在openSUSELeap15上的Qt5.9.4上使用GCC7。我有以下类(class):classManSuppProps:publicQObject{Q_OBJECTpublic:explicitManSuppProps(QStringparentName);explicitManSuppProps(){}explicitManSuppProps(constManSuppProps&manSuppProps);explicitManSuppProps(ManSuppProps&manSuppProps);~ManSuppProps();private:QVector3Dm_sup

HarmonyOS--Stage模型

构建第一个ArkTS应用(Stage模型)-快速入门-入门|华为开发者联盟(huawei.com)鸿蒙开发两种模型FA模型:早期使用,现在不主推。Stage模型:推荐HarmonyOS4和HarmonyOSNEXT版本开发从源码到编译到运行@entry就是一个Ability类的一个模块。编译期源码中的所有Ability模块全会编译成为.HAP(HarmonyAbilityPackage)文件;所有的Library模块,会被编译为.HSP(HarmonySharedPackage)文件。HAP包再运行中就可以引用HSP包,一个应用,只能有一个入口模块--Entry类型的HAP,剩下的叫做Feat