I found some code which is meant to call __uuidof(IMyInterface)
but actually calls __uuidof(pIMyInterface)
where pIMyInterface
is a pointer of type IMyInterface
. How does __uuidof
behave when called on a value rather than a type?
e.g. int x=123; __uuidof(x)
is this equivalent to __uuidof(int)
or __uuidof(123)
__uuid
is a keyword, not a function. It is not "called", it is directly parsed by the compiler. Which of course has no trouble recognizing that the operand is a variable. And it knows the type of the variable so has no trouble looking up the __declspec(uuid)
attribute for the type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With