Commit Graph

4010 Commits

Author SHA1 Message Date
Mateusz Pusz
e15205e47c refactor: point_origin_interface::op+ return type unified with the rest of the interfaces 2025-01-09 14:01:39 +01:00
Mateusz Pusz
7ed5707e31 refactor: make_quantity_point introduced 2025-01-09 13:46:42 +01:00
Mateusz Pusz
2d10a30d27 fix: compile-time branch condition fixed in quantity_point::point_for 2025-01-09 13:44:21 +01:00
Mateusz Pusz
db18eec823 Merge pull request #663 from FrancoisCarouge/fix-quantity-spec-missing-lint-end
fix: `quantity_spec` missing lint block end
2024-12-31 10:12:32 +01:00
FrancoisCarouge
9adfa6ea43 fix: quantity_spec missing lint block end 2024-12-30 12:31:53 -08:00
Mateusz Pusz
6f0a81ac80 fix: unit_symbol() and dimension_symbol() returns now std::basic_string_view<CharT> 2024-12-29 11:01:43 +01:00
Mateusz Pusz
e94df6e895 fix: unused convertible_kinds() argument removed 2024-12-28 22:23:38 +01:00
Mateusz Pusz
814f937e03 fix: MSVC build fixed 2024-12-28 22:19:35 +01:00
Mateusz Pusz
dd6f29b65e fix: std::tuple is not freestanding on gcc-14 with C++23 2024-12-28 21:00:08 +01:00
Mateusz Pusz
74988f676f Merge branch 'quantity_spec_refactor' 2024-12-28 14:13:40 +01:00
Mateusz Pusz
5382e08fdd fix: compilation fixed after rebase 2024-12-28 14:12:28 +01:00
Mateusz Pusz
a9525fa301 fix: inconsistencies in get_common_quantity_spec() fixed 2024-12-28 14:02:22 +01:00
Mateusz Pusz
c887b11e6f style: pre-commit rules updated 2024-12-28 14:02:22 +01:00
Mateusz Pusz
71917a41dc refactor: inverse() constraints improved 2024-12-28 14:02:22 +01:00
Mateusz Pusz
06cbfae3b3 feat: quantity_spec conversions improved 2024-12-28 14:02:03 +01:00
Mateusz Pusz
b685521a18 Revert "refactor: QuantitySpec convertibility concepts replaced with direct function calls"
This reverts commit 09488409d2.
2024-12-28 13:52:24 +01:00
Mateusz Pusz
146d7a32fb Merge branch 'master' of github.com:mpusz/units 2024-12-28 13:50:10 +01:00
Mateusz Pusz
ba6e19dcef Merge pull request #660 from rothmichaels/feature/gitignore-ds_store
Add .DS_Store to .gitignore
2024-12-20 09:13:38 +01:00
Roth Michaels
7fd24315f1 Add .DS_Store to .gitignore
This file is added by macOS (e.g. when browsing the directory in Finder).
2024-12-19 18:34:40 -05:00
Mateusz Pusz
e3ec5cb121 Merge pull request #659 from rothmichaels/feature/std-format-apple-clang-16
Enable use of std::format for AppleClang / Xcode 16
2024-12-19 20:15:26 +01:00
Roth Michaels
8293f023dd Update apple-clang compiler support info for std::format 2024-12-19 14:10:21 -05:00
Roth Michaels
7af8f7ecc8 Update apple-clang job matrix
Specify that `std::format` is supported for Xcode 16.1.
2024-12-19 14:10:21 -05:00
Roth Michaels
43729c6190 Enable use of std::format for AppleClang / Xcode 16
Specified the minimum apple-clang version to support `std::format` to 16
for _connanfile.py_.  Xcode 16 does include the `<format>` header but
does not seem to have the __cpp_lib_format compatibility macro defined
so a similar override was needed as we had for Clang 17.

To be able to use `std::format` with Xcode 16 I had to pass
`-DMP_UNITS_API_STD_FORMAT=AUTO` when calling `cmake`.  Is this expected
or is this a sign I missed something in my changes to _CMakeLists.txt_?
2024-12-19 12:54:55 -05:00
Mateusz Pusz
d9c39112df Merge pull request #651 from rothmichaels/feature/update-apple-clang-test-matrix
Update Xcode versions for apple-clang builds
2024-12-19 18:53:20 +01:00
Roth Michaels
b70ded5b82 Drop 15.4 support from PR discussion 2024-12-19 12:17:55 -05:00
Roth Michaels
bf8dc4ac81 Update Xcode versions for apple-clang builds
Since mp-units requires at least Xcode 15 we should have coverage on the
latest compilers for operating system versions for macOS 13 (Ventura)
and macOS 14 (Sequoia) as those are the operating systems with necessary
compilers that our users would be using.

Now build with Xcode 15.2 instead of 15.0.1 which last version supported
on macOS 13.

Add a build for Xcode 15.4 and Xcode 16.1 for testing macOS 14 builds.
Since Xcode 16.1 is new most of our clients using macOS 14 would might
more likely be using Xcode 15.4.

There might not be much C++ changes between Xcode 15.2 and Xcode 15.4 so
perhaps we should drop 15.4 if adding three apple-clang builds is not
worth the resources.
2024-12-19 12:17:21 -05:00
Mateusz Pusz
75ae652bc2 Merge pull request #655 from rothmichaels/bugfix/apple-clang-crash
Fixes for apple-clang crashes and performance issues
2024-12-19 17:40:56 +01:00
Roth Michaels
90aa52a6cc Update src/core/include/mp-units/framework/representation_concepts.h
Co-authored-by: Mateusz Pusz <mateusz.pusz@gmail.com>
2024-12-19 11:21:17 -05:00
Roth Michaels
ada508a683 Do not use WeaklyRegular with Xcode 15 for type detection
Removing the `WeaklyRegular` requirement from the `Scalar`, `Complex`,
and `Vector` concepts seems to address compiler crashes or long
compilation times with apple-clang included in Xcode 15.

I thought I had previously tried removing the `WeaklyRegular`
requirement and it had not solved the problem but either I made a
mistake with this test or some other changes after rebasing this work
changed the situation.
2024-12-19 11:19:09 -05:00
Roth Michaels
0c3bb98c6d Update src/core/include/mp-units/framework/representation_concepts.h
Co-authored-by: Mateusz Pusz <mateusz.pusz@gmail.com>
2024-12-09 18:11:03 +01:00
Roth Michaels
ec3f000050 Update src/core/include/mp-units/framework/representation_concepts.h
Co-authored-by: Mateusz Pusz <mateusz.pusz@gmail.com>
2024-12-09 18:10:56 +01:00
Roth Michaels
d30f5a668c clang-format fixes 2024-12-09 18:01:27 +01:00
Roth Michaels
c3e45088a6 Fixes for apple-clang crashes and performance issues
The source of the crash with the latest changes seemed to be from the
`IsOfCharacter` concept.  This concept was refactored to use some type
traits and more simple concepts although with less strict requirements.

A new macro, `MP_UNITS_APPLE_CLANG_HACKS` was added to
mp-units/bits/hacks.h to enable work arounds for pre-Xcode 16.1 apple-clang.

Some tests were not passing and were removed with the preprocessor macro
for apple-clang hacks is defined.

Adding `ComplexFunctionsAvailable` and `VectorFunctionsAvailable` fixed
some test failures in concepts_test.cpp but not all.
2024-12-09 17:39:21 +01:00
Mateusz Pusz
09488409d2 refactor: QuantitySpec convertibility concepts replaced with direct function calls 2024-12-09 15:55:21 +01:00
Mateusz Pusz
6d93f7385a Merge pull request #628 from JohelEGP/ref_docs
docs(ref): document most of `mp_units.core`
2024-12-08 09:51:40 +01:00
Johel Ernesto Guerrero Peña
ea93287b58 docs(ref): document most of mp_units.core 2024-12-07 16:21:20 -04:00
Mateusz Pusz
7eab29c40a fix: gcc-12 compilation workaround 2024-12-04 21:14:17 +01:00
Mateusz Pusz
4f75a48ba3 refactor: WeaklyRegular removed from ScalableWith 2024-12-04 21:14:02 +01:00
Mateusz Pusz
054e28671c refactor: implicit expression variations used in quantity and quantity_point constraints 2024-12-04 20:21:32 +01:00
Mateusz Pusz
b98c640450 feat: missing precondition added for quantity::op/ 2024-12-04 20:10:47 +01:00
Mateusz Pusz
29ba8e6f7c refactor: preconditions for quantity operations now use is_neq_zero 2024-12-04 20:10:18 +01:00
Mateusz Pusz
971197b9e5 refactor: quantity constructor refactored to use another constructor with the result of sudo_cast 2024-12-04 20:08:02 +01:00
Mateusz Pusz
7e789bc1f1 refactor: std::assignable_from used in ValuePreservingTo concept 2024-12-04 19:57:58 +01:00
Mateusz Pusz
6cd7d388b1 refactor: WeaklyRegular moved to the end of the representation constraints 2024-12-04 19:57:16 +01:00
Mateusz Pusz
db64534f34 test: tests to check if quantity satisfies Scalar 2024-12-01 14:15:56 +01:00
Mateusz Pusz
e44bb7ed55 style: small cleanup of representation concepts 2024-12-01 14:14:19 +01:00
Mateusz Pusz
a444c53fe7 refactor: representation concepts refactored to properly support implicit expression variations 2024-12-01 14:13:41 +01:00
Mateusz Pusz
c582801d84 feat: ScalableWith isolated from Scalar and added as a constraint to Complex and Vector 2024-12-01 14:08:05 +01:00
Mateusz Pusz
4831928802 refactor: Scalar concept refactored to give it a chance to preserve the input type for types simliar to quantity 2024-12-01 14:00:52 +01:00
Mateusz Pusz
c7006f8813 refactor: repeated concept checks removed from get_common_reference 2024-12-01 13:45:34 +01:00