草庐IT

syntax-checking

全部标签

java - 使用 JGit 从 Git 存储库中 check out 特定修订

我正在尝试使用jGit克隆存储库并checkout特定提交。假设提交哈希是:1e9ae842ca94f326215358917c620ac407323c81。我的第一步是://CloningtherepositoryGit.cloneRepository().setURI(remotePath).setDirectory(localPath).call();然后我发现了另一个建议这种方法的问题:git.checkout().setCreateBranch(true).setName("branchName").setUpstreamMode(CreateBranchCommand.Se

c++ - CUDA 和 Eclipse : How can I tell eclipse that <<< (or >>>) is part of the syntax?

到目前为止,我发现如果定义了__CDT_PARSER__,可以通过定义它们来防止Eclipse提示专有CUDA关键字。以下代码可防止Eclipse提示大多数CUDA关键字。//Preventeclipsefrombitchingaboutunknownkeywords#ifdef__CDT_PARSER__#define__global__#define__device__#define__host__#define__shared__#endif然而,这不适用于用于配置内核启动的括号,因为我的内核通常有很长的参数列表,这很烦人。有什么想法吗? 最佳答案

c++ - 什么是 clang-check 的垃圾值

我收到以下警告:test.cpp:14:25:warning:Therightoperandof'/'isagarbagevaluereturn(std::abs(a)/size)>10;^~~~~对于这段代码:#include#include#include#includeusingnamespacestd;doublepitchDetect(conststd::vector>&dft,unsignedintsamplingRate)noexcept{if(dft.empty())return0.0;autoit=find_if(begin(dft),end(dft),[size=d

c++ - C++11 中的 checked_array_iterator<T>

C++11提供了std::array包装C数组,但仅限于在编译时知道数组大小的地方。处理大小仅在运行时已知的数组的最佳方法是什么?背景我正在将一些代码从MSVC移植到GCC。MSVC提供了stdext::checked_array_iterator为这样的代码行提供一些保护的模板:std::copy(v.begin(),v.end(),stdext::checked_array_iterator(arr,numVals));到目前为止,我可以想到两种选择:放弃安全检查或编写自己的实现。关于这一点,如果您对此实现提出任何建设性意见,我将不胜感激:namespacestdext{templ

C++ 2011 : good syntax to initialize an array in a constructor?

这里我有一个示例类:templateclassMyClass{public:MyClass();~MyClass();protected:T_data[SIZE];};templateMyClass::MyClass()://_data()OR_data({})OR_data{}OR...{;}在默认构造函数中将整个数组初始化为0的正确C++2011语法是什么?非常感谢。 最佳答案 统一初始化语法运行良好:MyClass():_data{}{} 关于C++2011:goodsyntaxt

c++ - 错误 C2143 : syntax error : missing ';' before '__stdcall"

我在创建COMDLL时遇到了一些问题。我的IClassFactory实现如下所示:include#include#include"AddObj.h"#include"AddObjFactory.h"HRESULT__stdcallCAddFactory::CreateInstance(IUnknown*pUnknownOuter,constIID&iid,void**ppv){if(pUnknownOuter){returnCLASS_E_NOAGGREGATION;}CAddObj*pObject=newCAddObj();if(pObject==NULL){returnE_OUTO

c++ - 成员函数检查 : Implement compilation-time checkings with C++11 features

我读到C++11有足够的静态检查(编译时),以便实现C++11的大部分内容(已删除)。(我在最近关于已删除概念的问题的评论中读到过此内容...-该问题因不具有建设性而很快被关闭)。下面的C++03代码仅检查类中是否存在成员函数(我的模板类要在该类上工作)。这里有4个搜索的成员函数,我总是使用相同的模式:定义函数原型(prototype)的typedef如果类型名称TExtension没有定义这样的成员函数,或者如果它有不同的原型(prototype),则调用static_cast会中断编译代码如下:templateclass{...voidcheckTemplateConcept(){

c++ - GCC -fstack-check 选项在 C 中引发了什么异常

根据gcc文档-fstack-checkGeneratecodetoverifythatyoudonotgobeyondtheboundaryofthestack.Notethatthisswitchdoesnotactuallycausecheckingtobedone;theoperatingsystemmustdothat.Theswitchcausesgenerationofcodetoensurethattheoperatingsystemseesthestackbeingextended.我的假设是这个额外的代码会产生异常让操作系统知道。使用C语言时,我需要知道额外代码生成

c++ - 打开 : check if nested parallesim

假设我有一个方法将两个std::vector相乘:doublemultiply(std::vectorconst&a,std::vectorconst&b){doubletmp(0);/*hereIcouldeasilydoaparallelizationwith*//*#pragmaompparallelloopfor*/for(unsignedinti=0;i如果我在此函数中设置pragma宏,将运行对multiply(...)的调用在所有线程上。现在假设我想在其他地方做很多vector乘法:voidmany_multiplication(std::vector*a,std::ve

centos yum/dnf 命令安装报错 Error: GPG check FAILED

centos用dnf命令安装包的时候出现包签名错误报错信息[root@localhost]#dnfinstallgitCentOS-8-AppStream388kB/s|4.4kB00:00CentOS-8-Base3.7kB/s|3.9kB00:01CentOS-8-Extras376kB/s|2.9kB00:00Dependenciesresolved.PackageArchitectureVersionRepositorySizeInstalling:gitx86_642.39.3-1.el8AppStream104kInstallingdependencies:git-corex86_