欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 文旅 > 游戏 > 日报240624:禁用chromium里的[chromium-rawptr] 报错

日报240624:禁用chromium里的[chromium-rawptr] 报错

2024/10/25 12:40:36 来源:https://blog.csdn.net/weolar/article/details/139939643  浏览:    关键词:日报240624:禁用chromium里的[chromium-rawptr] 报错

* RAW_PTR_EXCLUSION 可以禁用error : [chromium-rawptr] Use raw_ptr<T> instead of a raw pointer.

加在字段前面就行,,比如

class MyClass {

public:

// Error expected.

SomeClass* raw_ptr_field1;

// No error expected. Fields can be excluded due to performance reasons.

RAW_PTR_EXCLUSION SomeClass* ignored_ptr_field1;

// Error expected.

SomeClass* raw_ptr_field2;

// No error expected. Fields can be excluded due to performance reasons.

RAW_PTR_EXCLUSION SomeClass* ignored_ptr_field2;

// Error expected.

SomeClass& raw_ref_field1;

// No error expected. Fields can be excluded due to performance reasons.

RAW_PTR_EXCLUSION SomeClass& ignored_ref_field1;

// Error expected.

SomeClass& raw_ref_field2;

// No error expected. Fields can be excluded due to performance reasons.

RAW_PTR_EXCLUSION SomeClass& ignored_ref_field2;

// Error expected.

base::span<SomeClass> span_field;

// No error expected. Fields can be excluded due to performance reasons.

RAW_PTR_EXCLUSION base::span<SomeClass> ignored_span_field;

};

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com