草庐IT

implicit-conversion

全部标签

c++ - 警告 : definition of implicit copy constructor is deprecated

我的C++11代码中有一个警告,我想正确修复,但我真的不知道如何修复。我已经创建了我自己的异常类,它派生自std::runtime_error:classMyError:publicstd::runtime_error{public:MyError(conststd::string&str,conststd::string&message):std::runtime_error(message),str_(str){}virtual~MyError(){}std::stringgetStr()const{returnstr_;}private:std::stringstr_;};当我使

laravel - QUEUE_CONNECTION 'database' 工作但 'redis' 抛出 'Array to String conversion'

我只是想运行一个Event&Listener循环并将模型传递给它event(newLabelsCreated($model,'string'));这与QUEUE_CONNECTION=database完美配合,但与QUEUE_CONNECTION=redis配合使用时,它会抛出错误:#message:"Arraytostringconversion"#code:0#file:"/home/vagrant/Code/Upworks/myproj/vendor/laravel/framework/src/Illuminate/Queue/RedisQueue.php"#line:302#s

mysql - 导入错误:没有名为 connector.conversion 的模块

我是mySQL的新手,刚刚将它安装在我的Mac(OS10.6.8)上。当我尝试通过终端连接数据库时,我收到此消息:Lastlogin:TueJun1710:42:23onconsolemysqluc-e"helputilities"GEdit-2:~Eric$mysqluc-e"helputilities"Traceback(mostrecentcalllast):File"/bin/mysqluc",line23,infrommysql.utilities.common.optionsimportlicense_callback,UtilitiesParserFile"/Librar

ios - Core Plot 和 Xcode 5 编译错误 : "Implicit conversion from enumeration type ' enum UILineBreakMode'

我正在使用Xcode5并在尝试编译我的使用CorePlot的iOS应用程序时收到以下错误:Implicitconversionfromenumerationtype'enumUILineBreakMode'todifferentenumerationtype'NSLineBreakMode'(aka'enumNSLineBreakMode')错误在CPTTextStylePlatFormSpecific.m中:-(void)drawInRect:(CGRect)rectwithTextStyle:(CPTTextStyle*)styleinContext:(CGContextRef)c

ios - 警告 : Incompatible integer to pointer conversion when using NS_ENUM types

我正在使用一个枚举,像这样:typedefNS_ENUM(NSInteger,MyURLType){MyURLType1,MyURLType2,MyURLType3};当我尝试比较或识别类型时出现问题:if(type==MyURLType2)在MyUrlType2和MyUrlType3的情况下(不是MyURLType1)。我在声明中做错了什么吗?有什么想法吗?谢谢! 最佳答案 来自您的评论Yes,IamusingMyURLType*type=MyURLTypeX然后type不是MyURLType类型,它是指向MyURLType的类型

ios - 如何解决钥匙串(keychain)错误 : Implicit conversion of C pointer type 'CFTypeRef'

我正在尝试这个UsingtheKeychaintostorepasswordsoniOSstorybored用于存储用户电子邮件和用于登录的密码。在我的m文件中:........#import"KeychainItemWrapper.m"........KeychainItemWrapper*keychain=[[KeychainItemWrapperalloc]initWithIdentifier:@"KeychainTest"accessGroup:nil];[keychainsetObject:kSecAttrAccessibleWhenUnlockedforKey:kSecAt

ios - 添加 Google Conversion Tracking SDK iOS-3.0.0 时应用程序崩溃

我将GoogleConversionTrackingSDK添加到我的项目中,然后调用函数:[ACTConversionReporterreportWithConversionID:@"972050884"label:@"Bzk1CIzPkAkQxKPBzwM"value:@"0"isRepeatable:NO];然后我的应用程序崩溃了。这是堆栈跟踪:'NSInvalidArgumentException',reason:'+[NSDateact_secondsSince1970]:unrecognizedselectorsenttoclass0x10225d8d0'***Firstth

iphone - 我在 iOS 的 Xcode 中收到 "Implicit conversion from enumeration type"警告,我不知道为什么

使用这段代码:NSDataDetector*detector=[NSDataDetectordataDetectorWithTypes:NSTextCheckingTypeLinkerror:&error];我收到这个警告:Implicitconversionfromenumerationtype'enumNSTextCheckingType'todifferentenumerationtype'NSTextCheckingTypes'(aka'enumNSTextCheckingTypes')有人可以向我解释为什么会收到此警告以及如何解决吗? 最佳答案

c - 索拉里斯 8-10 : host2ip conversion problems

我正在处理一个非常特殊的问题。我有在solaris8/sparc平台上由旧编译器(gcc2.95或更早版本)编译的代码。它在solaris8/sparc上运行良好,但在solaris10/sparc上崩溃。(solaris10应该向后兼容solaris8)在调试时,我发现当应用程序尝试将主机名转换为相应的i/p地址时会出现问题。它使用gethostbyname_r,然后是inet_ntoa来获取ipv4quaddottednumber。通过解决方案的gdb使我看到gethostbyname_r返回的in_addr具有表示i/p地址的正确整数,但inet_ntoa调用返回格式错误的字符串

swift - 什么是 Swift 中的桥接转换,如以下警告 : Conditional downcast from 'Data?' to 'CKRecordValue is a bridging conversion

什么是Swift中的桥接转换?“桥接”是什么意思?我在下面的代码中收到一条警告,其中我用注释“//warning”进行了标记:importUIKitimportCloudKitletint:UInt8=1letdata:Data?=Data([int])letrecord:CKRecord=CKRecord(recordType:"record_type")record.setObject(dataas?CKRecordValue,forKey:"field")//warning警告说:Conditionaldowncastfrom'Data?'to'CKRecordValue'(ak