|
On 26 Jun 2006, at 09:33, Andreas Stenius wrote:
Julien Cugnière skrev:Anyway, here is a simple way to ensure that your constants are unique (assuming this legal C): static const void* regkey1 = ®key1; static const void* regkey2 = ®key2;No, ®key1 is not a constant expression, although the result is constant.
Doesn't matter. In C it's legal (though probably stupid) to take a pointer to a const object and convert it to a pointer to a non-const object. No idea about C++. Just one of the many ways in which const is broken and surprises programmers.
drj