From 3fd12f81c2b7afc028d7641709b610d9cbcb6e18 Mon Sep 17 00:00:00 2001 From: Michael Hordijk Date: Wed, 1 Jan 2025 15:04:31 -0500 Subject: [PATCH] Remove ad hoc constant from unit slot example (#371) When demonstrating that we can pass `Constant` to a unit slot, use the available builtin constant for the speed of light rather than creating an ad hoc constant. --- docs/discussion/idioms/unit-slots.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/docs/discussion/idioms/unit-slots.md b/docs/discussion/idioms/unit-slots.md index e37c122a..b24f905d 100644 --- a/docs/discussion/idioms/unit-slots.md +++ b/docs/discussion/idioms/unit-slots.md @@ -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!