草庐IT

template-matching

全部标签

c++ - "template"不需要关键字? [gcc/clang/Comeau 错误?]

这是测试代码templatevoidf(){Tt;t.f(0);//compilesevenwithoutthe"template"keyword,whatamImissing?}classabc{public:templatevoidf(int){}};intmain(){f();}我正在使用g++4.4.6。谢谢P.S:我已经大大编辑了我的问题。请不要介意。编辑:我向EDG的人问了这个问题,这是MikeHerrick不得不说的Wedodiagnosethisasanerrorin--strictmodeaswellasanymodethatenablesdependentnamel

c++ - G++ 编译器错误或错误代码? : "template definition of non-template"

作为大型程序的特征类的一部分,我尝试创建一个静态类变量,该变量可能具有不同的值,具体取决于实例化封闭类模板的类型。我已经简化了相关代码以生成我正在谈论的内容的简单示例:#include#include#includetemplatestructFoo;templatestructFoo::value>::type>{staticstd::stringmessage;};templatestructFoo::value>::type>{staticstd::stringmessage;};templatestd::stringFoo::message;对于GCC4.6,这会产生一个编译器

c++ - C++1 7's deduced ` auto` 非类型 `template` 参数是否可以使用显式非类型参数模式匹配模板?

考虑这个例子(alsoavailableonwandbox):templateclass>voidtest(){}templatestructX{};正在尝试实例化test()在clang++4.0(trunk)导致编译错误:error:nomatchingfunctionforcallto'test'test();^~~~~~~note:candidatetemplateignored:invalidexplicitly-specifiedargumentfor1sttemplateparametervoidtest(){}我最初的假设/直觉是test可用于匹配任何template具

c++ - 构造函数中的 "No matching function call"

这是我在“solver.h”文件中的构造函数声明。Solver(constBoard&board_c,intmax_moves_c);尝试编译时出现以下错误...solver.cpp:Inconstructor'Solver::Solver(constBoard&,int)':solver.cpp:6:55:error:nomatchingfunctionforcallto'Board::Board()'Solver::Solver(constBoard&board_c,intmax_moves_c)然后它列出了董事会build者的候选人。我不确定自己做错了什么,因为我看不出为什么会出

c++ - "Template argument for template template parameter must be a class template or type alias template"

templatestructList{};templateclass>structListHelper;templatestructListHelper>{};^/*Error:Templateargumentfortemplatetemplateparametermustbeaclasstemplateortypealiastemplate*/怎么了?我正在使用clang++SVN。 最佳答案 您有一个模板模板参数。您必须传递一个模板作为其参数。您改为将模板实例化作为其参数传递-这是一个具体类,而不是模板(其所有参数均已绑定(bi

c++ - 专门化成员函数时出现 "too many template-parameter-lists"错误

我想像这样在模板类中定义一些模板成员方法:templateclassCallSometing{public:voidcall(TtObj);//1sttemplatevoidcall(TtObj,AaObj);//2ndtemplatetemplatevoidcall(TtObj,AaObj,BbObj);//3rd};templatevoidCallSometing::call(TtObj){std::couttemplatevoidCallSometing::call(TtObj,AaObj){std::couttemplatetemplatevoidCallSometing::c

c++ - 辛>> "no operator matches these operands"

我一直在visualstudio2012控制台模式下处理一个C++项目,我一直在使用cin函数时遇到这个奇怪的持续性错误。在>>>下,我得到一条红线,程序告诉我没有运算符匹配这些操作数。我已经在单独的方法中初始化了所有数组元素。这是一个片段示例(实际代码包含更多变量):for(inti=0;i>allTaxiDetails[i].taxiRank;}allTaxiDetails是一个数组,数据类型为“taxiDetails”,结构如下:structtaxiDetails{stringtaxiDriverSurname;inttaxiID;inttaxiCoordinates;intnu

io.jsonwebtoken.SignatureException: JWT signature does not match locally computed signature. JWT val

io.jsonwebtoken.SignatureException:JWTsignaturedoesnotmatchlocallycomputedsignature.JWTvaliditycannotbeassertedandshouldnotbetrusted.   atio.jsonwebtoken.impl.DefaultJwtParser.parse(DefaultJwtParser.java:354)   atio.jsonwebtoken.impl.DefaultJwtParser.parse(DefaultJwtParser.java:481)   atio.jsonwebto

windows - Windows 是否存在带有标签的程序员的 "document template"?

我想知道(如果可能)是否有一个程序/工具/实用程序可以在我创建新文件并为其提供扩展名时自动创建适当的标签?例如,我创建的名为index.php的新文件将在其中自动生成适当的标签:希望您能理解。有关此的任何信息都会有所帮助。 最佳答案 我不知道可移植实用程序,但在Windows上,有一个内置功能可以做到这一点。从regedit,转到您的HKCR/.your-extension(例如HKCR/.php)。(默认)值将包含文件类型类-转到HKCR/.your-extension/the-filetype-class或HKCR/the-fi

c++ - LNK2038 : mismatch detected for 'boost_log_abi' : value 'v2s_mt_nt5' doesn't match value 'v2s_mt_nt6'

在创建由boost库组成的单独头文件后,我尝试将其包含在现有项目中。但是显示如下错误:::Error15errorLNK2038:mismatchdetectedfor'boost_log_abi':value'v2s_mt_nt5'doesn'tmatchvalue'v2s_mt_nt6'inBoostLogger.objE:\Projects\native\dcnotificationserver\loggerutil.obj::我知道以前的项目适用于从WindowsXP到当前Windows操作系统(即)10。但我读到WindowsXP支持boost。问题是什么?如何解决?我认为是