简体   繁体   中英

Where is std::hardware_destructive_interference_size?

It looks like std::hardware_destructive_interference_size isn't defined in libc++ or libstdc++. I've grepped my local installations. I've looked in the respective svn repositories.

They're supposed to be in the <new> header, see: cppreference.com

I'd expect people to be asking where these constants are, but apparently nobody else seems to be missing them.

What am I missing? Where are they!

Neither library has implemented this feature. This is documented on their C++17 compliance status lists:

https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.2017

http://libcxx.llvm.org/cxx1z_status.html

(On each, search for 'P0154R1'.)

You may be able to detect whether the feature is available via

#if __cpp_lib_hardware_interference_size >= 201603

According to the documentation , GCC has not yet implemented this feature.

Feature      | Proposal | Status | SD-6 Feature Test
constexpr... | P0154R1  | No     | __cpp_lib_hardware_interference_size >= 201603

Same for libc++ documentation :

Paper   | Group | Paper Name   | Meeting      | Status | First released version
P0154R1 | LWG   | constexpr... | Jacksonville | -      | -

The support for C++17 of both implementations is still incomplete:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM