Skip to content

Commit

Permalink
Merge branch 'main' into hoffbrinkle/ad_hoc_constant_limitations
Browse files Browse the repository at this point in the history
  • Loading branch information
chiphogg authored Jan 1, 2025
2 parents 0be73c7 + 3fd12f8 commit 4272391
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions docs/discussion/idioms/unit-slots.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,8 @@ those too! Key examples include [unit symbols](../../reference/unit.md#symbols)
Suppose we have the following preamble, simply to set everything up.

```cpp
struct SpeedOfLight : decltype(Meters{} / Seconds{} * mag<299'792'458>()) {
static constexpr const char label[] = "c";
};
constexpr const char SpeedOfLight::label[];
constexpr auto c = make_constant(SpeedOfLight{});
// Found in `"au/constants/speed_of_light.hh"`:
constexpr auto c = SPEED_OF_LIGHT;

// These using declarations should be in a `.cc` file, not `.hh`,
// to avoid namespace pollution!
Expand Down

0 comments on commit 4272391

Please sign in to comment.