Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is std::hardware_destructive_interference_size?

Tags:

c++

c++17

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!

like image 307
Zendel Avatar asked Jan 31 '20 13:01

Zendel


Video Answer


2 Answers

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
like image 174
aschepler Avatar answered Nov 15 '22 18:11

aschepler


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:

like image 23
eerorika Avatar answered Nov 15 '22 17:11

eerorika