[Dune-devel] C++17: feature macros and exit status of tests that require C++17

Ansgar Burchardt Ansgar.Burchardt at tu-dresden.de
Mon May 15 17:16:28 CEST 2017


Hi,

I played around with new C++17 features some time ago.  One nice
feature for me is the class template deduction for which I would like
to eventually include optional support in the core modules, that is
provide user-defined deduction guides in a few places.

How should such optional support be guarded?  As a lazy person I just
used

  #if __cplusplus >= 201402L
  // optional support for c++17
  #endif

so far.  Sadly the proposal for feature test macros[1] doesn't seem to
have been adopted, at least I couldn't find a newer version of it.

  [1] https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations

For test programs including only tests for this optional C++17 support,
I would just exit with status 77 (skipped) in case C++17 is not
supported by the compiler.

Ansgar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6519 bytes
Desc: not available
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20170515/5f37057d/attachment.bin>


More information about the Dune-devel mailing list