Commit Graph

1104 Commits

Author SHA1 Message Date
Mateusz Pusz 7f1e417c06 docs: system reference cache updated 2026-06-12 09:44:57 +02:00
Mateusz Pusz 5072c138ee docs: "Two levels of format specification" chapter added 2026-06-12 09:44:28 +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 2690296059 feat: quantity_point text output added for default_point_origin 2026-05-21 18:38:09 +02:00
Mateusz Pusz 779d78fce9 docs: P4185 added to the docs welcome page 2026-05-15 09:51:08 +02:00
Mateusz Pusz 6e6ff299b5 feat(example): trade_execution example added 2026-05-14 19:57:28 +02:00
Mateusz Pusz 995d5dda5f docs: workaround from "Custom Quantity Specifications" workshop removed 2026-05-14 19:06:49 +02:00
Mateusz Pusz 257c51ccc4 docs: Compiler Explorer links updated 2026-05-14 19:06:16 +02:00
Mateusz Pusz 47fdf2254b docs: frame projections tutorial added 2026-05-13 19:13:27 +02:00
Mateusz Pusz 2de1a2ff04 docs: header files with customization points updated 2026-05-13 19:12:46 +02:00
Mateusz Pusz 013c23be22 docs: quantity safety post now references absolute quantities post 2026-05-13 19:04:42 +02:00
Mateusz Pusz 478f86eedc feat(example): geographic.h now supports converting between bearing and azimuth 2026-05-13 19:00:22 +02:00
Mateusz Pusz 7899bf4ca8 feat: explicit constructor between point in projected frames added 2026-05-13 18:11:27 +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 72ca96ee52 feat: frame projections support added 2026-05-12 23:02:09 +02:00
Mateusz Pusz 9ba6d2e0f6 docs: Absolute Quantities blog article updated 2026-05-12 21:42:59 +02:00
Mateusz Pusz c1212bf4da docs: "Representation Types" chapter updated 2026-05-12 20:42:15 +02:00
Mateusz Pusz 1ac0fe5336 docs: affine space SVG updated 2026-05-12 20:27:42 +02:00
Mateusz Pusz 3a27e34ea6 docs: system reference cache updated 2026-05-06 22:54:59 +02:00
Mateusz Pusz 4161608a92 docs: point origin inheritance docs added 2026-05-06 22:35:58 +02:00
Mateusz Pusz 1b8b6d222a feat: kind_of applied to more derived SI units + some quantity_spec hierarchies improved 2026-05-06 22:34:40 +02:00
Mateusz Pusz 2978c1963f fix: missing constraints for qp.quantity_from_unit_zero() added + fixed all incorrect usa cases 2026-05-06 22:12:50 +02:00
Mateusz Pusz b12fe30925 feat: non-negativity can't be determined from the equation 2026-05-01 11:41:12 +02:00
Mateusz Pusz 0de0438d76 docs: '?' removed from headers with nominal clauses 2026-04-30 15:57:07 +02:00
Mateusz Pusz 423db353e1 feat(example): currency example improved
Co-authored-by: Copilot <copilot@github.com>
2026-04-30 14:07:35 +02:00
Mateusz Pusz 477b8eb7f1 docs: marking of subkinds in hierarchies changed to subgraphs
Co-authored-by: Copilot <copilot@github.com>
2026-04-29 19:20:14 +02:00
Mateusz Pusz 251a8fd132 feat: Natural Units support finalized
Co-authored-by: Copilot <copilot@github.com>
2026-04-29 16:16:25 +02:00
Mateusz Pusz 08ba2200eb docs: Users Guide index updated with safe_int
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 21:32:00 +02:00
Mateusz Pusz 10978e582f docs: "Overview" chapter removed from the systems descriptions in the Users Guide 2026-04-28 21:25:16 +02:00
Mateusz Pusz c3d5fc6dbb docs: non_negative declarations added to quantity_spec in docs
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 21:10:01 +02:00
René Paris df8c264e24 Fix quantity calculation from subtraction to addition 2026-04-28 19:33:36 +02:00
Mateusz Pusz 810c5a9c41 docs: quantity point bounds documentation updated
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 10:49:24 +02:00
Mateusz Pusz 7b2603a8ba docs: safe_int documentation improved 2026-04-27 23:28:12 +02:00
Mateusz Pusz d96d977845 style: pre-commit 2026-04-27 18:43:39 +02:00
Mateusz Pusz 9b1734e319 docs: "Representation Types" chapter contents restored
Co-authored-by: Copilot <copilot@github.com>
2026-04-27 14:37:47 +02:00
Mateusz Pusz 22f292a980 docs: nondimensionalization How-To Guide added
Co-authored-by: Copilot <copilot@github.com>
2026-04-27 13:15:54 +02:00
Mateusz Pusz 659738044a feat: safe_int implicit conversions improved and refactored the operators + widening for scaling now preserves sign
Co-authored-by: Copilot <copilot@github.com>
2026-04-26 16:03:09 +02:00
Mateusz Pusz e3f8cc0dc4 docs: "Representation types" updated with the latest changes 2026-04-25 21:04:40 +02:00
Mateusz Pusz eb95325c33 feat: 💥 isq::depth removed 2026-04-25 21:03:51 +02:00
Mateusz Pusz 3506de9bf1 docs: GitHub discussion added to the hw_voltage example documentation 2026-04-25 21:01:05 +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 b9d801dc34 docs: representation types docs improved
Co-authored-by: Copilot <copilot@github.com>
2026-04-25 19:16:22 +02:00
Mateusz Pusz 08e1645dfe feat: UsesIntegerScaling now properly requires multiplication by a wider type 2026-04-25 12:52:05 +02:00
Mateusz Pusz 6263e2b8c5 feat: representation_underlying_type provided instead of indirectly_readable_traits usage 2026-04-21 22:10:19 +02:00
Mateusz Pusz 589189f3cc docs: location example added to the point bouds article 2026-04-17 23:09:04 +02:00
Mateusz Pusz 7384c7eace docs: bounds checking article updated after Oliver Rostens' feedback 2026-04-17 22:56:43 +02:00