Commit Graph

28 Commits

Author SHA1 Message Date
Mateusz Pusz
6458cd343c ci: pre-commit related changes 2023-05-26 17:05:33 +02:00
Mateusz Pusz
4938e9d5c0 feat: Added support for natural units-like systems + dimension_one cleanup 2022-11-04 19:29:05 +01:00
Chip Hogg
ea83af8aa9 Rename as_magnitude<...>() to mag<...>()
This is easier to write and to read.
2022-07-29 01:46:06 +00:00
Mateusz Pusz
9a6d6f9d2a fix: MSVC conversion issues fixed 2022-06-09 13:50:01 +02:00
Chip Hogg
5fb468697b Merge branch 'master' into chiphogg/switch-to-mag 2022-05-12 16:12:01 +00:00
Mateusz Pusz
4c60447a28 Merge branch 'master' into downcast_mode_off 2022-05-09 19:12:02 +02:00
Chip Hogg
d19b2803ce Migrate units from ratio to Magnitude
This commit is huge, but hopefully the cognitive load is not too bad.
The bulk of this commit is just some fairly mechanical updates from
`ratio` to `Magnitude`.  Other things to call out:

- `UnitRatio` goes away.  We don't need this concept, because Magnitude
  can't even _represent_ anything that doesn't satisfy it.

- I commented out some formatting test cases where the precise
  expression changes, but the number is completely equivalent.  We will
  need to decide how we want to handle Magnitude formatting as a
  separate, follow-on task.  But at least Magnitude gives us all the
  tools we'll need to do so!
2022-04-11 15:16:16 +00:00
Mateusz Pusz
b221dace3f style: clang-format applied to the remaining files 2022-04-02 21:36:42 +02:00
Johel Ernesto Guerrero Peña
146f1d1c83 fix: improve downcast mode off 2022-03-28 10:58:02 -04:00
Mateusz Pusz
6d82ddebbc Update test/unit_test/static/quantity_kind_test.cpp
Co-authored-by: Johel Ernesto Guerrero Peña <johelegp@gmail.com>
2022-03-18 08:21:15 +01:00
Mateusz Pusz
144f6951c0 style: all files refromatted with clang-format 2022-03-17 23:59:48 +01:00
Johel Ernesto Guerrero Peña
80eefec97c fix: add quantity_point::origin, like std::chrono::time_point::clock 2021-06-29 20:44:27 +02:00
Mateusz Pusz
1783d243da fix: quantity modulo arithmetics fixed
Resolves #231
2021-05-11 15:03:04 +02:00
Mateusz Pusz
7ead50acfc refactor: derived_kind template parameters reordered to be compatible with a derived_unit
Resolves #229
2021-05-10 16:45:38 +02:00
Mateusz Pusz
6d39459cbc perf: rvalue references support added for constructors and getters
Resolves #275
2021-05-03 19:44:50 +02:00
Mateusz Pusz
37cfc53d1d refactor: IWYU applied to the source files
`alternative_namespaces` examples left out as I consider them a subject for removal in the nearest future.
2021-03-30 13:21:05 +02:00
Mateusz Pusz
88e642ec74 refactor: QuantityValue concept renamed to Representation 2021-03-19 07:53:18 +01:00
Mateusz Pusz
901b09fd52 refactor: quantity::count() renamed to quantity::number()
Resolves #259
2021-03-19 06:47:37 +01:00
Johel Ernesto Guerrero Peña
f0cfc14b83 refactor: remove operator/(Rep, reference)
Addresses https://github.com/mpusz/units/pull/261#discussion_r597289047.
2021-03-19 06:31:12 +01:00
Johel Ernesto Guerrero Peña
0b87e7c99c refactor!: require explicit number for references
Addresses:
- https://github.com/mpusz/units/pull/261#discussion_r596651065
- https://github.com/mpusz/units/pull/261#discussion_r596664550
- https://github.com/mpusz/units/pull/261#discussion_r597132294
2021-03-18 22:37:25 +01:00
Johel Ernesto Guerrero Peña
018c5837f9 refactor: rename unit_constants to references
Addresses https://github.com/mpusz/units/pull/261#discussion_r596663522.
2021-03-18 22:37:25 +01:00
Johel Ernesto Guerrero Peña
9a520edfe9 refactor!: replace one_rep with reference<D, U> 2021-03-18 22:37:25 +01:00
Mateusz Pusz
bbbb77286c refactor: physical replaced with isq
Refers to #249
2021-03-16 12:03:25 +01:00
Mateusz Pusz
23720d055e refactor: Refactored the library file tree
Resolves #249
2021-03-16 09:32:28 +01:00
Mateusz Pusz
5c94a40906 build: COMP_XXX renamed to UNITS_COMP_XXX 2021-03-15 21:13:21 +01:00
Johel Ernesto Guerrero Peña
017183653d feat: full-on dimensional analysis between related quantity kinds 2021-02-21 00:17:03 +01:00
Johel Ernesto Guerrero Peña
00d182e133 fix: operators to behave like the underlying type's 2021-02-16 19:25:13 +01:00
Johel Ernesto Guerrero Peña
6bf09aa646 feat: quantity_kind and quantity_point_kind 2021-02-15 19:31:08 +01:00