为什么在C ++ 20中不推荐使用volatile? [英] Why is volatile deprecated in C++20?

查看:141
本文介绍了为什么在C ++ 20中不推荐使用volatile?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据 cppreference volatile 关键字将在C ++ 20中弃用。 volatile 的缺点是什么?当不使用 volatile 时,替代解决方案是什么?

According to cppreference, most uses of the volatile keyword are to be deprecated in C++20. What is the disadvantage of volatile? And what is the alternative solution when not using volatile?

推荐答案

c ++委员会语言发展主席的精彩演讲。

摘要, volatile 被删除的许多地方没有任何可理解的含义,只会造成混乱。

Brief summary, many of the places that volatile is being removed from didn't have any understandable meaning and just caused confusion.

这篇关于为什么在C ++ 20中不推荐使用volatile?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆