Mention C++14 baseline in contributing documentation

This commit is contained in:
Martin Hořeňovský 2021-08-19 19:16:12 +02:00
parent 4113a12c69
commit ca8546efc6
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A
1 changed files with 18 additions and 0 deletions

View File

@ -190,6 +190,24 @@ If want to contribute code, this section contains some simple rules
and tips on things like code formatting, code constructions to avoid,
and so on.
### C++ standard version
Catch2 currently targets C++14 as the minimum supported C++ version.
Features from higher language versions should be used only sparingly,
when the benefits from using them outweight the maintenance overhead.
Example of good use of polyfilling features is our use of `conjunction`,
where if available we use `std::conjunction` and otherwise provide our
own implementation. The reason it is good is that the surface area for
maintenance is quite small, and `std::conjunction` can directly use
compiler built-ins, thus providing significant compilation benefits.
Example of bad use of polyfilling features would be to keep around two
sets of metaprogramming in the stringification implementation, once
using C++14 compliant TMP and once using C++17's `if constexpr`. While
the C++17 would provide significant compilation speedups, the maintenance
cost would be too high.
### Formatting