Using the Standard Library with C++ Interop

wolfiesnotfine aloysuiswolf at gmail.com
Fri Feb 5 21:04:00 UTC 2021


Hello, I'm currently working on a primarily C++ project but I 
wanted to leverage some of D's language features and library for 
a few parts. I'm using the betterC subset and here's the code 
snippet in D: https://run.dlang.io/is/XOXF06

It's quite a simple test, and the code just gets called from C++ 
and I review the stdout. What I've noticed is the print function 
works fine, however sse() from core.cpuid is incorrectly 
reporting as false. The function properly returns true if it's 
not called from C++ but instead a D main function. This makes me 
think it's related to the GC needing the main function to 
properly setup, however, I thought the betterC subset was 
supposed to negate this. While I wanted to make use of more than 
just cpuid/simd, this was one of the primary things I wanted to 
put into D code, at least for the moment. any suggestions?


More information about the Digitalmars-d-learn mailing list