草庐IT

scope-identity

全部标签

c++ - fcgio.cpp :50: error: 'EOF' was not declared in this scope

我正在尝试在LinuxUbuntu10.x机器上构建fastcgi。我运行以下命令:./配置制作我收到以下错误:fcgio.cpp:Indestructor'virtualfcgi_streambuf::~fcgi_streambuf()':fcgio.cpp:50:error:'EOF'wasnotdeclaredinthisscopefcgio.cpp:Inmemberfunction'virtualintfcgi_streambuf::overflow(int)':fcgio.cpp:70:error:'EOF'wasnotdeclaredinthisscopefcgio.cpp

c++ - "not declared in this scope"模板和继承错误

这个问题在这里已经有了答案:WhydoIhavetoaccesstemplatebaseclassmembersthroughthethispointer?(3个回答)accessingprotectedmembersofsuperclassinC++withtemplates[duplicate](2个回答)关闭8年前。这是重现我的问题的代码示例:templateclassBase{public:Base(){}virtual~Base(){}protected:intmyOption;virtualvoidset()=0;};templateclassChildClass:publ

c++ - 错误 : strcpy was not declared in this scope

我在Ubuntug++版本4.4.3中编译的c++问题中遇到了这个问题。我不知道要包含哪些标题来解决这个问题。谢谢centro_medico.cpp:Inconstructor‘Centro_medico::Centro_medico(char*,char*,int,int,float)’:centro_medico.cpp:5:error:‘strcpy’wasnotdeclaredinthisscopecentro_medico.cpp:13:warning:deprecatedconversionfromstringconstantto‘char*’centro_medico.c

c++ - g++ 错误 : ‘stricmp’ was not declared in this scope (but OK for 'strcmp' )

我正在尝试编译以下非常非常简单的源代码:#include//#include//usingnamespacestd;classHelper{public:intcStringsAreEqual(constchar*s1,constchar*s2){returnstricmp(s1,s2);}};...但我收到以下错误消息:g++error:‘stricmp’wasnotdeclaredinthisscope但是,当我使用strcmp()而不是stricmp()时,一切都很好!这里有什么问题?允许strcmp()的时候不应该允许stricmp()吗?Sureley,这一切都可以在不使用s

c++ - 错误 : 'INT32_MAX' was not declared in this scope

我收到了错误error:'INT32_MAX'wasnotdeclaredinthisscope但是我已经收录了#include我正在使用命令在(g++(GCC)4.1.220080704(RedHat4.1.2-44)上编译它g++-m64-O3blah.cpp我需要做任何其他事情来编译它吗?还是有另一种C++方法来获取常量“INT32_MAX”?谢谢,如果有什么不清楚的地方请告诉我! 最佳答案 引自手册页,“只有在包含__STDC_LIMIT_MACROS之前定义时,C++实现才应定义这些宏”。那就试试吧:#define__ST

c++ - shared_ptr 与 scoped_ptr

scoped_ptr不可复制,正在从范围中删除。所以它是一种受限的shared_ptr。因此,除了确实需要限制复制操作的情况外,shared_ptr似乎更好用。因为有时您不知道是否需要创建对象的拷贝。所以问题是:除了上面提到的情况,我们是否认为shared_ptr比scoped_ptr更好(或推荐)使用。scoped_ptr是否比shared_ptr工作得更快,或者它有什么优势?谢谢! 最佳答案 shared_ptr比scoped_ptr更重量级。它需要分配和释放一个引用计数对象以及托管对象,并处理线程安全的引用计数——在我工作的一

Eclipse IDE 中的 C++ 错误 'nullptr was not declared in this scope'

我正在运行EclipseHelios,并且安装了g++-4.6。希望g++4.6实现C++11特性我没有错。我创建了一个使用nullptr和auto关键字的C++项目。该构建给出以下错误:-../{filename}.cpp:13:13:error:‘nullptr’wasnotdeclaredinthisscope../{filename}.cpp:14:2:warning:‘auto’willchangemeaninginC++0x;pleaseremoveit[-Wc++0x-compat]实际上,直到昨天它还在build中。我今天不知从何而来。请帮我解决这个问题。

c++ - boost::scoped_ptr<T> 和 std::unique_ptr<T> 之间的区别

是boost::scoped_ptr之间的唯一区别和std::unique_ptr事实std::unique_ptr具有移动语义,而boost::scoped_ptr只是一个get/reset智能指针? 最佳答案 不,但这是最重要的区别。另一个主要区别是unique_ptr可以有一个析构函数对象,类似于shared_ptr能够。不像shared_ptr,析构函数类型是unique_ptr的一部分的类型(分配器是STL容器类型的一部分)。一个constunique_ptr可以有效地完成scoped_ptr的大部分工作可以做;确实,不像

javascript - Angular JS : What is the need of the directive’s link function when we already had directive’s controller with scope?

我需要对范围和模板执行一些操作。看来我可以在link函数或controller函数中做到这一点(因为两者都可以访问范围)。什么时候我必须使用link函数而不是Controller?angular.module('myApp').directive('abc',function($timeout){return{restrict:'EA',replace:true,transclude:true,scope:true,link:function(scope,elem,attr){/*linkfunction*/},controller:function($scope,$element){

ruby-on-rails - 请按语法排序 Mongoid Scope

我用的是最新的mongoid...我该如何做这个名为_scope的事件记录的mongoid等效项:classCommentincludeMongoid::DocumentincludeMongoid::Timestampsembedded_in:postfield:body,:type=>Stringnamed_scope:recent,:limit=>100,:order=>'created_atDESC'...end 最佳答案 必须这样定义scope:recent,order_by(:created_at=>:desc).lim