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
feb1a0b860
test(static): simplify quotient_remainder_theorem test cases
2022-03-21 14:29:50 -04:00
Johel Ernesto Guerrero Peña
3f145a25db
refactor: update hacks for LLVM 15
2022-02-07 21:07:22 -04:00
Johel Ernesto Guerrero Peña
4efed3c6d4
refactor: update Clang 14 to not require range-v3 ( #321 )
...
* Revert "refactor: update hacks for LLVM 14"
This reverts commit d142844de7 .
* refactor: update Clang 14 to not require range-v3
2021-12-13 10:01:16 +01:00
Mateusz Pusz
ca3d111579
fix: CTAD test disabled for most of the compilers
2021-10-20 20:18:15 +02:00
Mateusz Pusz
240ec3a460
build: CTAD for quantity is not supported by clang
2021-10-20 19:58:31 +02:00
Mateusz Pusz
b7b8a0bf93
fix: CTAD for aliases fixed
2021-10-20 18:52:13 +02:00
Mateusz Pusz
120d863c40
test: derived_quantity-related compilation error fixed
2021-09-09 09:26:23 +02:00
Ralph J. Steinhagen
322cde70b9
added HEP specific units and definitions
...
in accordance with https://www.bipm.org/documents/20126/41483022/SI-Brochure-9.pdf#page=147
see also disccusion thread #292
2021-08-03 10:56:47 +02:00
Ralph J. Steinhagen
8e1539bf22
added inheritance unit-test and made is_quantity<T> more specific
2021-06-29 20:31:06 +02:00
Mateusz Pusz
1783d243da
fix: quantity modulo arithmetics fixed
...
Resolves #231
2021-05-11 15:03:04 +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
901b09fd52
refactor: quantity::count() renamed to quantity::number()
...
Resolves #259
2021-03-19 06:47:37 +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
94eb477f02
refactor: apply comments
2021-03-15 15:19:50 +01:00
Johel Ernesto Guerrero Peña
3002c5673d
test: compile quantity_test.cpp with -DUNITS_DOWNCAST_MODE=0
2021-03-15 14:24:26 +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
Johel Ernesto Guerrero Peña
a168f49b66
fix: lack of compound assignment from dimensionless<one>
2021-02-15 17:07:55 +01:00
Johel Ernesto Guerrero Peña
98c15a2356
fix: quantity_cast between different, equivalent dimensions
2021-01-18 21:27:16 +01:00
Mateusz Pusz
ba37c37abd
fix: MSVC compilation fixed
2021-01-06 19:06:09 +01:00
Mateusz Pusz
f4ff02f8e5
fix: quantity's compound operators fixed to behave like ints do
2021-01-06 16:44:32 +01:00
Mateusz Pusz
6d7cda949e
fix: quantity_cast now correctly casts to an alias_unit
2021-01-02 10:56:50 +01:00
Mateusz Pusz
3d081d37e6
perf: std::is_same_v replaced with units::is_same_v
2020-12-28 18:42:03 +01:00
Mateusz Pusz
b015c6badd
test: Test disabled for GCC 10.1.0
2020-12-27 12:10:03 +01:00
Mateusz Pusz
cfc90f4aac
refactor: 💥 basic_concepts, quantity and quantity_cast refactored
...
BREAKING CHANGE: ScalableNumber renamed to QuantityValue
Resolves #107
2020-10-06 18:17:52 +02:00
Mateusz Pusz
c6a5d9e222
fix: broken requires expressions fixed
2020-09-23 16:38:40 +02:00
Mateusz Pusz
a098f97c08
feat: CTAD for dimensionless quantity added
2020-09-23 16:34:13 +02:00
Mateusz Pusz
d4d23847d8
refactor: DOWNCAST_MODE renamed to UNITS_DOWNCAST_MODE
2020-09-13 18:45:46 +02:00
Mateusz Pusz
2a56438f1c
refactor: file tree with systems defninitions refactored to limit ODR issues
...
Relates to #32 as with this commit we created something like modules for derived quantities
2020-09-11 18:11:25 +02:00
Mateusz Pusz
79558a6d72
refactor: systems defined in terms of SI moved under si namespace
2020-09-10 17:14:33 +02:00
Mateusz Pusz
9cd0cb4105
feat: two argument explicit cast support added
2020-09-10 13:01:38 +02:00
Mateusz Pusz
58daacfd58
fix: unit tests fixed for DOWNCAST_MODE = OFF
2020-09-10 11:33:58 +02:00
Mateusz Pusz
c4aa67477c
test: new dimensionless tests refactored to work with downcasting=OFF
2020-09-10 00:35:25 +02:00
Mateusz Pusz
e367afed71
Merge branch 'downcasting_2.0'
2020-09-09 20:31:03 +02:00
Mateusz Pusz
9527b39005
refactor: 💥 q_* UDL renamed to _q_*
...
We had some fun exploring the STD UDLs for potential collisions,
we have learnt our lesson and know how to proceed.
Now is high time to start behaving and obeying C++ rules.
2020-09-09 19:20:35 +02:00
Mateusz Pusz
2b408f19c0
Merge branch 'master' of github.com:mpusz/units
2020-09-09 11:22:58 +02:00
Mateusz Pusz
3e9d5ca189
refactor: ♻️ unitless renamed to one
...
Resolves #27
2020-09-09 11:20:55 +02:00
Johel Ernesto Guerrero Peña
749684c8ee
style: fix name numbering
2020-09-09 08:53:53 +02:00
Johel Ernesto Guerrero Peña
ce583d40e0
style: name parameter after what's being tested
2020-09-09 08:53:53 +02:00
Johel Ernesto Guerrero Peña
2853a20c7f
style: remove empty parameter list
2020-09-09 08:53:53 +02:00
Johel Ernesto Guerrero Peña
9a130d9b5b
test: percent to unitless conversion
2020-09-09 08:53:53 +02:00