草庐IT

Edge-Based-Template-Matching

全部标签

c++ - 从 C++ 调用 C 函数, "no matching function"错误

我已经定义了以下头文件(在C中),省略了函数实现,因为不需要这个:#ifndefFFMPEG_MEDIAMETADATARETRIEVER_H_#defineFFMPEG_MEDIAMETADATARETRIEVER_H_#include#include#includeintsetDataSource(AVFormatContext**pFormatCtx,constchar*path);#endif/*FFMPEG_MEDIAMETADATARETRIEVER_H_*/在C++中,我定义了第二个头文件:#ifndefMEDIAMETADATARETRIEVER_H#defineMED

c++ - 模板特化 : does not match any template declaration

我在学习模板特化的时候,用了一个很简单的例子,但是还是报错。#includetemplateclasschrrr{public:Tchgchr(Tc);};templateTchrrr::chgchr(Tc){returnc+1;}templateclasschrrr{public:charchgchr(charc);};templatecharchrrr::chgchr(charc){returnc+2;}usingnamespacestd;intmain(){chara='a';inti=1;chrrrit;chrrrch;cout错误说:line20:error:template

c++ - 错误 : Range-based 'for' loops are not allowed in C++98 mode

所以我正在关注此页面上的教程:http://www.cplusplus.com/doc/tutorial/control/但是我在做范围/基于for循环时遇到了麻烦。我找到了这个页面:GNUGCCcompilerupdating那里的答案说我应该打开“项目”和“属性”。但是当我尝试这样做时,“属性”选项变灰了,没有任何解释:http://imageshack.com/a/img571/4371/xd1x.png那么..我怎样才能激活范围/基于for循环? 最佳答案 将-std=c++11标志传递给编译器。当然,GCC应该足够新(>=

微软 Edge 浏览器 Dev 版 115.0.1843.0 更新:优化垂直标签页,修复 AV1 媒体播放问题

5月10日消息,微软Edge浏览器Dev版115.0.1843.0已经向公众测试者开放,这个版本在垂直标签页模式下增加了拖拽链接打开新标签页的功能,允许调整发现面板的大小,修复了AV1媒体播放的问题,以及其他一些改进。新功能包括:在垂直标签页区域内,可以拖拽链接到任意位置,打开链接的新标签页。发现面板现在可以调整大小。macOS:增加了Control+Option+Command+Down的快捷键,用于打开拼写检查的纠正卡片。企业:新增了DiscoverPageContextEnabled策略。新增了配置推荐设置对话框的策略。可靠性改进包括:修复了在隐私窗口中选择文本时浏览器崩溃的问题。mac

c++ - 为什么这段代码有 C2784 "could not deduce template argument"错误

来自Lambdafunctionpassedasparameter我可以编译示例:templateRangeFindFirstIf(Range,bool(*Function)(typenameRange::ConstReferencevalue));structrange{usingConstReference=constfloat&;};rangerng;rng=FindFirstIf(rng,[](constfloat&val){return(val当然不能链接,因为FindFirstIf没有实现。然而,当我做了类似的事情时:templateRangeMyTest(Range,Va

c++ - is_same_template 在模板别名上的奇怪行为

下面的程序...#include#includetemplatestructTemplate{};templateusingAlias=Template;templateclassT1,templateclassT2>structis_same_template:std::false_type{};templateclassT>structis_same_template:std::true_type{};intmain(){std::cout::value::value::value...输出...Template==Template:trueTemplate==Alias:fals

c++ - 在 C++11 标准中,它在哪里禁止 'template <typename T> class A {...}; template <typename T> class A<int> {...};'(如果有的话)?

我试图通过想象神秘的构造来更全面地掌握模板语法和语义。我认为C++11标准不允许使用以下语法:templateclassA{...};//phony"specialization"templateclassA{...};但是,我找不到在C++11标准中不允许使用此语法的地方。C++11标准不允许显示的语法是否正确?如果有,从哪里可以查到语法是不允许的? 最佳答案 令我感到非常惊讶的是,14.5.5[temp.class.spec]中没有明确声明必须在模板参数列表中使用类模板偏特化的所有模板参数。那将使templateclassA无效

c++ - `template <auto>` 和部分类模板特化排序

考虑:#includetemplatestructTag{};templateautotag=Tag{};templatestructSelectorImpl;//1templatestructSelectorImpl...>{};//2template*tag,auto...xs>structSelectorImpl,std::integral_constant...>{};templatestructSelector:SelectorImpl...>{};intmain(){Selector,1,2>{};}gcc和clang都无法编译它,报告SelectorImpl的特化不明确。

C++ 性能 : template vs boost. 任何

我想知道在任何可以使用模板的地方使用boost.any(没有RTTI)类是否会减慢程序速度。由于boostany实际上是模板类的包装器,可以说现代编译器优化会产生相同的效果,对吗?tpl_vs_any.hpp#include#includeusingnamespacestd;templateclasstpl{Tcontent;public:tpl(constT&value):content(value){}operatorT()const{returncontent;}};classany{public:any():content(0){}any(constany&other):con

c++ - "error: no matching function for call to"构造未初始化的结构时

我正在尝试使用boost::lockfree::spsc_queue有了这个websocketserver而不是std::queue用于m_actions以包含此struct:enumaction_type{SUBSCRIBE,UNSUBSCRIBE,MESSAGE};structaction{action(action_typet,connection_hdlh):type(t),hdl(h){}action(action_typet,server::message_ptrm):type(t),msg(m){}action_typetype;websocketpp::connecti