草庐IT

quoted_table_name

全部标签

C++ 风格约定 : Parameter Names within Class Declaration

我是一个相当新的C++程序员,我想听听支持和反对在类声明中命名参数的争论。这是一个例子:Student.h#ifndefSTUDENT_H_#defineSTUDENT_H_#includeusingnamespacestd;classStudent{private:stringname;unsignedintage;floatheight,GPA;public:Student(string,unsignedint,float,float);voidsetAge(unsignedint);};#endif/*STUDENT_H_*/对比#ifndefSTUDENT_H_#defineS

c++ - 来自 Xcode 8.3.2 : Non-portable path to file - specified path differs in case from file name on disk 的错误警告

出于某种原因,我的代码库突然开始收到数以千计的此类警告。但到目前为止,所有有问题的文件和路径都是完全正确的,与我在磁盘上看到的与Finder相匹配。他们是不是在暗地里另有幕后?当问题实际上并不存在时,为什么Xcode会生成这些警告?尽管http://stackoverflow.com/questions/43067017/non-portable-path-to-file-file-h-specified-path-differs-in-case-from-file-na是关于相同的警告,在这种情况下我已经验证导入路径与磁盘上的文件名匹配。 最佳答案

c++ - 为什么 injected-class-name 有时不被视为类模板中的模板名称?

SourceInthefollowingcases,theinjected-class-nameistreatedasatemplate-nameoftheclasstemplateitself:itisfollowedbyitisusedasatemplateargumentthatcorrespondstoatemplatetemplateparameteritisthefinalidentifierintheelaboratedclassspecifierofafriendclasstemplatedeclaration.所以我尝试检查所有3种情况(另外在基本歧义的情况下,尽管我

C++:编译错误 - "no .eh_frame_hdr table will be created"

我应该使用数据分析程序进行物理实验。但是我无法编译它。代码很旧,与我能找到的当前GCC版本不兼容。为了让事情更耗时,我从一个修改了所有makefile以使其在Mac上编译的人那里得到了代码。我没有C++经验,但借助手册页、谷歌和耐心,我在途中修复了很多错误,但即使经过一周的尝试和谷歌搜索,我仍然坚持这一点。我认为相关的错误信息如下:/usr/bin/ld:errorin/home/daniel/skola/exjobb/miniballscripts/lib/libCommandLineInterface.so(.eh_frame);no.eh_frame_hdrtablewillbe

c++ - G++ 4.4.7 中的 "names the constructor, not the type"

我有以下简单的C++代码:#includeclassA{public:A(inty):x(y){}A&operator=(constA&rhs);intx;};A::A&A::operator=(constA&rhs){this->x=rhs.x;return*this;}intmain(int,char**){Aa1(5);Aa2(4);printf("a2.x==%d\n",a2.x);a2=a1;printf("a2.x==%d\n",a2.x);return0;}第11行,A的operator=()函数的定义所在,格式不正确......或者,至少,我相信是这样。正如预期的那样,

c++ - CRTP + 特征类 : "no type named..."

我尝试使用模板化类实现CRTP,但在使用以下示例代码时出现错误:#includetemplateclassTraits{public:typedeftypenameT::typetype;//'staticconstunsignedintm_const=T::m_const;staticconstunsignedintn_const=T::n_const;staticconstunsignedintsize_const=T::m_const*T::n_const;};templateclassCrtp{public:typedeftypenameTraits::typecrtp_typ

c++ - 为什么将数组作为 "int *& name"传递?

我得到了一个(C++)代码,其中使用数组传递voidfun(int*&name){...}但这背后的想法是什么?我猜它的意思是“一个引用数组”,但是当你只传递一个指向第一个元素的指针时就没问题了,不是吗?那么这样做的动机是什么? 最佳答案 该函数接收对指针的引用。这意味着该函数不仅可以修改name指向的int,还可以修改自身指针函数调用也将在外部可见。例子:#includeint*allocate(){returnnewint();}voiddestroy(int*&ptr){deleteptr;ptr=NULL;}intmain(

c++ - 获取错误 : 'mutex' in namespace 'std' does not name a type in MinGW mysys prompt

我已经从官方网站下载了MinGW并将其安装在我的Windows8.1机器上。运行g++--version给我g++.exe(GCC)4.8.1。我正在尝试在MinGW编译器中编译现有的代码库,但它因以下错误而失败:error:'mutex'innamespace'std'doesnotnameatypeprivate:std::mutexm_Mutex;^error:'condition_variable'innamespace's还有更多与锁定和线程相关的错误。!我能够在Cygwin-64中编译相同的代码库,没有任何问题。我需要在MinGW中成功构建和编译,以便创建一些与MSVS兼容

Flink(十五)【Flink SQL Connector、savepoint、CateLog、Table API】

前言    今天一天争取搞完最后这一部分,学完赶紧把Kafka和Flume学完,就要开始做实时数仓了。据说是应届生得把实时数仓搞个80%~90%才能差不多找个工作,太牛马了。1、常用Connector读写        之前我们已经用过了一些简单的内置连接器,比如'datagen'、'print',其它的可以查看官网:Overview|ApacheFlink环境准备:#1.先启动hadoopmyhadoopstart#2.不需要启动flink只启动yarn-session即可/opt/module/flink-1.17.0/bin/yarn-session.sh-d#3.启动flinksql的

c++ - 错误 : Expected template-name before '<' token

我正在尝试编译一个实现chain和chainNodes的程序并在以下行(第22行)出现错误:classchain:publiclinearList错误是:Error:expectedtemplate-namebefore'知道为什么会出现这种情况吗?我的代码如下://linkedimplementationofalinearlist//derivesfromabstractclasslinearListjusttomakesure//allmethodsoftheADTareimplemented#ifndefchain_#definechain_#include#include#in