I just can't find out how this simple example can be compiled in C++ :
class C
{
public:
static const void* noop = static_cast<const void*> (0x1);
};
Because of the static
storage constraint I want, the only cast possible here would be static_cast
but it is incompatible with this int-to-ptr cast.
error: invalid static_cast from type ‘int’ to type ‘const void*’
How can an integer value be statically casted to a pointer type?