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?
static_cast, I bet. Can you share it?error: non-const static data member must be initialized out of line(clang++)reinterpret_cast?intptr_tleads to a better solution.