Re:A categorized list of all Java and JVM features since JDK...
by DaiPlusPlus on Monday April 05, 2021 @10:49PM
(#26707461)
The /clr:pure option was removed in VisualC++ 2017 - it was last available in 2015.
Re:A categorized list of all Java and JVM features since JDK...
by int_19h on Thursday April 08, 2021 @02:51AM
(#26735852)
It was deprecated and will be removed eventually, but for now, it's still working fine.
Anyway, the point is that it's possible within CLR constraints. There's just not much demand for it, and it's effectively a whole separate CPU arch for the compiler to support, in addition to x86/x64/ARM.
If you want to see it for yourself, take some .cpp file, and compile it with cl.exe /clr:pure /O2 /FAs. The latter switch will dump the IL assembly into the corresponding .asm file. Or you can inspect the output with ILSpy etc. You'll see that it compiles native C++ types down to CLR structs with no fields, but with explicitly set size (via StructLayout.Explicit); and then uses pointer arithmetic to access field values.