草庐IT

deleter_type

全部标签

c++ - 我们能否在运行时确定两个 type_info 是否可转换?

有没有办法从两个const::std::type_info中判断对象,让我们将它们命名为B和D如果D描述的类型是从类型B派生的?我问是因为我想删除我得到的对象的类型,但稍后能够检查它是否可以安全地提升。void*data;const::std::type_info*D;templatevoidstore(D&&object){D=&typeid(object);data=::std::addressof(object);}templateB&load(){//if(typeid(B)!=(*D))throw::std::bad_cast{};return*reinterpret_cas

c++ - 错误 : incomplete type when using HMAC_CTX in C++ project

我正在尝试编译这个库ndn-cxx在我的笔记本电脑里。我已经在另一台计算机上尝试过并且编译成功但现在我收到此错误并且我认为它与openssl相关。我使用sudoapt-cachesearchlibssl|确认我的笔记本电脑中有openssl|grepSSL结果是:libssl-ocaml-OpenSSL的OCaml绑定(bind)(运行时)libssl-ocaml-dev-OpenSSL的OCaml绑定(bind)libssl0.9.8-SSL共享库libsslcommon2-企业消息传递系统-通用SSL库libsslcommon2-dev-企业消息系统-通用SSL开发文件我在尝试编译

c++ - 使用 protected 非虚拟析构函数时抑制 delete-non-virtual-dtor 警告

我有一个纯抽象接口(interface)类和一个实现该接口(interface)的派生类。structFoo{virtualvoiddoStuff()=0;};structBar:Foo{voiddoStuff()override{}};我的接口(interface)类没有虚拟析构函数。因此,尝试使用基类指针破坏派生实例显然是未定义的行为intmain(){Foo*f=newBar;f->doStuff();deletef;}幸运的是我的编译器足够聪明,可以捕捉到这个(使用-Werror)main.cc:15:9:error:deletingobjectofabstractclasst

Invalid value type for attribute ‘factoryBeanObjectType‘: java.lang.String

ErrorstartingApplicationContext.Todisplaytheconditionevaluationreportre-runyourapplicationwith'debug'enabled.2024-01-05T17:04:00.527+08:00ERROR201118---[solve][main]o.s.boot.SpringApplication:Applicationrunfailedjava.lang.IllegalArgumentException:Invalidvaluetypeforattribute'factoryBeanObjectType':j

c++ - 继承类中的 shared_from_this() 类型错误(是否有 dyn.type-aware 共享指针?)

我有一个使用enable_shared_from_this的ViewController基类classViewController:publicstd::enable_shared_from_this{//...};和一个child:classGalleryViewController:publicViewController{voidupdateGallery(floatdelta);}问题出现了,当我尝试将我当前的实例传递给第3方时(比如lambda函数被安排在某处)实例(GalleryViewController)会释放一个(罕见的)条件,所以我不能直接捕获“this”,我需要用

Bean named ‘ddlApplicationRunner‘ is expected to be of type ‘org.springframework.boot. Runner‘ 。。。

springboot整合mybatisplus时遇见报错错误信息:Beannamed'ddlApplicationRunner'isexpectedtobeoftype'org.springframework.boot.Runner'butwasactuallyoftype'org.springframework.beans.factory.support.NullBean'atorg.springframework.beans.factory.support.AbstractBeanFactory.adaptBeanInstance(AbstractBeanFactory.java:410)

c++ - 无法识别的类型 - 'Error: Variable "[var-name ]"is not a type name'

作为项目的一部分,我正在创建一个处理物理的类。我们被告知要使用一个处理任意行为的类。我创建了一个类,它将根据提供给它的模块更新内部状态(代码如下)。但是,表示内部状态的结构PhysicsData除了它自己的文件外,在任何地方都无法识别。任何人都可以解释一下吗?(对于大量信息的转储,我们深表歉意,但是问题所在的对象和问题所在的位置之间的差距非常大,减少额外的细节也会删除可能有用的上下文)这里是有问题的结构:#pragmaonce//Thisfile"PhysicsBehaviourBase.h"#include#includestructPhysicsData{public:D3DXVE

c++ - 为什么我得到 "recursive type or function dependency context too complex"?

为什么此代码在VisualC++中会产生以下错误?是编译器的错误还是代码无效?templateinttest(int=sizeof(test()));templateinttest(int);intmain(){returnsizeof(test());}Recursivetypeorfunctiondependencycontexttoocomplex 最佳答案 test在您使用它时尚未声明。C++11中经常出现类似的问题:templateautotest()->decltype(test());templateautotest(

c++ - 如何在编译器级别实现 `delete[] obj` 和 `delete obj`

这个问题在这里已经有了答案:关闭9年前。PossibleDuplicate:Why[]isusedindelete(delete[])tofreedynamicallyallocatedarray?WhydoesC++stillhaveadelete[]ANDadeleteoperator?我想知道它们有什么区别,我知道一些人可能会说的明显答案,一个是删除一个数组,另一个是删除一个对象,但我想知道为什么要有两种不同的删除方法这两个操作?我的意思是delete基本上是使用Cfree方法实现的,它不关心指针实际上是指向数组还是指向单个对象。我能想到的唯一原因是两个能够知道它是否是一个数组并

解决SpringBoot启动失败:A component required a bean of type ‘xxxxxxx‘ that could not be found.

问题描述今天写了一个MD5加密加盐工具类,运用到实际业务代码中缺报错了,内容如下:***************************APPLICATIONFAILEDTOSTART***************************Description:Acomponentrequiredabeanoftype'com.wyh.util.SaltMD5Util'thatcouldnotbefound.Action:Considerdefiningabeanoftype'com.wyh.util.SaltMD5Util'inyourconfiguration.分析问题根据错误日志不难发现