Skip to content

explicit type of derived_unit leads to compilation error #711

Closed

Description

@mathisloge

Following the tutorial in https://mpusz.github.io/mp-units/latest/users_guide/framework_basics/design_overview/?h=derived_unit#unit leads to an compilation error.
https://godbolt.org/z/fbcYG1n4E

How do you currently define a derived value type?

Activity

  1. mpusz commented on Aug 2, 2025

    @mpusz
    Owner

    Users should never instantiate derived_XXX types by themselves. Just use regular arithmetic. For example:

    constexpr auto x = mp_units::si::metre / mp_units::per<mp_units::si::second>;

    A similar example can be found in https://mpusz.github.io/mp-units/latest/getting_started/quick_start/#__tabbed_5_3 of our docs.

  2. Repository owner locked and limited conversation to collaborators on Aug 2, 2025
  3. converted this issue into a discussion #712 on Aug 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions