C++如何将其作为构造函数内的易失性指针
C++ how to make this as a volatile pointer inside constructor
我知道我可以在成员函数声明的末尾添加volatile关键字,使该指针变为volatile,但如何在构造函数中做到这一点?
class A {
void method() volatile; // inside method this is volatile pointer.
A() {;} // How to make this as volatile pointer here.
}
感谢
将this
标记为volatile没有任何意义,因为this
指针的值对于任何给定对象都是恒定的,在任何情况下都不能更改。
相关文章:
- 易失性sig_atomic_t的内存安全性
- C++易失性:保证 32 位访问?
- 避免易失性和非易失性成员函数的代码重复
- 当 2 个线程共享同一物理内核时,具有错误共享的易失性增量在发布中的运行速度比在调试中慢
- C++:易失性实例中的易失性成员函数 - 将数组分配给指针是无效的转换?
- g++ 6.3,avx 内联函数上的 Kahan 求和用易失性关键字进行序列化
- 优化易失性堆栈变量的存储/构造是否合法
- std::remove_pointer 无法删除 VS2012 上的常量易失性函数指针
- 为什么参数修饰符(即'const'或"易失性")不被视为函数类型或签名的一部分?
- 成员函数无法访问易失性成员
- 如何用libclang找出成员函数是常量还是易失性
- C++中易失性成员函数与常量成员函数的比较
- 函数没有易失性。如何解决?
- C++如何将其作为构造函数内的易失性指针
- 易失性关键字在C++中成员函数声明中的位置
- 什么是易失性复制构造函数
- 易失性成员函数 (C++)
- 为什么易失性对象不能调用非易失性成员函数
- 你能从易失性函数中抛弃成员上的易失性吗>
- 易失性指针指向函数,在没有 typedef 的情况下使用时显示编译错误;需要帮助"void (* volatile userFunc)(void)"