187 Commits

Author SHA1 Message Date
Mateusz Pusz e0cc4eec90 docs(utility): document the utility component, namespace tiers, and the safe_int/constrained move
Add a Namespaces section to the project structure docs describing the three
public tiers (mp_units / mp_units::utility / mp_units::detail), show the
core -> systems -> utility module layering, and list the utility headers.
Update the representation and custom-representation guides to introduce the
built-in cartesian types via mp_units::utility, and update the safe_int /
constrained material (guide, blog posts, tutorials) to the new
<mp-units/utility/...> include paths and mp_units::utility names.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 18:07:49 +02:00
Mateusz Pusz 7ec072cd7b style: markdownlint-cli2 added to pre-commit 2026-06-23 23:03:04 +02:00
Mateusz Pusz 5c8c4ad5ae feat: external linear algebra libraries integrations added + quantity::magnitude() member function
Resolves #301
2026-06-22 18:51:56 +02:00
Mateusz Pusz 1c54623024 feat: import std; enabled for g++ 2026-06-03 21:29:55 +02:00
Mateusz Pusz 8df25adeef docs: use cl-style 19.5+ for MSVC in compiler support table
The previous `195+` is the Conan-side encoding (matching
`_feature_compatibility` in conanfile.py) and is ambiguous in prose —
the digits collide with `_MSC_VER`/cl-version/toolset variants. The
cl-version `19.5+` is what users see from `cl /version`, and what's
already used in src/CMakeLists.txt when this project talks about MSVC
versions. Realign the MSVC column to accommodate the wider cell.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 16:47:45 +02:00
Mateusz Pusz 96965634f5 feat: support import std; on MSVC
mp-units' minimum-supported MSVC 195 (VS 2026) has solid `import std;`
support, but enabling `-o import_std=True` against the build hit two
issues that this change fixes.

(1) Module scanning was only enabled when `cxx_modules=True`.

Without `CMAKE_CXX_SCAN_FOR_MODULES=ON`, CMake doesn't link the implicit
std module BMI into non-module translation units that do `import std;`,
producing C2230 "could not find module 'std'". Enable scanning whenever
`import_std=True` as well. Same bug fixed in `test_package/conanfile.py`.

(2) The std module BMI is built with mismatched compile flags.

CMake materializes the implicit std module BMI as `__cmake_cxx_std_NN`,
a separate internal target that does not link mp-units and therefore
does not inherit mp-units' target-level options. On MSVC this caused
C5050 (`_UTF8` defined on consumer but not on module command line) and
on Clang 21 there is a parallel `-Wreserved-module-identifier` issue
already partially handled in `src/CMakeLists.txt` but in a directory
scope that did not actually reach the BMI either.

Consolidate the workarounds into one `src/cmake/import-std-setup.cmake`
snippet that applies the flags project-wide via `add_compile_options`,
self-guarded by `if(NOT CMAKE_CXX_MODULE_STD) return()`. It is included
from every entry point so all delivery paths converge:
  - top-level `CMakeLists.txt` for the dev build
  - bundled `mp-unitsConfig.cmake` for `find_package` consumers
  - via `cmake_build_modules` in `package_info()` for Conan-generated
    configs (the `cxx_modules=False` consumer path)

Other pieces:
  - `test/static/unit_magnitude_test.cpp` was the only test in the repo
    missing the `MP_UNITS_IMPORT_STD` gate around `#include <type_traits>`,
    causing duplicate `std::integral_constant` definitions in this
    configuration.
  - Compiler support table announces MSVC 195+ for `import std;`.
  - Installation docs gain a consumer-side setup note covering the
    CMake cache variables required, what mp-units handles automatically
    via the snippet, and the `add_subdirectory`-vendored caveat.

Verified: `conan build . -pr msvc195 -o '&:cxx_modules=False'
-o '&:import_std=True' -s compiler.cppstd=23 -c
user.mp-units.build:all=True` -> 40/40 tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 23:45:51 +02:00
Mateusz Pusz 393c671608 docs: MSVC 195 works with mp-units now
Resolves #761
2026-05-24 21:46:41 +02:00
Mateusz Pusz 982fc526c0 feat: 💥 quantity_from_unit_zero() renamed back to quanity_from_zero() and limited to default_point_origin + qp.in(Unit) changes the origin for offset units 2026-05-21 22:46:12 +02:00
Mateusz Pusz c93778010f feat: 💥 final is not longer required for definitions and should not be used for quantity_spec 2026-05-13 15:23:47 +02:00
Mateusz Pusz 0de0438d76 docs: '?' removed from headers with nominal clauses 2026-04-30 15:57:07 +02:00
Mateusz Pusz 0a33e0a0e6 refactor: quantity point bounds are now specified directly in origin - quantity_bounds_for customization point removed 2026-04-25 21:00:31 +02:00
Mateusz Pusz 12300bcd23 feat: safe_int and blog article about it added 2026-04-11 20:30:28 +02:00
Mateusz Pusz a1e1e7cb21 feat: non-negative quantities support added
Resolves #468
2026-04-06 22:51:42 +02:00
Mateusz Pusz 459211fc7a feat: quantity point bounds design finalized 2026-04-03 23:38:47 +02:00
Mateusz Pusz c30a637ae7 refactor: 💥 zeroth-names deprecated; quantity_from_unit_zero(); natural_point_origin 2026-03-31 22:03:03 +02:00
Mateusz Pusz 9966bec272 docs: safety docs updated with safe construction and force_numerical_value_in() 2026-03-25 11:02:19 +00:00
Mateusz Pusz 0171b76bd0 docs: safety features user's guide updated 2026-03-24 09:46:49 +00:00
Mateusz Pusz 89c64cdf31 docs: wavelength removed from quantity kind safety 2026-02-25 15:58:16 +01:00
Mateusz Pusz 38fefb9f80 docs: "Quantity Kind Safety" and "Quantity Safety" chapters improved in "Safety Features" 2026-02-24 22:27:39 +01:00
Mateusz Pusz 142beaa563 docs: "Quantity Kind Safety" now uses absorbed dose and dose equivalent 2026-01-31 11:46:52 +01:00
Mateusz Pusz bc437c142d docs: broken link fixed 2026-01-31 11:45:36 +01:00
Mateusz Pusz 43a64dc683 docs: "Safety Features" chapter added 2026-01-29 19:22:18 +01:00
Mateusz Pusz bf919ad6d4 docs: "Getting Started" index file added 2026-01-29 17:32:18 +01:00
Mateusz Pusz 8a33381f0b docs: most of the How-to Guides improved 2026-01-28 21:28:19 +01:00
Mateusz Pusz 6703f3e835 docs: Hwo-to Guides directory structure refactored 2026-01-25 22:58:22 +01:00
Mateusz Pusz f097d96946 docs: large docs update (new tutorials, index pages) 2026-01-25 22:15:23 +01:00
Mateusz Pusz afbe639772 docs: broken admonitions indentation fixed 2026-01-14 12:31:27 +01:00
Mateusz Pusz 9c5f2412bc refactor: 💥 international system renamed to yard_pound 2026-01-14 12:21:45 +01:00
Mateusz Pusz adda270c33 docs: a large refactoring of TOC
Some chapters moved to the top level and other moved to other places
2026-01-14 09:56:52 +01:00
Mateusz Pusz 57381cf991 docs: "Use Cases" renamed to "How-to Guides" 2026-01-13 17:00:49 +01:00
Mateusz Pusz 9a374a5646 refactor: isq::time swapped with isq::duration 2026-01-09 09:22:37 +01:00
Mateusz Pusz 090330d16a docs: admonition indentation fixed in "Introduction" 2026-01-07 12:38:10 +01:00
Mateusz Pusz 3b0518853f docs: "Extending the Library" chapter removed 2026-01-07 12:37:38 +01:00
Mateusz Pusz e770a40910 feat: 💥 natural units reworked from scratch
`system_reference` and `AssociatedUnit` removed
2026-01-04 20:11:53 +01:00
Mateusz Pusz 6d10a154fa feat: 💥 pi and π is now a unit constant (pi magnitude constant renamed to pi_c) 2025-12-28 13:35:54 +01:00
Mateusz Pusz 27d2def908 feat: 2.5.0 released 2025-12-24 15:50:11 +01:00
Mateusz Pusz 7ce2001a47 Merge branch 'master' into bugfix/disable-appleclang-17 2025-12-21 13:37:38 +01:00
Mateusz Pusz 0fa88a42ae docs: overflow on scaling example added to the "Cheat Sheet" 2025-12-18 09:46:37 +01:00
Mateusz Pusz ad5ebffc5e docs: examples documentation index refactored 2025-12-16 19:27:11 +01:00
Mateusz Pusz 238abc7731 docs: "Cheat Sheet" added 2025-12-15 11:30:24 +01:00
Mateusz Pusz a1106878e3 docs: "Quick Start` tabs rendering fixed 2025-12-14 19:43:45 +01:00
Mateusz Pusz af18c4be67 docs: examples reworked 2025-12-13 13:06:49 +01:00
Roth Michaels 0b8f78e4c5 Disable building with AppleClang 17
AppleClang 17 has the same compiler bug as Clang 19:
https://github.com/llvm/llvm-project/issues/110231

Updated conan configuration to disable building with AppleClang 17.

Updated compiler support documentation to show incompatible Xcode.
2025-11-11 11:45:43 +00:00
Mateusz Pusz 2a27c533b7 docs: Compiler Explorer links description modified 2025-11-04 18:13:26 -10:00
Mateusz Pusz 1e45ab1cb9 Merge branch 'master' into crtp_fix 2025-11-05 03:43:50 +01:00
Mateusz Pusz 43948e3086 build: MP_UNITS_BUILD_AS_SYSTEM_HEADERS removed 2025-11-02 15:36:47 -08:00
Mateusz Pusz 1a84e673c6 refactor: MP_UNITS_INSTALL renamed to MP_UNITS_BUILD_INSTALL 2025-10-14 20:32:37 +02:00
Mateusz Pusz 0e0751a2c2 style: pre-commit 2025-10-14 18:25:58 +02:00
Mateusz Pusz ce334ac0f4 docs: markdownlint issues fixed 2025-10-14 18:25:58 +02:00
Mateusz Pusz e9b70efdff Merge branch 'master' of github.com:mpusz/units 2025-10-14 18:25:09 +02:00