Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add machinery for built-in constants, such as c #335

Merged
merged 2 commits into from
Dec 2, 2024

Commits on Dec 2, 2024

  1. Add machinery for built-in constants, such as c

    For Au's built-in constants, we follow the exact same policies as for
    units, including:
    
    - A new include folder, `"au/constants/..."`
    - A new target, `"//au:constants"`, which globs headers from that folder
    - Corresponding unit tests
    - Inclusion in the single-file script by individual names
    - An `--all-constants` option for the single-file script
    
    We _don't_ provide `_fwd.hh` files, because there's nothing we could
    really forward declare.
    
    Constant objects are defined with spelled-out names in `ALL_CAPS`
    format.  The corresponding file is the snake-case version.  This keeps
    the constant itself unambiguous.  We expect end users to actually use
    them in the following manner:
    
    ```cpp
    constexpr auto c = au::SPEED_OF_LIGHT;
    ```
    
    Finally, we now mention new constants in the release notes.
    
    Helps #90.  Remaining work includes adding more constants, and adding
    documentation.
    chiphogg committed Dec 2, 2024
    Configuration menu
    Copy the full SHA
    f9e826e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    69f1dae View commit details
    Browse the repository at this point in the history