Commit Graph
55 Commits
Author SHA1 Message Date
Mateusz Pusz 915ca82a0b refactor: __cpp_explicit_this_parameter implementation of number() added 2022-12-20 17:23:29 +01:00
Mateusz Pusz c51f6a9d29 refactor: RepresentationOf concept usage added + quantity concepts cleanup 2022-12-20 17:22:51 +01:00
Mateusz Pusz 7a26125e16 refactor: public headers cleanup
Public headers should be only the ones that a user may have a need to actually include in his/her code.
2022-12-19 14:55:54 +01:00
Mateusz Pusz 92c70f1a4e feat: quantity_spec support added 2022-12-16 18:15:48 +01:00
Mateusz Pusz 872caf460a refactor: quantity_cast refactored 2022-11-30 17:54:13 +01:00
Mateusz Pusz 5cbe322c82 feat: common_reference, common_dimension, and common_units now take variadic list of arguments 2022-11-30 10:11:52 +01:00
Mateusz Pusz eee6f7ed87 style: core code reformatted with clang-format-16 2022-11-10 16:46:56 -10:00
Mateusz Pusz 9ca15c3023 feat: operator[] added for quantity 2022-11-10 16:41:28 -10:00
Mateusz Pusz f2e63fdeb1 refactor: std::common_type usage replaced with dedicated functions for units, dimensions, and references 2022-11-09 18:39:51 -10:00
Mateusz Pusz 61b88b919f refactor: convertible() renamed to interconvertible() 2022-11-08 10:57:05 -10:00
Mateusz Pusz 3d1f339115 refactor: reference now takes NTTPs rather then types
Even though it makes error logs a bit more obscure it simplifies coding a lot.
2022-11-08 10:37:41 -10:00
Mateusz Pusz 4938e9d5c0 feat: Added support for natural units-like systems + dimension_one cleanup 2022-11-04 19:29:05 +01:00
Mateusz Pusz cb861dd81a feat: system's definition highly simplified by removing the need for a system_reference for most cases 2022-10-25 07:27:08 +02:00
Mateusz Pusz 9bfe75ebf6 feat: harmonic_ concept enabled 2022-10-22 21:05:14 +02:00
Mateusz Pusz 6e8ca72678 refactor: dimensions design cleanup 2022-10-18 17:52:52 +02:00
Mateusz Pusz cf0a770d9b refactor: quantity arithmetics implemented 2022-10-09 21:32:38 +01:00
Mateusz Pusz 4a49bdda05 refactor: V2 design update 2022-10-06 23:43:01 +01:00
Mateusz Pusz dac7f81a67 fix: harmonic_ concept fixed to properly account for pi-based magnitudes 2022-08-31 21:12:00 +02:00
Mateusz Pusz bb5c02e09e fix: Quantity inversion operation fixed
Resolves #367
2022-08-01 10:03:55 +02:00
Johel Ernesto Guerrero Peña e988e1d74e refactor: update hacks for LLVM 16 2022-07-29 17:17:07 -04:00
Chip Hogg ef9e6522ca Merge branch 'master' into chiphogg/switch-to-mag 2022-06-15 20:50:30 +00:00
Mateusz Pusz 842f2eaf27 feat: quantity CTAD guide added 2022-05-22 19:47:11 +02:00
Chip Hogg 5fb468697b Merge branch 'master' into chiphogg/switch-to-mag 2022-05-12 16:12:01 +00: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
Johel Ernesto Guerrero Peña 146f1d1c83 fix: improve downcast mode off 2022-03-28 10:58:02 -04:00
Mateusz PuszandJohel Ernesto Guerrero Peña 6531d188d1 Update src/core/include/units/quantity.h
Co-authored-by: Johel Ernesto Guerrero Peña <johelegp@gmail.com>
2022-03-18 08:20:43 +01:00
Mateusz PuszandJohel Ernesto Guerrero Peña f4fbac86b4 Update src/core/include/units/quantity.h
Co-authored-by: Johel Ernesto Guerrero Peña <johelegp@gmail.com>
2022-03-18 08:20:36 +01:00
Mateusz PuszandJohel Ernesto Guerrero Peña 03290d74a2 Update src/core/include/units/quantity.h
Co-authored-by: Johel Ernesto Guerrero Peña <johelegp@gmail.com>
2022-03-18 08:20:27 +01:00
Mateusz PuszandJohel Ernesto Guerrero Peña 6e59e7a927 Update src/core/include/units/quantity.h
Co-authored-by: Johel Ernesto Guerrero Peña <johelegp@gmail.com>
2022-03-18 08:20:08 +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 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 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
Johel Ernesto Guerrero Peña 417f842585 fix: constraint recursion for GCC 11 2021-09-17 20:11:38 +02:00
Mateusz Pusz ed5749a52b refactor: quantity op+() and op-() reimplemented in terms of reference rather then quantity types
`common_quantity`, `common_quantity_for`, `common_quantity_point`, `common_quantity_kind`, and `common_quantity_point_kind` removed

Resolves #290
2021-07-27 14:40:05 +02:00
Ralph J. Steinhagen 7ed29807a6 removed superfluous requires statement in is_quantity<T> 2021-06-29 20:31:06 +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 8540389530 fix: op% fixed for the same argument types case 2021-05-11 19:36:07 +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 e39ef2f850 fix: reference redefined in terms of dimension and unit 2021-04-09 12:52:15 +02:00
Mateusz Pusz 309da80c32 refactor: unit_text.h header include moved to text-related targets 2021-03-31 12:25:26 +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 ca7762177f refactor: quantity::value_ renamed to quantity::number_
Refers to #259
2021-03-19 07:01:12 +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 ddbbb8ac55 style: remove braces from value 2021-03-18 22:37:25 +01:00
Johel Ernesto Guerrero Peña ced4b3bbed refactor: make reference's interface hidden friends
Addresses:
- https://github.com/mpusz/units/pull/261#discussion_r597135187
- https://github.com/mpusz/units/pull/261#discussion_r597152408
2021-03-18 22:37:25 +01:00
Johel Ernesto Guerrero Peña 234337d310 refactor: use perfect forwarding for make functions
Addresses https://github.com/mpusz/units/pull/261#discussion_r597131272.
2021-03-18 22:37:25 +01:00