Commit Graph

6 Commits

Author SHA1 Message Date
Wyatt Hepler
c66851d9ee pw_polyfill: Remove two language feature polyfills
This change avoids polyfilling the constinit and constexpr keywords,
which requires implicit polyfilling. Instead, this introduces a macro
that is straightforward to use and portable.

- Remove consteval and constinit language feature polyfills.
- Provide PW_CONSTINIT macro that uses the constinit keyword or compiler
  attributes to guarantee constant initialization.
- Update PW_CONSTEVAL so it always marks functions constexpr.

Change-Id: I8b582b69a54717017bd30d4a33ae148f3a754095
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/50360
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
2021-06-22 22:51:39 +00:00
Wyatt Hepler
f9fb90f299 docs: Make labels consistent; remove boilerplate
- Update labels so they use consistent naming. Instead of the
  copy-and-pasted `chapter` prefix, name labels with a prefix consistent
  with what they point to:
  - "module-" for module
  - "target-" for targets
  - "docs-" for general documentation
- Remove the unnecessary highlight and default-domain directives.
  Neither is necessary since the Pigweed docs always specify the
  language in code snippets and other directives.

Change-Id: I55c34e9ec919f6f4670e5d3d008e0edf5fecf05b
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19328
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2020-10-01 21:47:35 +00:00
Wyatt Hepler
ecf19233d3 pw_polyfill: Support std::endian from <bit>
- Implement std::endian from <bit> (__cpp_lib_endian).
- Replace pw::ByteOrder with std::endian.
- Update the <span> header to use the same approach as <bit> and define
  the appropriate std::span feature macro.

Change-Id: I5575bde6efbabf71bac66d7f4dc2c2c136ae156f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/17463
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2020-09-09 18:23:05 +00:00
Wyatt Hepler
8e59f4d185 pw_polyfill: std::integer_sequence, std::to_array
- Implement std::integer_sequence for C++11.
- Implement C++20's std::to_array.
- Define feature test macros when the features are defined.

Change-Id: Idd7f34496fe6fe273c3ecd2a9458a62416e38eb2
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/16961
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-08-31 14:39:03 +00:00
Armando Montanez
0054a9be70 Docs: Add missing RST docs
Adds dcos.rst files for all modules lacking documentation.

Change-Id: Ief5594831d31fcb876381a4a3886382fab7d595e
2020-03-17 00:13:35 +00:00
Wyatt Hepler
c542a5d6f7 pw_polyfill: Backports for C++11 and C++14
- The pw_polyfill module brings some C++17 features to C++11 and C++14.
- The module's overrides are added to the GN build to seamlessly
  support older C++ standards.

Change-Id: Icb29772073e681e1ef868561bdde56e629e9c0d9
2020-01-17 09:04:49 -08:00