我只是碰到在GCC以下警告跑:
warning: implicit dereference will not access object of type ‘volatile util::Yield’ in statement [enabled by default]
在编译的代码:
volatile util::Yield y1;
util::Yield y2;
y1 += y2; // <--- Warning triggered here.
可惜我不太明白什么GCC是想告诉我...
类产量声明如下:
class Yield {
public:
Yield();
Yield &operator+=(Yield const &other);
Yield &operator+=(Yield const volatile &other);
Yield volatile &operator+=(Yield const &other) volatile;
Yield volatile &operator+=(Yield const volatile &other) volatile;
// Other operators snipped...
};
有任何想法吗?
谢谢!