11

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!

NutCracker
  • 11,485
  • 4
  • 44
  • 68
Zendel
  • 485
  • 3
  • 14
  • 1
    gcc may not simply have implemented that symbol yet. That's the obvious answer. This is C++17, and this is not the only part of C++17 that's not yet implemented. I'm patiently waiting for to/from_chars overloads for floating point types... – Sam Varshavchik Jan 31 '20 at 13:34
  • These constants can cause serious ABI issues, so it isn't surprising that they haven't been implemented. – T.C. Jan 31 '20 at 17:49

2 Answers2

7

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
aschepler
  • 70,891
  • 9
  • 107
  • 161
2

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:

eerorika
  • 232,697
  • 12
  • 197
  • 326