In V8.h of Google V8 Javascript engine, there is a piece of code to check if two types match at compiling stage. I can understand large part of it, but can't comprehend the syntax of static_cast<T* volatile*>
, what does it mean by adding unusual volatile* and why is it needed?
#define TYPE_CHECK(T, S) \
while (false) { \
*(static_cast<T* volatile*>(0)) = static_cast<S*>(0); \
}
I noted same code has been discussed in this topic below, but not in detail of the question I am asking. How does the following code work?