草庐IT

Invalid_argument

全部标签

java - "projections are not allowed for immediate arguments of a supertype"Kotlin Android Studio

当我将Java转换为Kotlin时出现此错误:JavapublicclassHeaderTabextendsExpandableGroup{privateStringheader;publicHeaderTab(Stringtitle,Listitems){super(title,items);}}KotlinclassHeaderTab(title:String,items:List):ExpandableGroup(title,items){privatevalheader:String?=null}AndroidStudio是这样说的:projectionsarenotallow

c++ - "Invalid template argument"错误在 Visual Studio 但不是 GCC

假设你有代码templateclassBaseType>classEST16:publicBaseType{public:EST16(doubled){}};templateclassSCEST{Ty;};typedefEST16EST16_SC;classChild:publicEST16_SC{public:Child():EST16_SC(1.0){}};classNotWorkingChild:publicEST16{public:NotWorkingChild():EST16(1.0){}};TEST(TemplateTest,TestInstantiate){Childch

c++ - connect() 返回 "invalid argument"和 ipv6 地址

我有这个简单的客户端-服务器应用程序对。代码非常简单,我只使用新的建议方法,如getaddinfo等,一切都适用于ipv4。即使对于ipv6环回(::1)它也有效。当涉及到其他一些ipv6地址时,问题就开始了……我在一个网络中有两台机器,当我传递它们的ipv4地址时一切正常,但是当我给我的客户端ipv6地址时,我在连接函数上遇到错误:参数无效.嘿,我不是已经知道了吗?我愿意!当我尝试ping6这个ipv6地址时,我得到了同样的错误:connect:Invalidargument但是有一种方法可以克服这个障碍-应该选择一个带有-I开关的接口(interface),从那时起一切都可以顺利运

c++ - 为什么 "error: invalid application of ' sizeof' 为使用 unique_ptr 的不完整类型”通过添加空析构函数来修复?

这个问题在这里已经有了答案:Isstd::unique_ptrrequiredtoknowthefulldefinitionofT?(9个回答)关闭7年前。我在类里面拉皮条STFT.在header中用这个编译就好了:classSTFT;//pimplofftopreventpointnameclashclassWhatever{private:STFT*stft;这在实现中:#include"STFT.h"Whatever::Whatever():stft(newSTFT()){//blahblah}Whatever::~Whatever(){deletestft;//pureevil

PHP 警告 : PHP Startup: Invalid library (maybe not a PHP library)

过去我确实创建了一个共享库,现在我想在php扩展中使用它。有可能这样做吗?正如我在config.m4文件中看到的那样,PHP_NEW_EXTENSION()要求.cc。问题是我不想公开我的代码。我只想使用我在ubuntu下用c编写的header和共享库。对于php扩展,我确实创建了一个:config.m4、php_c.h和php_c.cc。请帮忙!感谢感谢我确实把这个放在了配置文件中:libs=mylib.so;PHP_ADD_LIBRARY_WITH_PATH(libs,$EXTERNAL_LIB_DIR,??whattoaddhere);我得到以下信息:PHPWarning:PHP

c++ - 错误 : invalid initialization of non-const reference of type ‘bool&’ from an rvalue of type ‘std::vector<bool>::reference {aka std::_Bit_reference}’

为什么我会收到错误:从类型为“std::vector::reference{akastd::_Bit_reference}”的右值对类型为“bool&”的非常量引用进行无效初始化?vector>vis;bool&visited(intx,inty){returnvis[x][y];//error}据我所知,vector中的operator[]返回引用,所以它应该是一个左值,但它不起作用。我应该怎么做才能让它发挥作用? 最佳答案 那是因为std::vector不是它看起来的样子。std::vector有一个特化与类型bool-它是空间

c++ - 错误 : ‘list’ is not a member of ‘std’ and error: template argument 2 is invalid

我正在尝试编译我的头文件,但我遇到了我无法弄清楚的错误。我想创建一个包含3个映射的结构:-从单个单词映射到计数-从词对映射到计数-从单个单词映射到后续单词列表我的头文件中的代码:#include#include#include#include#include#include#include#includetypedefstruct{std::mapfirstCounts;std::mappairCounts;std::map>follows;//Youcanuseaniteratortoretrievethevaluesstoredinthelist.}LanguageModel;我得

c++ - 铿锵错误 : non-type template argument refers to function that does not have linkage -- bug?

我有一些非常简单的(C++11)代码,最新的clang(version3.4trunk187493)无法编译,但GCC编译正常。代码(下面)实例化函数模板foo使用局部函数类型Bar然后尝试将其地址用作类模板Func的非类型模板参数:templatestructFunc{};templateexterninlinevoidfoo(){usingFoo=Func>;}intmain(){structBar{};//function-localtypefoo();return0;}clang发出以下错误:error:non-typetemplateargumentreferstofunct

c++ - 错误 C2064 : term does not evaluate to a function taking 0 arguments

各位!我在一个map容器中维护一组channel数据,从中可以通过channel名称访问单个channel数据。对此,我写了一个简单的函数GetIRChannelData(请看下面的代码)。编译时,语句pusIRChannelData=cit->second();抛出错误,显示为errorC2064:termdoesnotevaluatetoafunctiontaking0arguments所有要做的功能就是在map容器中搜索给定的channel名称/ID,如果找到则将其数据指针分配给时间指针。你能告诉我哪里出了问题吗?constArray2D*GetIRChannelData(std

c++ - 模板参数不明确 : could not deduce template argument

我正在做一些看起来像这样的包装器:#includetemplatevoidApply(void(T::*cb)(Value),T*obj,Valuev){(obj->*cb)(v);}classFoo{public:voidMyFunc(constint&i){std::cout我收到这个错误:应用:未找到匹配的重载函数。voidApply(void(__thiscallT::*)(Value),T*,Value):模板参数Value不明确,可能是int或constint&。voidApply(void(__thiscallT::*)(Value),T*,Value):无法从const