From a24f8d8833692aabf60dc4d03c7b1d1d51b59eaa Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 16 Jun 2025 16:22:40 +0000 Subject: [PATCH] Deployed 91791210 to HEAD with MkDocs 1.6.1 and mike 2.1.3 --- HEAD/404.html | 8 +- HEAD/api_reference/gen/14882.css | 758 ---- HEAD/api_reference/gen/assoc.qty.html | 35 - HEAD/api_reference/gen/colored.css | 15 - HEAD/api_reference/gen/conceptindex.html | 1 - HEAD/api_reference/gen/defs.html | 12 - HEAD/api_reference/gen/derived.qty.html | 38 - HEAD/api_reference/gen/dimless.qty.html | 6 - HEAD/api_reference/gen/expanded.css | 22 - HEAD/api_reference/gen/fig.html | 1 - HEAD/api_reference/gen/footnotes.html | 1 - HEAD/api_reference/gen/full.html | 3499 ----------------- HEAD/api_reference/gen/fulltoc.html | 14 - HEAD/api_reference/gen/generalindex.html | 1 - .../gen/get.common.qty.spec.html | 45 - HEAD/api_reference/gen/icon.png | Bin 132 -> 0 bytes HEAD/api_reference/gen/impldefindex.html | 1 - HEAD/api_reference/gen/index.html | 15 - HEAD/api_reference/gen/kind.of.qty.html | 11 - HEAD/api_reference/gen/libraryindex.html | 1 - HEAD/api_reference/gen/moduleindex.html | 1 - HEAD/api_reference/gen/mp.units.core.syn.html | 628 --- HEAD/api_reference/gen/mp.units.syn.html | 5 - HEAD/api_reference/gen/mp.units.syns.html | 654 --- .../gen/mp.units.systems.syn.html | 23 - HEAD/api_reference/gen/named.qty.html | 65 - HEAD/api_reference/gen/normative-only.css | 9 - HEAD/api_reference/gen/qty.abs.pt.orig.html | 10 - HEAD/api_reference/gen/qty.arith.ops.html | 74 - HEAD/api_reference/gen/qty.assign.ops.html | 43 - HEAD/api_reference/gen/qty.canon.unit.html | 11 - HEAD/api_reference/gen/qty.char.traits.html | 12 - HEAD/api_reference/gen/qty.chrono.html | 78 - HEAD/api_reference/gen/qty.cmp.html | 29 - HEAD/api_reference/gen/qty.common.type.html | 21 - HEAD/api_reference/gen/qty.common.unit.html | 40 - HEAD/api_reference/gen/qty.cons.html | 27 - HEAD/api_reference/gen/qty.conv.html | 29 - HEAD/api_reference/gen/qty.conv.ops.html | 17 - HEAD/api_reference/gen/qty.def.pt.orig.html | 8 - HEAD/api_reference/gen/qty.delta.html | 15 - HEAD/api_reference/gen/qty.derived.unit.html | 22 - HEAD/api_reference/gen/qty.dim.concepts.html | 10 - HEAD/api_reference/gen/qty.dim.general.html | 2 - HEAD/api_reference/gen/qty.dim.html | 75 - HEAD/api_reference/gen/qty.dim.ops.html | 27 - HEAD/api_reference/gen/qty.dim.sym.fmt.html | 7 - HEAD/api_reference/gen/qty.dim.types.html | 33 - HEAD/api_reference/gen/qty.fp.traits.html | 19 - HEAD/api_reference/gen/qty.general.html | 3 - .../gen/qty.get.common.base.html | 7 - HEAD/api_reference/gen/qty.get.kind.html | 18 - HEAD/api_reference/gen/qty.html | 708 ---- HEAD/api_reference/gen/qty.imag.cpo.html | 8 - HEAD/api_reference/gen/qty.is.child.of.html | 4 - HEAD/api_reference/gen/qty.like.html | 20 - HEAD/api_reference/gen/qty.mag.cpo.html | 12 - HEAD/api_reference/gen/qty.modulus.cpo.html | 12 - HEAD/api_reference/gen/qty.named.unit.html | 81 - HEAD/api_reference/gen/qty.non.mem.conv.html | 41 - HEAD/api_reference/gen/qty.obs.html | 15 - HEAD/api_reference/gen/qty.point.html | 15 - HEAD/api_reference/gen/qty.prefixed.unit.html | 18 - HEAD/api_reference/gen/qty.pt.arith.ops.html | 51 - HEAD/api_reference/gen/qty.pt.assign.ops.html | 11 - HEAD/api_reference/gen/qty.pt.cmp.html | 16 - HEAD/api_reference/gen/qty.pt.cons.html | 34 - HEAD/api_reference/gen/qty.pt.conv.html | 38 - HEAD/api_reference/gen/qty.pt.conv.ops.html | 21 - HEAD/api_reference/gen/qty.pt.general.html | 3 - HEAD/api_reference/gen/qty.pt.html | 621 --- HEAD/api_reference/gen/qty.pt.like.html | 10 - .../gen/qty.pt.non.mem.conv.html | 51 - HEAD/api_reference/gen/qty.pt.obs.html | 26 - .../gen/qty.pt.orig.concepts.html | 10 - .../gen/qty.pt.orig.general.html | 2 - HEAD/api_reference/gen/qty.pt.orig.html | 135 - HEAD/api_reference/gen/qty.pt.orig.ops.html | 70 - HEAD/api_reference/gen/qty.pt.orig.types.html | 34 - HEAD/api_reference/gen/qty.pt.orig.utils.html | 23 - HEAD/api_reference/gen/qty.pt.static.html | 7 - HEAD/api_reference/gen/qty.pt.syn.html | 199 - HEAD/api_reference/gen/qty.pt.unary.ops.html | 18 - HEAD/api_reference/gen/qty.ratio.html | 46 - HEAD/api_reference/gen/qty.real.cpo.html | 8 - HEAD/api_reference/gen/qty.ref.cmp.html | 11 - HEAD/api_reference/gen/qty.ref.concepts.html | 6 - HEAD/api_reference/gen/qty.ref.general.html | 2 - HEAD/api_reference/gen/qty.ref.html | 986 ----- HEAD/api_reference/gen/qty.ref.obs.html | 27 - HEAD/api_reference/gen/qty.ref.ops.html | 34 - HEAD/api_reference/gen/qty.ref.syn.html | 67 - HEAD/api_reference/gen/qty.rel.pt.orig.html | 18 - HEAD/api_reference/gen/qty.rep.concepts.html | 88 - .../gen/qty.rep.cpos.general.html | 2 - HEAD/api_reference/gen/qty.rep.cpos.html | 38 - HEAD/api_reference/gen/qty.rep.general.html | 2 - HEAD/api_reference/gen/qty.rep.html | 166 - HEAD/api_reference/gen/qty.rep.traits.html | 41 - .../gen/qty.same.abs.pt.origs.html | 16 - HEAD/api_reference/gen/qty.scaled.unit.html | 15 - HEAD/api_reference/gen/qty.spec.concepts.html | 48 - HEAD/api_reference/gen/qty.spec.conv.html | 5 - HEAD/api_reference/gen/qty.spec.general.html | 2 - .../gen/qty.spec.hier.algos.html | 75 - HEAD/api_reference/gen/qty.spec.html | 306 -- HEAD/api_reference/gen/qty.spec.ops.html | 46 - HEAD/api_reference/gen/qty.spec.types.html | 117 - HEAD/api_reference/gen/qty.spec.utils.html | 23 - HEAD/api_reference/gen/qty.static.html | 11 - .../api_reference/gen/qty.sym.expr.algos.html | 81 - .../gen/qty.sym.expr.concepts.html | 8 - .../gen/qty.sym.expr.general.html | 9 - HEAD/api_reference/gen/qty.sym.expr.html | 123 - .../api_reference/gen/qty.sym.expr.types.html | 28 - HEAD/api_reference/gen/qty.sym.txt.html | 80 - HEAD/api_reference/gen/qty.syn.html | 334 -- HEAD/api_reference/gen/qty.systems.html | 1 - HEAD/api_reference/gen/qty.unary.ops.html | 31 - HEAD/api_reference/gen/qty.unit.cmp.html | 20 - HEAD/api_reference/gen/qty.unit.concepts.html | 34 - HEAD/api_reference/gen/qty.unit.general.html | 2 - HEAD/api_reference/gen/qty.unit.html | 466 --- .../gen/qty.unit.mag.concepts.html | 9 - .../gen/qty.unit.mag.general.html | 3 - HEAD/api_reference/gen/qty.unit.mag.html | 83 - HEAD/api_reference/gen/qty.unit.mag.ops.html | 18 - .../api_reference/gen/qty.unit.mag.types.html | 50 - .../api_reference/gen/qty.unit.mag.utils.html | 7 - HEAD/api_reference/gen/qty.unit.obs.html | 44 - HEAD/api_reference/gen/qty.unit.one.html | 6 - HEAD/api_reference/gen/qty.unit.ops.html | 55 - HEAD/api_reference/gen/qty.unit.sym.fmt.html | 7 - HEAD/api_reference/gen/qty.unit.traits.html | 8 - HEAD/api_reference/gen/qty.unit.types.html | 187 - HEAD/api_reference/gen/qty.utils.html | 257 -- .../gen/qty.utils.non.types.html | 11 - HEAD/api_reference/gen/qty.val.cmp.html | 13 - HEAD/api_reference/gen/qty.val.traits.html | 12 - .../api_reference/gen/qty.zeroth.pt.orig.html | 8 - HEAD/api_reference/gen/quantities.html | 3469 ---------------- .../api_reference/gen/quantities.summary.html | 6 - HEAD/api_reference/gen/refs.html | 9 - HEAD/api_reference/gen/scope.html | 1 - HEAD/api_reference/gen/spec.cats.html | 4 - HEAD/api_reference/gen/spec.ext.html | 6 - HEAD/api_reference/gen/spec.html | 12 - HEAD/api_reference/gen/spec.mods.html | 3 - HEAD/api_reference/gen/spec.reqs.html | 2 - HEAD/api_reference/gen/spec.res.names.html | 2 - HEAD/api_reference/gen/tab.html | 1 - HEAD/api_reference/gen/tab:lib.cats.html | 1 - HEAD/api_reference/gen/tab:modules.html | 1 - .../gen/tab:quantities.summary.html | 1 - HEAD/api_reference/index.html | 8 +- HEAD/appendix/glossary/index.html | 8 +- HEAD/appendix/references/index.html | 8 +- .../posts/introducing-absolute-quantities.png | Bin 0 -> 39574 bytes ...c8b220af.min.js => bundle.13a4f30d.min.js} | 8 +- ....min.js.map => bundle.13a4f30d.min.js.map} | 4 +- ...f8cc74c7.min.js => search.d50fe291.min.js} | 4 +- ....min.js.map => search.d50fe291.min.js.map} | 2 +- ...4af4bdda.min.css => main.342714a4.min.css} | 2 +- ....min.css.map => main.342714a4.min.css.map} | 2 +- .../09/24/whats-new-in-mp-units-20/index.html | 8 +- .../index.html | 8 +- .../12/09/mp-units-210-released/index.html | 8 +- .../index.html | 8 +- .../06/14/mp-units-220-released/index.html | 8 +- .../index.html | 8 +- .../09/27/mp-units-230-released/index.html | 8 +- .../index.html | 8 +- .../index.html | 8 +- .../index.html | 8 +- .../index.html | 8 +- .../index.html | 8 +- .../11/05/mp-units-240-released/index.html | 8 +- .../index.html | 8 +- .../index.html | 8 +- .../index.html | 26 +- .../index.html | 2824 +++++++++++++ HEAD/blog/archive/2023/index.html | 8 +- HEAD/blog/archive/2024/index.html | 8 +- HEAD/blog/archive/2024/page/2/index.html | 8 +- HEAD/blog/archive/2025/index.html | 57 +- HEAD/blog/category/metrology/index.html | 57 +- HEAD/blog/category/releases/index.html | 8 +- HEAD/blog/category/wg21-updates/index.html | 8 +- HEAD/blog/index.html | 109 +- HEAD/blog/page/2/index.html | 60 +- HEAD/feed_json_created.json | 2 +- HEAD/feed_json_updated.json | 2 +- HEAD/feed_rss_created.xml | 2 +- HEAD/feed_rss_updated.xml | 2 +- HEAD/getting_started/contributing/index.html | 8 +- .../cpp_compiler_support/index.html | 8 +- HEAD/getting_started/faq/index.html | 8 +- .../installation_and_usage/index.html | 8 +- HEAD/getting_started/introduction/index.html | 8 +- HEAD/getting_started/look_and_feel/index.html | 8 +- .../project_structure/index.html | 8 +- HEAD/getting_started/quick_start/index.html | 8 +- HEAD/index.html | 8 +- HEAD/release_notes/index.html | 27 +- HEAD/search/search_index.json | 2 +- HEAD/sitemap.xml | 144 +- HEAD/sitemap.xml.gz | Bin 1137 -> 1156 bytes .../users_guide/examples/avg_speed/index.html | 8 +- .../examples/hello_units/index.html | 8 +- .../examples/hw_voltage/index.html | 8 +- .../examples/si_constants/index.html | 8 +- .../examples/tags_index/index.html | 8 +- .../character_of_a_quantity/index.html | 8 +- .../framework_basics/concepts/index.html | 8 +- .../design_overview/index.html | 8 +- .../dimensionless_quantities/index.html | 8 +- .../index.html | 8 +- .../generic_interfaces/index.html | 8 +- .../interface_introduction/index.html | 8 +- .../obtaining_metadata/index.html | 8 +- .../quantity_arithmetics/index.html | 8 +- .../simple_and_typed_quantities/index.html | 8 +- .../systems_of_quantities/index.html | 8 +- .../systems_of_units/index.html | 8 +- .../framework_basics/text_output/index.html | 8 +- .../the_affine_space/index.html | 8 +- .../value_conversions/index.html | 8 +- .../systems/introduction/index.html | 8 +- HEAD/users_guide/systems/isq/index.html | 8 +- .../systems/natural_units/index.html | 8 +- HEAD/users_guide/systems/si/index.html | 8 +- .../systems/strong_angular_system/index.html | 8 +- .../terms_and_definitions/index.html | 8 +- .../extending_the_library/index.html | 8 +- .../index.html | 8 +- .../pure_dimensional_analysis/index.html | 8 +- .../index.html | 8 +- .../use_cases/wide_compatibility/index.html | 8 +- .../working_with_legacy_interfaces/index.html | 8 +- 239 files changed, 3432 insertions(+), 16955 deletions(-) delete mode 100644 HEAD/api_reference/gen/14882.css delete mode 100644 HEAD/api_reference/gen/assoc.qty.html delete mode 100644 HEAD/api_reference/gen/colored.css delete mode 100644 HEAD/api_reference/gen/conceptindex.html delete mode 100644 HEAD/api_reference/gen/defs.html delete mode 100644 HEAD/api_reference/gen/derived.qty.html delete mode 100644 HEAD/api_reference/gen/dimless.qty.html delete mode 100644 HEAD/api_reference/gen/expanded.css delete mode 100644 HEAD/api_reference/gen/fig.html delete mode 100644 HEAD/api_reference/gen/footnotes.html delete mode 100644 HEAD/api_reference/gen/full.html delete mode 100644 HEAD/api_reference/gen/fulltoc.html delete mode 100644 HEAD/api_reference/gen/generalindex.html delete mode 100644 HEAD/api_reference/gen/get.common.qty.spec.html delete mode 100644 HEAD/api_reference/gen/icon.png delete mode 100644 HEAD/api_reference/gen/impldefindex.html delete mode 100644 HEAD/api_reference/gen/index.html delete mode 100644 HEAD/api_reference/gen/kind.of.qty.html delete mode 100644 HEAD/api_reference/gen/libraryindex.html delete mode 100644 HEAD/api_reference/gen/moduleindex.html delete mode 100644 HEAD/api_reference/gen/mp.units.core.syn.html delete mode 100644 HEAD/api_reference/gen/mp.units.syn.html delete mode 100644 HEAD/api_reference/gen/mp.units.syns.html delete mode 100644 HEAD/api_reference/gen/mp.units.systems.syn.html delete mode 100644 HEAD/api_reference/gen/named.qty.html delete mode 100644 HEAD/api_reference/gen/normative-only.css delete mode 100644 HEAD/api_reference/gen/qty.abs.pt.orig.html delete mode 100644 HEAD/api_reference/gen/qty.arith.ops.html delete mode 100644 HEAD/api_reference/gen/qty.assign.ops.html delete mode 100644 HEAD/api_reference/gen/qty.canon.unit.html delete mode 100644 HEAD/api_reference/gen/qty.char.traits.html delete mode 100644 HEAD/api_reference/gen/qty.chrono.html delete mode 100644 HEAD/api_reference/gen/qty.cmp.html delete mode 100644 HEAD/api_reference/gen/qty.common.type.html delete mode 100644 HEAD/api_reference/gen/qty.common.unit.html delete mode 100644 HEAD/api_reference/gen/qty.cons.html delete mode 100644 HEAD/api_reference/gen/qty.conv.html delete mode 100644 HEAD/api_reference/gen/qty.conv.ops.html delete mode 100644 HEAD/api_reference/gen/qty.def.pt.orig.html delete mode 100644 HEAD/api_reference/gen/qty.delta.html delete mode 100644 HEAD/api_reference/gen/qty.derived.unit.html delete mode 100644 HEAD/api_reference/gen/qty.dim.concepts.html delete mode 100644 HEAD/api_reference/gen/qty.dim.general.html delete mode 100644 HEAD/api_reference/gen/qty.dim.html delete mode 100644 HEAD/api_reference/gen/qty.dim.ops.html delete mode 100644 HEAD/api_reference/gen/qty.dim.sym.fmt.html delete mode 100644 HEAD/api_reference/gen/qty.dim.types.html delete mode 100644 HEAD/api_reference/gen/qty.fp.traits.html delete mode 100644 HEAD/api_reference/gen/qty.general.html delete mode 100644 HEAD/api_reference/gen/qty.get.common.base.html delete mode 100644 HEAD/api_reference/gen/qty.get.kind.html delete mode 100644 HEAD/api_reference/gen/qty.html delete mode 100644 HEAD/api_reference/gen/qty.imag.cpo.html delete mode 100644 HEAD/api_reference/gen/qty.is.child.of.html delete mode 100644 HEAD/api_reference/gen/qty.like.html delete mode 100644 HEAD/api_reference/gen/qty.mag.cpo.html delete mode 100644 HEAD/api_reference/gen/qty.modulus.cpo.html delete mode 100644 HEAD/api_reference/gen/qty.named.unit.html delete mode 100644 HEAD/api_reference/gen/qty.non.mem.conv.html delete mode 100644 HEAD/api_reference/gen/qty.obs.html delete mode 100644 HEAD/api_reference/gen/qty.point.html delete mode 100644 HEAD/api_reference/gen/qty.prefixed.unit.html delete mode 100644 HEAD/api_reference/gen/qty.pt.arith.ops.html delete mode 100644 HEAD/api_reference/gen/qty.pt.assign.ops.html delete mode 100644 HEAD/api_reference/gen/qty.pt.cmp.html delete mode 100644 HEAD/api_reference/gen/qty.pt.cons.html delete mode 100644 HEAD/api_reference/gen/qty.pt.conv.html delete mode 100644 HEAD/api_reference/gen/qty.pt.conv.ops.html delete mode 100644 HEAD/api_reference/gen/qty.pt.general.html delete mode 100644 HEAD/api_reference/gen/qty.pt.html delete mode 100644 HEAD/api_reference/gen/qty.pt.like.html delete mode 100644 HEAD/api_reference/gen/qty.pt.non.mem.conv.html delete mode 100644 HEAD/api_reference/gen/qty.pt.obs.html delete mode 100644 HEAD/api_reference/gen/qty.pt.orig.concepts.html delete mode 100644 HEAD/api_reference/gen/qty.pt.orig.general.html delete mode 100644 HEAD/api_reference/gen/qty.pt.orig.html delete mode 100644 HEAD/api_reference/gen/qty.pt.orig.ops.html delete mode 100644 HEAD/api_reference/gen/qty.pt.orig.types.html delete mode 100644 HEAD/api_reference/gen/qty.pt.orig.utils.html delete mode 100644 HEAD/api_reference/gen/qty.pt.static.html delete mode 100644 HEAD/api_reference/gen/qty.pt.syn.html delete mode 100644 HEAD/api_reference/gen/qty.pt.unary.ops.html delete mode 100644 HEAD/api_reference/gen/qty.ratio.html delete mode 100644 HEAD/api_reference/gen/qty.real.cpo.html delete mode 100644 HEAD/api_reference/gen/qty.ref.cmp.html delete mode 100644 HEAD/api_reference/gen/qty.ref.concepts.html delete mode 100644 HEAD/api_reference/gen/qty.ref.general.html delete mode 100644 HEAD/api_reference/gen/qty.ref.html delete mode 100644 HEAD/api_reference/gen/qty.ref.obs.html delete mode 100644 HEAD/api_reference/gen/qty.ref.ops.html delete mode 100644 HEAD/api_reference/gen/qty.ref.syn.html delete mode 100644 HEAD/api_reference/gen/qty.rel.pt.orig.html delete mode 100644 HEAD/api_reference/gen/qty.rep.concepts.html delete mode 100644 HEAD/api_reference/gen/qty.rep.cpos.general.html delete mode 100644 HEAD/api_reference/gen/qty.rep.cpos.html delete mode 100644 HEAD/api_reference/gen/qty.rep.general.html delete mode 100644 HEAD/api_reference/gen/qty.rep.html delete mode 100644 HEAD/api_reference/gen/qty.rep.traits.html delete mode 100644 HEAD/api_reference/gen/qty.same.abs.pt.origs.html delete mode 100644 HEAD/api_reference/gen/qty.scaled.unit.html delete mode 100644 HEAD/api_reference/gen/qty.spec.concepts.html delete mode 100644 HEAD/api_reference/gen/qty.spec.conv.html delete mode 100644 HEAD/api_reference/gen/qty.spec.general.html delete mode 100644 HEAD/api_reference/gen/qty.spec.hier.algos.html delete mode 100644 HEAD/api_reference/gen/qty.spec.html delete mode 100644 HEAD/api_reference/gen/qty.spec.ops.html delete mode 100644 HEAD/api_reference/gen/qty.spec.types.html delete mode 100644 HEAD/api_reference/gen/qty.spec.utils.html delete mode 100644 HEAD/api_reference/gen/qty.static.html delete mode 100644 HEAD/api_reference/gen/qty.sym.expr.algos.html delete mode 100644 HEAD/api_reference/gen/qty.sym.expr.concepts.html delete mode 100644 HEAD/api_reference/gen/qty.sym.expr.general.html delete mode 100644 HEAD/api_reference/gen/qty.sym.expr.html delete mode 100644 HEAD/api_reference/gen/qty.sym.expr.types.html delete mode 100644 HEAD/api_reference/gen/qty.sym.txt.html delete mode 100644 HEAD/api_reference/gen/qty.syn.html delete mode 100644 HEAD/api_reference/gen/qty.systems.html delete mode 100644 HEAD/api_reference/gen/qty.unary.ops.html delete mode 100644 HEAD/api_reference/gen/qty.unit.cmp.html delete mode 100644 HEAD/api_reference/gen/qty.unit.concepts.html delete mode 100644 HEAD/api_reference/gen/qty.unit.general.html delete mode 100644 HEAD/api_reference/gen/qty.unit.html delete mode 100644 HEAD/api_reference/gen/qty.unit.mag.concepts.html delete mode 100644 HEAD/api_reference/gen/qty.unit.mag.general.html delete mode 100644 HEAD/api_reference/gen/qty.unit.mag.html delete mode 100644 HEAD/api_reference/gen/qty.unit.mag.ops.html delete mode 100644 HEAD/api_reference/gen/qty.unit.mag.types.html delete mode 100644 HEAD/api_reference/gen/qty.unit.mag.utils.html delete mode 100644 HEAD/api_reference/gen/qty.unit.obs.html delete mode 100644 HEAD/api_reference/gen/qty.unit.one.html delete mode 100644 HEAD/api_reference/gen/qty.unit.ops.html delete mode 100644 HEAD/api_reference/gen/qty.unit.sym.fmt.html delete mode 100644 HEAD/api_reference/gen/qty.unit.traits.html delete mode 100644 HEAD/api_reference/gen/qty.unit.types.html delete mode 100644 HEAD/api_reference/gen/qty.utils.html delete mode 100644 HEAD/api_reference/gen/qty.utils.non.types.html delete mode 100644 HEAD/api_reference/gen/qty.val.cmp.html delete mode 100644 HEAD/api_reference/gen/qty.val.traits.html delete mode 100644 HEAD/api_reference/gen/qty.zeroth.pt.orig.html delete mode 100644 HEAD/api_reference/gen/quantities.html delete mode 100644 HEAD/api_reference/gen/quantities.summary.html delete mode 100644 HEAD/api_reference/gen/refs.html delete mode 100644 HEAD/api_reference/gen/scope.html delete mode 100644 HEAD/api_reference/gen/spec.cats.html delete mode 100644 HEAD/api_reference/gen/spec.ext.html delete mode 100644 HEAD/api_reference/gen/spec.html delete mode 100644 HEAD/api_reference/gen/spec.mods.html delete mode 100644 HEAD/api_reference/gen/spec.reqs.html delete mode 100644 HEAD/api_reference/gen/spec.res.names.html delete mode 100644 HEAD/api_reference/gen/tab.html delete mode 100644 HEAD/api_reference/gen/tab:lib.cats.html delete mode 100644 HEAD/api_reference/gen/tab:modules.html delete mode 100644 HEAD/api_reference/gen/tab:quantities.summary.html create mode 100644 HEAD/assets/images/social/blog/posts/introducing-absolute-quantities.png rename HEAD/assets/javascripts/{bundle.c8b220af.min.js => bundle.13a4f30d.min.js} (66%) rename HEAD/assets/javascripts/{bundle.c8b220af.min.js.map => bundle.13a4f30d.min.js.map} (82%) rename HEAD/assets/javascripts/workers/{search.f8cc74c7.min.js => search.d50fe291.min.js} (99%) rename HEAD/assets/javascripts/workers/{search.f8cc74c7.min.js.map => search.d50fe291.min.js.map} (99%) rename HEAD/assets/stylesheets/{main.4af4bdda.min.css => main.342714a4.min.css} (57%) rename HEAD/assets/stylesheets/{main.4af4bdda.min.css.map => main.342714a4.min.css.map} (68%) create mode 100644 HEAD/blog/2025/06/16/introducing-absolute-quantities/index.html diff --git a/HEAD/404.html b/HEAD/404.html index e84a8513..8dedb1bc 100644 --- a/HEAD/404.html +++ b/HEAD/404.html @@ -19,7 +19,7 @@ - + @@ -27,7 +27,7 @@ - + @@ -2338,10 +2338,10 @@ You're not viewing the latest version. - + - + diff --git a/HEAD/api_reference/gen/14882.css b/HEAD/api_reference/gen/14882.css deleted file mode 100644 index 9fffa172..00000000 --- a/HEAD/api_reference/gen/14882.css +++ /dev/null @@ -1,758 +0,0 @@ -body { - font-family: 'Noto Serif'; - hyphens: auto; - line-height: 1.5; - margin-left: 20mm; - margin-right: 16mm; - margin-top: 12mm; - margin-bottom: 12mm; - font-size: 10pt; -} - -div { - background: inherit; -} - -div.wrapper { - max-width: 20cm; - margin: auto; -} - -div.texpara { - margin-top: 3pt; - margin-bottom: 3pt; -} - -table div.texpara { - margin-top: 0; - margin-bottom: 0; -} - -table.enumerate div.texpara { - margin-top: 3pt; - margin-bottom: 3pt; -} - -ul { - list-style-type: none; - padding-left: 9mm; - margin-top: 0; - margin-bottom: 0; -} - -ol { - margin-top: 0; - margin-bottom: 0; -} - -a { text-decoration: none; } - -a.hidden_link { - text-decoration: none; - color: inherit; -} - -li { - margin-top: 3pt; - margin-bottom: 3pt; -} - -h1 { - line-height: 1; - margin-top: 10pt; - margin-bottom: 10pt; -} - -h2 { - line-height: 1; - font-size: 14pt; - margin-top: 10pt; - margin-bottom: 10pt; -} - -h2::after { - content: ""; - clear: both; - display: table; -} - -h3 { - line-height: 1; - margin-top: 10pt; - margin-bottom: 10pt; -} - -h3::after { - content: ""; - clear: both; - display: table; -} - -h4 { - line-height: 1; - margin-top: 10pt; - margin-bottom: 10pt; -} - -h4::after { - content: ""; - clear: both; - display: table; -} - -ul > li:before { - content: "\2014"; - position: absolute; - margin-left: -1.5em; -} - -.shy:before { - content: "\00ad"; - /* This is U+00AD SOFT HYPHEN, same as ­, but we put it in :before - to stop it from being included when the text is copied to the clipboard - with Firefox, which is especially annoying when copying to a terminal, - where the hyphen characters will show up. */ -} - -:target { background-color: #C9FBC9; } -:target .codeblock { background-color: #C9FBC9; } -:target ul { background-color: #C9FBC9; } - -.abbr_ref { float: right; } - -.folded_abbr_ref { float: right; } -:target .folded_abbr_ref { display: none; } - -:target .unfolded_abbr_ref { float: right; display: inherit; } -.unfolded_abbr_ref { display: none; } - -.secnum { display: inline-block; min-width: 35pt; } -.annexnum { display: block; } - -div.sourceLinkParent { - float: right; -} - -a.sourceLink { - position: absolute; - opacity: 0; - margin-left: 10pt; -} - -a.sourceLink:hover { - opacity: 1; -} - -a.itemDeclLink { - position: absolute; - font-size: 75%; - text-align: right; - width: 5em; - opacity: 0; -} -a.itemDeclLink:hover { opacity: 1; } - -div.marginalizedparent { - position: relative; - left: -18mm; -} - -a.marginalized { - width: 15mm; - position: absolute; - font-size: 7pt; - text-align: right; -} - -a.enumerated_item_num { - display: block; - margin-top: 3pt; - margin-bottom: 3pt; - margin-right: 6pt; -} - -div.para { - margin-bottom: 6pt; - margin-top: 6pt; - text-align: justify; - min-height: 1.2em; -} - -div.section { text-align: justify; } -div.sentence { display: inline; } - -a.index { - position: relative; - float: right; - right: -1em; - display: none; -} - -a.index:before { - position: absolute; - content: "⟵"; - background-color: #C9FBC9; -} - -a.index:target { - display: inline; -} - -.indexitems { - margin-left: 2em; - text-indent: -2em; -} - -div.itemdescr { - margin-left: 12mm; -} - -.bnf { - font-family: 'Noto Sans'; - font-size: 10pt; - font-style: italic; - margin-left: 25pt; - margin-right: -15mm; - margin-top: 0.5em; - margin-bottom: 0.5em; - text-indent: -3em; - padding-left: 3em; - line-height: 1.5; -} - -div.bnf span.texttt { font-family: 'Noto Sans Mono'; font-style: normal; } - -.rebnf { - font-family: 'Noto Serif'; - font-style: italic; - margin-top: 0.5em; - margin-bottom: 0.5em; - margin-left: 30pt; - text-indent: -3em; - padding-left: 3em; - line-height: 1.5; -} - -.simplebnf { - font-family: 'Noto Serif'; - font-style: italic; - font-size: 10pt; - margin-top: 0.5em; - margin-bottom: 0.5em; - margin-left: 30pt; - line-height: 1.5; -} - -span.textnormal { - font-style: normal; - font-family: 'Noto Serif'; - font-size: 10pt; - white-space: normal; -} - -.bnf span.textnormal { - font-style: normal; - font-family: 'Noto Serif'; - font-size: 10pt; - white-space: normal; -} - -p { - margin-top: 4pt; - margin-bottom: 4pt; -} - -span.rlap { - display: inline-block; - width: 0px; - text-indent: 0; -} - -span.terminal { - font-family: 'Noto Sans Mono'; - font-style: normal; - font-size: 9pt; - white-space: pre-wrap; -} - -span.noncxxterminal { - font-family: 'Noto Sans Mono'; - font-style: normal; - font-size: 9pt; -} - -span.term { font-style: italic; } -span.tcode { font-family: 'Noto Sans Mono'; font-style: normal; } -span.textbf { font-weight: bold; } -span.textsf { font-family: 'Noto Sans'; font-size: 10pt; } -div.footnote span.textsf { font-family: 'Noto Sans'; font-size: 8pt; } -.bnf span.textsf { font-family: 'Noto Sans'; font-size: 10pt; } -.simplebnf span.textsf { font-family: 'Noto Sans'; font-size: 10pt; } -.example span.textsf { font-family: 'Noto Sans'; font-size: 10pt; } -span.textsc { font-variant: small-caps; } -span.nontermdef { font-style: italic; font-family: 'Noto Sans'; font-size: 10pt; } -.rebnf a.nontermdef { font-style: italic; font-family: 'Noto Serif'; } -span.emph { font-style: italic; } -span.techterm { font-style: italic; } -span.mathit { font-style: italic; } -span.mathsf { font-family: 'Noto Sans'; } -span.mathrm { font-family: 'Noto Serif'; font-style: normal; } -span.textrm { font-family: 'Noto Serif'; font-size: 10pt; } -span.textsl { font-style: italic; } -span.mathtt { font-family: 'Noto Sans Mono'; font-style: normal; } -span.mbox { font-family: 'Noto Serif'; font-style: normal; } -span.ungap { display: inline-block; width: 2pt; } -span.texttt { font-family: 'Noto Sans Mono'; } -div.footnote span.texttt { font-family: 'Noto Sans Mono'; } -span.tcode_in_codeblock { font-family: 'Noto Sans Mono'; font-style: normal; font-size: 9pt; } - -span.phantom { color: white; } - /* Unfortunately, this way the text is still selectable. Another - option is display:none, but then we lose the nice layout. - Todo: find proper solution. */ - -span.math { - font-style: normal; - font-family: 'Noto Serif'; - font-size: 10pt; -} - -span.mathblock { - display: block; - margin-left: auto; - margin-right: auto; - margin-top: 1.2em; - margin-bottom: 1.2em; - text-align: center; -} - -span.mathalpha { - font-style: italic; -} - -span.synopsis { - font-weight: bold; - margin-top: 0.5em; - display: block; -} - -span.definition { - font-weight: bold; - display: block; -} - -.codeblock { - font-family: 'Noto Sans Mono'; - margin-left: 1.2em; - line-height: 1.5; - font-size: 9pt; - white-space: pre; - display: block; - margin-top: 3pt; - margin-bottom: 3pt; - overflow: auto; - margin-right: -15mm; -} - -table .codeblock { margin-right: 0; } - -.outputblock { - margin-left: 1.2em; - line-height: 1.5; - font-family: 'Noto Sans Mono'; - font-size: 9pt; -} - -code { - font-family: 'Noto Sans Mono'; - font-style: normal; -} - -div.itemdecl { - margin-top: 2ex; -} - -code.itemdeclcode { - white-space: pre; - font-family: 'Noto Sans Mono'; - font-size: 9pt; - display: block; - overflow: auto; - margin-right: -15mm; -} - -.comment { color: green; font-style: italic; font-family: 'Noto Serif'; font-size: 10pt; } -.footnote .comment { color: green; font-style: italic; font-family: 'Noto Serif'; font-size: 8pt; } -.example .comment { color: green; font-style: italic; font-family: 'Noto Serif'; font-size: 9pt; } -.note .comment { color: green; font-style: italic; font-family: 'Noto Serif'; font-size: 9pt; } - -span.keyword { color: #00607c; font-style: normal; } -span.parenthesis { color: #af1915; } -span.curlybracket { color: #af1915; } -span.squarebracket { color: #af1915; } -span.literal { color: #9F6807; } -span.literalterminal { color: #9F6807; font-family: 'Noto Sans Mono'; font-style: normal; } -span.operator { color: #570057; } -span.anglebracket { color: #570057; } -span.preprocessordirective { color: #6F4E37; } - -span.textsuperscript { - vertical-align: super; - font-size: smaller; - line-height: 0; -} - -.footnoteref { - vertical-align: super; - font-size: smaller; - line-height: 0; -} - -.footnote { - font-size: 8pt; -} - -.footnote .math { - font-size: 8pt; -} - -.footnotenum { - display: inline-block; - text-align: right; - margin-right: 1mm; - width: 4ch; -} - -.footnoteBacklink { - display: none; -} - -:target .footnoteBacklink { - display: inline-block; - text-align: right; - margin-right: 1mm; - width: 4ch; -} - -:target .footnotenum { - display: none; -} - -.footnoteSeparator { - background: black; - margin-top: 5mm; - height: 1px; - width: 6cm; -} - -div.minipage { - display: inline-block; - margin-right: 3em; -} - -div.numberedTable { - text-align: center; - margin-left: 1em; - margin-right: 1em; - margin-bottom: 12pt; - margin-top: 8pt; -} - -div.figure { - text-align: center; - margin-left: 2em; - margin-right: 2em; - margin-bottom: 12pt; - margin-top: 3pt; -} - -table { - border: 1px solid black; - border-collapse: collapse; - margin-left: auto; - margin-right: auto; - margin-top: 7pt; - text-align: left; -} - -td, th { - padding-left: 8pt; - padding-right: 8pt; - vertical-align: top; -} - -td.empty { - padding: 0px; - padding-left: 1px; -} - -td.left { - text-align: left; -} - -td.hidden { - padding: 0; - width: 0; -} - -td.right { - text-align: right; -} - -td.center { - text-align: center; -} - -td.justify { - text-align: justify; -} - -td.border { - border-left: 1px solid black; -} - -tr.rowsep, td.cline { - border-top: 1px solid black; -} - -tr.capsep { - border-top: 3px solid black; - border-top-style: double; -} - -th { - border-bottom: 1px solid black; -} - -span.centry { - font-weight: bold; -} - -div.table { - display: block; - margin-left: auto; - margin-right: auto; - text-align: center; - width: 90%; -} - -span.indented { - background: inherit; - display: block; - margin-left: 2em; - margin-bottom: 1em; - margin-top: 1em; -} - -span.uppercase { - text-transform: uppercase; -} - -span.ucode { - font-variant: small-caps; - text-transform: uppercase; - font-size: 90%; -} - -span.uname { - font-variant: small-caps; - text-transform: uppercase; - font-size: 90%; -} - -table.enumerate { - border: 0; - margin: 0; -} - -table.enumerate td { - padding: 0; -} - -table.enumerate td:first-child { - width: 1cm; - text-align: right; -} - -@media (prefers-color-scheme: dark) { - body { - background-color: #171717; - color: #b0b0b0; - } - - span.mjx-mstyle { color: #b0b0b0 !important } - - a:link { color: #549df2; } - a:visited { color: #a36ae6; } - - a.hidden_link { - text-decoration: none; - color: inherit; - } - - span.phantom { color: #171717; } - - :target { background-color: #3b4343; } - :target .codeblock { background-color: #3b4343; } - :target ul { background-color: #3b4343; } - a.index:before { color: #b0b0b0; background-color: #3b4343; } - - .comment { color: #35ba00; } - .footnote .comment { color: #35ba00; } - .example .comment { color: #35ba00; } - .note .comment { color: #35ba00; } - - span.keyword { color: #12cabe; } - span.parenthesis { color: #cf1915; } - span.curlybracket { color: #cf1915; } - span.squarebracket { color: #cf1915; } - span.literal { color: #bF8827; } - span.literalterminal { color: #bF8827; } - span.operator { color: #baa6b9; } - span.anglebracket { color: #baa6b9; } - span.preprocessordirective { color: #b27c58; } - - table { border-color: #b0b0b0; } - td.border { border-color: #b0b0b0; } - td.border { border-left-color: #b0b0b0; } - tr.rowsep, td.cline { border-top-color: #b0b0b0; } - tr.capsep { border-top-color: #b0b0b0; } - th { border-bottom-color: #b0b0b0; } - - .footnoteSeparator { background-color: #b0b0b0; } - - text { fill: #b0b0b0; } - path { stroke: #b0b0b0; } - polygon { stroke: #b0b0b0; fill: #b0b0b0; } - ellipse { stroke: #b0b0b0; } -} -.mjx-chtml {display: inline-block; line-height: 0; text-indent: 0; text-align: left; text-transform: none; font-style: normal; font-weight: normal; font-size: 100%; font-size-adjust: none; letter-spacing: normal; word-wrap: normal; word-spacing: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0; min-height: 0; border: 0; margin: 0; padding: 1px 0} -.MJXc-display {display: block;background:inherit; text-align: center; margin: 1em 0; padding: 0} -.mjx-chtml[tabindex]:focus, body :focus .mjx-chtml[tabindex] {display: inline-table} -.mjx-full-width {text-align: center; display: table-cell!important; width: 10000em} -.mjx-math {display: inline-block; border-collapse: separate; border-spacing: 0} -.mjx-math * {display: inline-block; -webkit-box-sizing: content-box!important; -moz-box-sizing: content-box!important; box-sizing: content-box!important; text-align: left} -.mjx-numerator {display: block;background:inherit; text-align: center} -.mjx-denominator {display: block;background:inherit; text-align: center} -.MJXc-stacked {height: 0; position: relative} -.MJXc-stacked > * {position: absolute} -.MJXc-bevelled > * {display: inline-block} -.mjx-stack {display: inline-block} -.mjx-op {display: block;background:inherit} -.mjx-under {display: table-cell} -.mjx-over {display: block;background:inherit} -.mjx-over > * {padding-left: 0px!important; padding-right: 0px!important} -.mjx-under > * {padding-left: 0px!important; padding-right: 0px!important} -.mjx-stack > .mjx-sup {display: block;background:inherit} -.mjx-stack > .mjx-sub {display: block;background:inherit} -.mjx-prestack > .mjx-presup {display: block;background:inherit} -.mjx-prestack > .mjx-presub {display: block;background:inherit} -.mjx-delim-h > .mjx-char {display: inline-block} -.mjx-surd {vertical-align: top} -.mjx-surd + .mjx-box {display: inline-flex} -.mjx-mphantom * {visibility: hidden} -.mjx-merror {background-color: #FFFF88; color: #CC0000; border: 1px solid #CC0000; padding: 2px 3px; font-style: normal; font-size: 90%} -.mjx-annotation-xml {line-height: normal} -.mjx-menclose > svg {fill: none; stroke: currentColor; overflow: visible} -.mjx-mtr {display: table-row} -.mjx-mlabeledtr {display: table-row} -.mjx-mtd {display: table-cell; text-align: center} -.mjx-label {display: table-row} -.mjx-box {display: inline-block} -.mjx-block {display: block;background:inherit} -.mjx-span {display: inline} -.mjx-char {display: block;background:inherit; white-space: pre} -.mjx-itable {display: inline-table; width: auto} -.mjx-row {display: table-row} -.mjx-cell {display: table-cell} -.mjx-table {display: table; width: 100%} -.mjx-line {display: block;background:inherit; height: 0} -.mjx-strut {width: 0; padding-top: 1em} -.mjx-vsize {width: 0} -.MJXc-space1 {margin-left: .167em} -.MJXc-space2 {margin-left: .222em} -.MJXc-space3 {margin-left: .278em} -.mjx-test.mjx-test-display {display: table!important} -.mjx-test.mjx-test-inline {display: inline!important; margin-right: -1px} -.mjx-test.mjx-test-default {display: block;background:inherit!important; clear: both} -.mjx-ex-box {display: inline-block!important; position: absolute; overflow: hidden; min-height: 0; max-height: none; padding: 0; border: 0; margin: 0; width: 1px; height: 60ex} -.mjx-test-inline .mjx-left-box {display: inline-block; width: 0; float: left} -.mjx-test-inline .mjx-right-box {display: inline-block; width: 0; float: right} -.mjx-test-display .mjx-right-box {display: table-cell!important; width: 10000em!important; min-width: 0; max-width: none; padding: 0; border: 0; margin: 0} -.MJXc-TeX-unknown-R {font-family: monospace; font-style: normal; font-weight: normal} -.MJXc-TeX-unknown-I {font-family: monospace; font-style: italic; font-weight: normal} -.MJXc-TeX-unknown-B {font-family: monospace; font-style: normal; font-weight: bold} -.MJXc-TeX-unknown-BI {font-family: monospace; font-style: italic; font-weight: bold} -.MJXc-TeX-ams-R {font-family: MJXc-TeX-ams-R,MJXc-TeX-ams-Rw} -.MJXc-TeX-cal-B {font-family: MJXc-TeX-cal-B,MJXc-TeX-cal-Bx,MJXc-TeX-cal-Bw} -.MJXc-TeX-frak-R {font-family: MJXc-TeX-frak-R,MJXc-TeX-frak-Rw} -.MJXc-TeX-frak-B {font-family: MJXc-TeX-frak-B,MJXc-TeX-frak-Bx,MJXc-TeX-frak-Bw} -.MJXc-TeX-math-BI {font-family: MJXc-TeX-math-BI,MJXc-TeX-math-BIx,MJXc-TeX-math-BIw} -.MJXc-TeX-sans-R {font-family: 'Noto Sans'; font-size: 10pt; } -.MJXc-TeX-sans-B {font-family: MJXc-TeX-sans-B,MJXc-TeX-sans-Bx,MJXc-TeX-sans-Bw} -.MJXc-TeX-sans-I {font-family: MJXc-TeX-sans-I,MJXc-TeX-sans-Ix,MJXc-TeX-sans-Iw} -.MJXc-TeX-script-R {font-family: MJXc-TeX-script-R,MJXc-TeX-script-Rw} -.MJXc-TeX-type-R {font-family: 'Noto Sans Mono'; font-size: 10pt; } -.MJXc-TeX-cal-R {font-family: MJXc-TeX-cal-R,MJXc-TeX-cal-Rw} -.MJXc-TeX-main-B {font-family: MJXc-TeX-main-B,MJXc-TeX-main-Bx,MJXc-TeX-main-Bw} -.MJXc-TeX-main-I {font-style: italic} -.MJXc-TeX-main-R {} -.MJXc-TeX-math-I {font-style: italic} -.MJXc-TeX-size1-R {font-family: MJXc-TeX-size1-R,MJXc-TeX-size1-Rw} -.MJXc-TeX-size2-R {font-family: MJXc-TeX-size2-R,MJXc-TeX-size2-Rw} -.MJXc-TeX-size3-R {font-family: MJXc-TeX-size3-R,MJXc-TeX-size3-Rw} -.MJXc-TeX-size4-R {font-family: MJXc-TeX-size4-R,MJXc-TeX-size4-Rw} -.MJXc-TeX-vec-R {font-family: MJXc-TeX-vec-R,MJXc-TeX-vec-Rw} -.MJXc-TeX-vec-B {font-family: MJXc-TeX-vec-B,MJXc-TeX-vec-Bx,MJXc-TeX-vec-Bw} -@font-face {font-family: MJXc-TeX-ams-R; src: local('MathJax_AMS'), local('MathJax_AMS-Regular')} -@font-face {font-family: MJXc-TeX-ams-Rw; src /*1*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/eot/MathJax_AMS-Regular.eot'); src /*2*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/woff/MathJax_AMS-Regular.woff') format('woff'), url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_AMS-Regular.otf') format('opentype')} -@font-face {font-family: MJXc-TeX-cal-B; src: local('MathJax_Caligraphic Bold'), local('MathJax_Caligraphic-Bold')} -@font-face {font-family: MJXc-TeX-cal-Bx; src: local('MathJax_Caligraphic'); font-weight: bold} -@font-face {font-family: MJXc-TeX-cal-Bw; src /*1*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/eot/MathJax_Caligraphic-Bold.eot'); src /*2*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/woff/MathJax_Caligraphic-Bold.woff') format('woff'), url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Caligraphic-Bold.otf') format('opentype')} -@font-face {font-family: MJXc-TeX-frak-R; src: local('MathJax_Fraktur'), local('MathJax_Fraktur-Regular')} -@font-face {font-family: MJXc-TeX-frak-Rw; src /*1*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/eot/MathJax_Fraktur-Regular.eot'); src /*2*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/woff/MathJax_Fraktur-Regular.woff') format('woff'), url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Fraktur-Regular.otf') format('opentype')} -@font-face {font-family: MJXc-TeX-frak-B; src: local('MathJax_Fraktur Bold'), local('MathJax_Fraktur-Bold')} -@font-face {font-family: MJXc-TeX-frak-Bx; src: local('MathJax_Fraktur'); font-weight: bold} -@font-face {font-family: MJXc-TeX-frak-Bw; src /*1*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/eot/MathJax_Fraktur-Bold.eot'); src /*2*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/woff/MathJax_Fraktur-Bold.woff') format('woff'), url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Fraktur-Bold.otf') format('opentype')} -@font-face {font-family: MJXc-TeX-math-BI; src: local('MathJax_Math BoldItalic'), local('MathJax_Math-BoldItalic')} -@font-face {font-family: MJXc-TeX-math-BIx; src: local('MathJax_Math'); font-weight: bold; font-style: italic} -@font-face {font-family: MJXc-TeX-math-BIw; src /*1*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/eot/MathJax_Math-BoldItalic.eot'); src /*2*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/woff/MathJax_Math-BoldItalic.woff') format('woff'), url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Math-BoldItalic.otf') format('opentype')} -@font-face {font-family: MJXc-TeX-sans-R; src: local('MathJax_SansSerif'), local('MathJax_SansSerif-Regular')} -@font-face {font-family: MJXc-TeX-sans-Rw; src /*1*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/eot/MathJax_SansSerif-Regular.eot'); src /*2*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/woff/MathJax_SansSerif-Regular.woff') format('woff'), url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_SansSerif-Regular.otf') format('opentype')} -@font-face {font-family: MJXc-TeX-sans-B; src: local('MathJax_SansSerif Bold'), local('MathJax_SansSerif-Bold')} -@font-face {font-family: MJXc-TeX-sans-Bx; src: local('MathJax_SansSerif'); font-weight: bold} -@font-face {font-family: MJXc-TeX-sans-Bw; src /*1*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/eot/MathJax_SansSerif-Bold.eot'); src /*2*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/woff/MathJax_SansSerif-Bold.woff') format('woff'), url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_SansSerif-Bold.otf') format('opentype')} -@font-face {font-family: MJXc-TeX-sans-I; src: local('MathJax_SansSerif Italic'), local('MathJax_SansSerif-Italic')} -@font-face {font-family: MJXc-TeX-sans-Ix; src: local('MathJax_SansSerif'); font-style: italic} -@font-face {font-family: MJXc-TeX-sans-Iw; src /*1*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/eot/MathJax_SansSerif-Italic.eot'); src /*2*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/woff/MathJax_SansSerif-Italic.woff') format('woff'), url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_SansSerif-Italic.otf') format('opentype')} -@font-face {font-family: MJXc-TeX-script-R; src: local('MathJax_Script'), local('MathJax_Script-Regular')} -@font-face {font-family: MJXc-TeX-script-Rw; src /*1*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/eot/MathJax_Script-Regular.eot'); src /*2*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/woff/MathJax_Script-Regular.woff') format('woff'), url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Script-Regular.otf') format('opentype')} -@font-face {font-family: MJXc-TeX-type-R; src: local('MathJax_Typewriter'), local('MathJax_Typewriter-Regular')} -@font-face {font-family: MJXc-TeX-type-Rw; src /*1*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/eot/MathJax_Typewriter-Regular.eot'); src /*2*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/woff/MathJax_Typewriter-Regular.woff') format('woff'), url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Typewriter-Regular.otf') format('opentype')} -@font-face {font-family: MJXc-TeX-cal-R; src: local('MathJax_Caligraphic'), local('MathJax_Caligraphic-Regular')} -@font-face {font-family: MJXc-TeX-cal-Rw; src /*1*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/eot/MathJax_Caligraphic-Regular.eot'); src /*2*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/woff/MathJax_Caligraphic-Regular.woff') format('woff'), url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Caligraphic-Regular.otf') format('opentype')} -@font-face {font-family: MJXc-TeX-main-B; src: local('MathJax_Main Bold'), local('MathJax_Main-Bold')} -@font-face {font-family: MJXc-TeX-main-Bx; src: local('MathJax_Main'); font-weight: bold} -@font-face {font-family: MJXc-TeX-main-Bw; src /*1*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/eot/MathJax_Main-Bold.eot'); src /*2*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/woff/MathJax_Main-Bold.woff') format('woff'), url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Main-Bold.otf') format('opentype')} -@font-face {font-family: MJXc-TeX-main-I; src: local('MathJax_Main Italic'), local('MathJax_Main-Italic')} -@font-face {font-family: MJXc-TeX-main-Ix; src: local('MathJax_Main'); font-style: italic} -@font-face {font-family: MJXc-TeX-main-Iw; src /*1*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/eot/MathJax_Main-Italic.eot'); src /*2*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/woff/MathJax_Main-Italic.woff') format('woff'), url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Main-Italic.otf') format('opentype')} -@font-face {font-family: MJXc-TeX-main-R; src: local('MathJax_Main'), local('MathJax_Main-Regular')} -@font-face {font-family: MJXc-TeX-main-Rw; src /*1*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/eot/MathJax_Main-Regular.eot'); src /*2*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/woff/MathJax_Main-Regular.woff') format('woff'), url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Main-Regular.otf') format('opentype')} -@font-face {font-family: MJXc-TeX-math-I; src: local('MathJax_Math Italic'), local('MathJax_Math-Italic')} -@font-face {font-family: MJXc-TeX-math-Ix; src: local('MathJax_Math'); font-style: italic} -@font-face {font-family: MJXc-TeX-math-Iw; src /*1*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/eot/MathJax_Math-Italic.eot'); src /*2*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/woff/MathJax_Math-Italic.woff') format('woff'), url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Math-Italic.otf') format('opentype')} -@font-face {font-family: MJXc-TeX-size1-R; src: local('MathJax_Size1'), local('MathJax_Size1-Regular')} -@font-face {font-family: MJXc-TeX-size1-Rw; src /*1*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/eot/MathJax_Size1-Regular.eot'); src /*2*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/woff/MathJax_Size1-Regular.woff') format('woff'), url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Size1-Regular.otf') format('opentype')} -@font-face {font-family: MJXc-TeX-size2-R; src: local('MathJax_Size2'), local('MathJax_Size2-Regular')} -@font-face {font-family: MJXc-TeX-size2-Rw; src /*1*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/eot/MathJax_Size2-Regular.eot'); src /*2*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/woff/MathJax_Size2-Regular.woff') format('woff'), url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Size2-Regular.otf') format('opentype')} -@font-face {font-family: MJXc-TeX-size3-R; src: local('MathJax_Size3'), local('MathJax_Size3-Regular')} -@font-face {font-family: MJXc-TeX-size3-Rw; src /*1*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/eot/MathJax_Size3-Regular.eot'); src /*2*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/woff/MathJax_Size3-Regular.woff') format('woff'), url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Size3-Regular.otf') format('opentype')} -@font-face {font-family: MJXc-TeX-size4-R; src: local('MathJax_Size4'), local('MathJax_Size4-Regular')} -@font-face {font-family: MJXc-TeX-size4-Rw; src /*1*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/eot/MathJax_Size4-Regular.eot'); src /*2*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/woff/MathJax_Size4-Regular.woff') format('woff'), url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Size4-Regular.otf') format('opentype')} -@font-face {font-family: MJXc-TeX-vec-R; src: local('MathJax_Vector'), local('MathJax_Vector-Regular')} -@font-face {font-family: MJXc-TeX-vec-Rw; src /*1*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/eot/MathJax_Vector-Regular.eot'); src /*2*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/woff/MathJax_Vector-Regular.woff') format('woff'), url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Vector-Regular.otf') format('opentype')} -@font-face {font-family: MJXc-TeX-vec-B; src: local('MathJax_Vector Bold'), local('MathJax_Vector-Bold')} -@font-face {font-family: MJXc-TeX-vec-Bx; src: local('MathJax_Vector'); font-weight: bold} -@font-face {font-family: MJXc-TeX-vec-Bw; src /*1*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/eot/MathJax_Vector-Bold.eot'); src /*2*/: url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/woff/MathJax_Vector-Bold.woff') format('woff'), url('https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Vector-Bold.otf') format('opentype')} - diff --git a/HEAD/api_reference/gen/assoc.qty.html b/HEAD/api_reference/gen/assoc.qty.html deleted file mode 100644 index 41bc64a1..00000000 --- a/HEAD/api_reference/gen/assoc.qty.html +++ /dev/null @@ -1,35 +0,0 @@ -[assoc.qty]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.4 Unit [qty.unit]

5.4.4.9 Associated quantity [assoc.qty]

template<Unit U> -consteval bool has-associated-quantity(U); // exposition only -
Returns:
  • If U​::​quantity-spec is a valid expression, -returns true.
  • Otherwise, if U​::​reference-unit is a valid expression, -returns -has-associated-quantity(U::reference-unit) -
  • Otherwise, if -is-derived-from-specialization-of<U, expr-fractions>() -is true, -let Nums and Dens -be packs denoting the template arguments of -U​::​nums and U​::​dens, respectively.
    Returns -(... && has-associated-quantity(expr-type<Nums>{})) && - (... && has-associated-quantity(expr-type<Dens>{})) -
  • Otherwise, returns false.
template<AssociatedUnit U> -consteval auto get-associated-quantity(U u); // exposition only -
Returns:
  • If U is of the form common_unit<Us...>, -returns -get_common_quantity_spec(get-associated-quantity(Us{})...) -
  • Otherwise, if U​::​quantity-spec is a valid expression, -returns -remove-kind(U::quantity-spec) -
  • Otherwise, if U​::​reference-unit is a valid expression, -returns -get-associated-quantity(U::reference-unit) -
  • Otherwise, if -is-derived-from-specialization-of<U, expr-fractions>() -is true, -returns -expr-map<to-quantity-spec, derived_quantity_spec, struct dimensionless>(u) - -where to-quantity-spec is defined as follows: -template<AssociatedUnit U> -using to-quantity-spec = decltype(get-associated-quantity(U{})); // exposition only -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/colored.css b/HEAD/api_reference/gen/colored.css deleted file mode 100644 index 6bb1a3af..00000000 --- a/HEAD/api_reference/gen/colored.css +++ /dev/null @@ -1,15 +0,0 @@ -div.example { - display: block; - margin-top: 5pt; - margin-bottom: 5pt; - font-size: 11pt; - color: #bb00bb; -} - -div.note { - display: block; - margin-top: 5pt; - margin-bottom: 5pt; - font-size: 11pt; - color: #bb00bb; -} diff --git a/HEAD/api_reference/gen/conceptindex.html b/HEAD/api_reference/gen/conceptindex.html deleted file mode 100644 index 54e4700d..00000000 --- a/HEAD/api_reference/gen/conceptindex.html +++ /dev/null @@ -1 +0,0 @@ -14882: Index of library concepts

Index of library concepts

CommonlyInvocableQuantities, [qty.syn], [qty.syn], [qty.arith.ops]
ComplexRepresentation, [qty.rep.concepts], [qty.rep.concepts]
DimensionOf, [qty.dim.concepts]
HaveCommonReference, [qty.syn], [qty.syn]
InvocableQuantities, [qty.syn], [qty.syn], [qty.arith.ops]
IsFloatingPoint, [qty.syn], [qty.syn]
PotentiallyConvertibleTo, [qty.unit.concepts], [qty.unit.cmp]
QuantitySpecExplicitlyConvertibleTo, [qty.spec.concepts], [named.qty], [qty.spec.ops]
ScalarRepresentation, [qty.rep.concepts], [qty.rep.concepts]
VectorRepresentation, [qty.rep.concepts], [qty.rep.concepts]
\ No newline at end of file diff --git a/HEAD/api_reference/gen/defs.html b/HEAD/api_reference/gen/defs.html deleted file mode 100644 index 1a8e1f7b..00000000 --- a/HEAD/api_reference/gen/defs.html +++ /dev/null @@ -1,12 +0,0 @@ -[defs]

3 Terms and definitions [defs]

For the purposes of this document, -the terms and definitions given in -IEC 60050-102:2007/AMD3:2021, -IEC 60050-112:2010/AMD2:2020, -ISO 80000-2:2019, -and -N4971, -and the following apply.
ISO and IEC maintain terminology databases -for use in standardization -at the following addresses: - -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/derived.qty.html b/HEAD/api_reference/gen/derived.qty.html deleted file mode 100644 index d3796576..00000000 --- a/HEAD/api_reference/gen/derived.qty.html +++ /dev/null @@ -1,38 +0,0 @@ -[derived.qty]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.3 Quantity specification [qty.spec]

5.4.3.3 Types [qty.spec.types]

5.4.3.3.2 Derived [derived.qty]

namespace mp_units { - -template<NamedQuantitySpec Q> -using to-dimension = decltype(auto(Q::dimension)); // exposition only - -template<typename... Expr> -struct derived-quantity-spec-impl : // exposition only - quantity-spec-interface, - expr-fractions<struct dimensionless, Expr...> { - using base-type = derived-quantity-spec-impl; - using base = expr-fractions<struct dimensionless, Expr...>; - - static constexpr Dimension auto dimension = - expr-map<to-dimension, derived_dimension, struct dimension_one>(base{}); - static constexpr quantity_character character = see below; -}; - -template<SymbolicConstant... Expr> -struct derived_quantity_spec final : derived-quantity-spec-impl<Expr...> {}; - -} -
derived_quantity_spec is used by the library -to represent the result of a quantity calculus not equal to a named quantity.
[Example 1: constexpr auto area = pow<2>(isq::length); -int x = area; // error: cannot construct from derived_quantity_spec<power<isq​::​length, 2>> - — end example]
-A program that instantiates a specialization of derived_quantity_spec -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
Let -
  • Nums and Dens -be packs denoting the template arguments of -base​::​nums and base​::​dens, respectively,
  • QUANTITY-CHARACTER-OF(Pack) be -std::max({quantity_character::real_scalar, expr-type<Pack>::character...}) - -and
  • num_char be QUANTITY-CHARACTER-OF(Nums) and -den_char be QUANTITY-CHARACTER-OF(Dens).
-The member character is equal to -quantity_character​::​real_scalar if num_char == den_char is true, and -std​::​max(num_char, den_char) otherwise.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/dimless.qty.html b/HEAD/api_reference/gen/dimless.qty.html deleted file mode 100644 index 7b35d6b6..00000000 --- a/HEAD/api_reference/gen/dimless.qty.html +++ /dev/null @@ -1,6 +0,0 @@ -[dimless.qty]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.3 Quantity specification [qty.spec]

5.4.3.3 Types [qty.spec.types]

5.4.3.3.3 Base quantity of dimension one [dimless.qty]

namespace mp_units { - -struct dimensionless final : quantity_spec<derived_quantity_spec<>> {}; - -} -
dimensionless represents the base quantity of dimension one (IEC 60050, 112-01-13).
\ No newline at end of file diff --git a/HEAD/api_reference/gen/expanded.css b/HEAD/api_reference/gen/expanded.css deleted file mode 100644 index 69a9ae3a..00000000 --- a/HEAD/api_reference/gen/expanded.css +++ /dev/null @@ -1,22 +0,0 @@ -div.example { - display: block; - margin-top: 5pt; - margin-bottom: 5pt; - font-size: 9pt; -} - -div.note { - display: block; - margin-top: 5pt; - margin-bottom: 5pt; - font-size: 9pt; -} - -div.note .texttt { font-size: 9pt; } -div.example .texttt { font-size: 9pt; } - -div.note .textsf { font-family: 'Noto Sans'; font-size: 9pt; } -div.example .textsf { font-family: 'Noto Sans'; font-size: 9pt; } - -div.note .math { font-size: 9pt; } -div.example .math { font-size: 9pt; } diff --git a/HEAD/api_reference/gen/fig.html b/HEAD/api_reference/gen/fig.html deleted file mode 100644 index c2875ab6..00000000 --- a/HEAD/api_reference/gen/fig.html +++ /dev/null @@ -1 +0,0 @@ -14882: Figures

Figures [fig]

\ No newline at end of file diff --git a/HEAD/api_reference/gen/footnotes.html b/HEAD/api_reference/gen/footnotes.html deleted file mode 100644 index 63df5bde..00000000 --- a/HEAD/api_reference/gen/footnotes.html +++ /dev/null @@ -1 +0,0 @@ -14882: Footnotes

List of Footnotes

\ No newline at end of file diff --git a/HEAD/api_reference/gen/full.html b/HEAD/api_reference/gen/full.html deleted file mode 100644 index 464d0f96..00000000 --- a/HEAD/api_reference/gen/full.html +++ /dev/null @@ -1,3499 +0,0 @@ -14882

1 Scope [scope]

This document describes the contents of the mp-units library.

2 References [refs]

The following documents are referred to in the text -in such a way that some or all of their content -constitutes requirements of this document.
For dated references, only the edition cited applies.
For undated references, -the latest edition of the referenced document -(including any amendments) applies.
  • IEC 60050-102:2007/AMD3:2021, -Amendment 3 — International Electrotechnical Vocabulary (IEV) — -Part 102: Mathematics — General concepts and linear algebra
  • IEC 60050-112:2010/AMD2:2020, -Amendment 2 — International Electrotechnical Vocabulary (IEV) — -Part 112: Quantities and units
  • ISO 80000 (all parts), Quantities and units
  • The C++ Standards Committee.
    N4971: Working Draft, Standard for Programming Language C++.
    Edited by Thomas Köppe.
    Available from: https://wg21.link/N4971
  • The C++ Standards Committee.
    P3094R5: std​::​basic_fixed_string.
    Edited by Mateusz Pusz.
  • The C++ Standards Committee.
    SD-8: Standard Library Compatibility.
    Edited by Bryce Lelbach.
    Available from: https://wg21.link/SD8

3 Terms and definitions [defs]

For the purposes of this document, -the terms and definitions given in -IEC 60050-102:2007/AMD3:2021, -IEC 60050-112:2010/AMD2:2020, -ISO 80000-2:2019, -and -N4971, -and the following apply.
ISO and IEC maintain terminology databases -for use in standardization -at the following addresses: - -

4 Specification [spec]

4.1 External [spec.ext]

The specification of the mp-units library subsumes -N4971, [description], N4971, [requirements], N4971, [concepts.equality], and SD-8, -all assumingly amended for the context of this library.
[Note 1: 
This means that, non exhaustively, -
  • ​::​mp_units2 is a reserved namespace, and
  • std​::​vector<mp_units​::​type> -is a program-defined specialization and a library-defined specialization -from the point of view of the C++ standard library and the mp-units library, respectively.
— end note]
The mp-units library is not part of the C++ implementation.

4.2 Categories [spec.cats]

Detailed specifications for each of the components in the library are in -[quantities][quantities], -as shown in Table 1.
Table 1: Library categories [tab:lib.cats]
Clause
Category
Quantities library
The quantities library ([quantities]) -describes components for dealing with quantities.

4.3 Modules [spec.mods]

The mp-units library provides the -mp-units modules, -shown in Table 2.
Table 2: mp-units modules [tab:modules]
mp_units
mp_units.core
mp_units.systems

4.4 Library-wide requirements [spec.reqs]

4.4.1 Reserved names [spec.res.names]

The mp-units library reserves macro names that start with -MP_UNITSdigit-sequence_.

5 Quantities and units library [quantities]

5.1 Summary [quantities.summary]

This Clause describes components for dealing with quantities and units, -as summarized in Table 3.
Table 3: Quantities and units library summary [tab:quantities.summary]
Subclause
Module
Utilities
mp_units.core
Reference
Representation
Quantity
Quantity point
Systems
mp_units.systems
std​::​chrono interoperability
-
[Editor's note: -Following the SG16 recommendation at https://lists.isocpp.org/sg16/2024/10/4490.php, -the universal-character-names should be replaced by their UTF-8 code points. -]

5.2 mp-units module synopses [mp.units.syns]

5.2.1 Module mp_units synopsis [mp.units.syn]

export module mp_units; - -export import mp_units.core; -export import mp_units.systems; -

5.2.2 Module mp_units.core synopsis [mp.units.core.syn]

// mostly freestanding -export module mp_units.core; - -import std; - -export namespace mp_units { - -// [qty.utils], utilities - -// [qty.sym.txt], symbol text - -enum class character_set : std::int8_t { utf8, portable, default_character_set = utf8 }; - -template<std::size_t N, std::size_t M> -class symbol_text; - -// [qty.sym.expr], symbolic expressions - -// [qty.sym.expr.types], types - -template<typename T, typename... Ts> -struct per; - -template<typename F, int Num, int... Den> - requires see below -struct power; - -// [qty.ref], reference - -// [qty.dim], dimension - -// [qty.dim.concepts], concepts - -template<typename T> -concept Dimension = see below; - -template<typename T, auto D> -concept DimensionOf = see below; - -// [qty.dim.types], types - -template<symbol_text Symbol> -struct base_dimension; - -template<SymbolicConstant... Expr> -struct derived_dimension; - -struct dimension_one; -inline constexpr dimension_one dimension_one{}; - -// [qty.dim.ops], operations - -consteval Dimension auto inverse(Dimension auto d); - -template<std::intmax_t Num, std::intmax_t Den = 1, Dimension D> - requires(Den != 0) -consteval Dimension auto pow(D d); -consteval Dimension auto sqrt(Dimension auto d); -consteval Dimension auto cbrt(Dimension auto d); - -// [qty.dim.sym.fmt], symbol formatting - -struct dimension_symbol_formatting { - character_set char_set = character_set::default_character_set; -}; - -template<typename CharT = char, std::output_iterator<CharT> Out, Dimension D> -constexpr Out dimension_symbol_to(Out out, D d, const dimension_symbol_formatting& fmt = {}); - -template<dimension_symbol_formatting fmt = {}, typename CharT = char, Dimension D> -consteval std::string_view dimension_symbol(D); - -// [qty.spec], quantity specification - -// [qty.spec.concepts], concepts - -template<typename T> -concept QuantitySpec = see below; - -template<typename T, auto QS> -concept QuantitySpecOf = see below; - -// [qty.spec.types], types - -// [named.qty], named - -struct is_kind; -inline constexpr is_kind is_kind{}; - -template<auto...> -struct quantity_spec; // not defined - -template<BaseDimension auto Dim, QSProperty auto... Args> -struct quantity_spec<Dim, Args...>; - -template<DerivedQuantitySpec auto Eq, QSProperty auto... Args> -struct quantity_spec<Eq, Args...>; - -template<NamedQuantitySpec auto QS, QSProperty auto... Args> -struct quantity_spec<QS, Args...>; - -template<NamedQuantitySpec auto QS, DerivedQuantitySpec auto Eq, QSProperty auto... Args> -struct quantity_spec<QS, Eq, Args...>; - -// [derived.qty], derived - -template<SymbolicConstant... Expr> -struct derived_quantity_spec; - -// [dimless.qty], base quantity of dimension one - -struct dimensionless; -inline constexpr dimensionless dimensionless{}; - -// [kind.of.qty], kind of - -template<QuantitySpec Q> - requires see below -struct kind_of_; -template<QuantitySpec auto Q> - requires requires { typename kind_of_<decltype(Q)>; } -inline constexpr kind_of_<decltype(Q)> kind_of{}; - -// [qty.spec.ops], operations - -consteval QuantitySpec auto inverse(QuantitySpec auto q); - -template<std::intmax_t Num, std::intmax_t Den = 1, QuantitySpec Q> - requires(Den != 0) -consteval QuantitySpec auto pow(Q q); -consteval QuantitySpec auto sqrt(QuantitySpec auto q); -consteval QuantitySpec auto cbrt(QuantitySpec auto q); - -// [qty.spec.hier.algos], hierarchy algorithms - -// [qty.spec.conv], conversion - -consteval bool implicitly_convertible(QuantitySpec auto from, QuantitySpec auto to); -consteval bool explicitly_convertible(QuantitySpec auto from, QuantitySpec auto to); -consteval bool castable(QuantitySpec auto from, QuantitySpec auto to); -consteval bool interconvertible(QuantitySpec auto qs1, QuantitySpec auto qs2); - -// [qty.get.kind], get_kind - -template<QuantitySpec Q> -consteval see below get_kind(Q); - -// [get.common.qty.spec], get_common_quantity_spec - -consteval QuantitySpec auto get_common_quantity_spec(QuantitySpec auto... qs) - requires see below; - -// [qty.unit], unit - -// [qty.unit.mag], magnitude - -// [qty.unit.mag.concepts], concepts - -template<typename T> -concept MagConstant = see below; - -template<typename T> -concept UnitMagnitude = see below; - -// [qty.unit.mag.types], types - -template<symbol_text Symbol, long double Value> - requires(Value > 0) -struct mag_constant; - -// [qty.unit.mag.ops], operations - -template<MagArg auto V> -constexpr UnitMagnitude auto mag = see below; - -template<std::intmax_t N, std::intmax_t D> - requires(N > 0) -constexpr UnitMagnitude auto mag_ratio = see below; - -template<MagArg auto Base, int Num, int Den = 1> -constexpr UnitMagnitude auto mag_power = see below; - -// constants - -inline constexpr struct pi final : - mag_constant<{u8"\u03C0" /* U+03c0 GREEK SMALL LETTER PI */, "pi"}, - std::numbers::pi_v<long double>> { -} pi; - -inline constexpr auto \u03C0 /* U+03c0 GREEK SMALL LETTER PI */ = pi; - -// [qty.unit.traits], traits - -template<Unit auto U> -constexpr bool space_before_unit_symbol = true; - -template<> -inline constexpr bool space_before_unit_symbol<one> = false; - -// [qty.unit.concepts], concepts - -template<typename T> -concept Unit = see below; - -template<typename T> -concept PrefixableUnit = see below; - -template<typename T> -concept AssociatedUnit = see below; - -template<typename U, auto QS> -concept UnitOf = see below; - -// [qty.unit.types], types - -// [qty.scaled.unit], scaled - -template<UnitMagnitude auto M, Unit U> - requires see below -struct scaled_unit; - -// [qty.named.unit], named - -template<symbol_text Symbol, auto...> -struct named_unit; // not defined - -template<symbol_text Symbol, QuantityKindSpec auto QS> - requires see below -struct named_unit<Symbol, QS>; - -template<symbol_text Symbol, QuantityKindSpec auto QS, PointOrigin auto PO> - requires see below -struct named_unit<Symbol, QS, PO>; - -template<symbol_text Symbol> - requires see below -struct named_unit<Symbol>; - -template<symbol_text Symbol, Unit auto U> - requires see below -struct named_unit<Symbol, U>; - -template<symbol_text Symbol, Unit auto U, PointOrigin auto PO> - requires see below -struct named_unit<Symbol, U, PO>; - -template<symbol_text Symbol, AssociatedUnit auto U, QuantityKindSpec auto QS> - requires see below -struct named_unit<Symbol, U, QS>; - -template<symbol_text Symbol, AssociatedUnit auto U, QuantityKindSpec auto QS, - PointOrigin auto PO> - requires see below -struct named_unit<Symbol, U, QS, PO>; - -// [qty.prefixed.unit], prefixed - -template<symbol_text Symbol, UnitMagnitude auto M, PrefixableUnit auto U> - requires see below -struct prefixed_unit; - -// [qty.common.unit], common - -template<Unit U1, Unit U2, Unit... Rest> -struct common_unit; - -// [qty.derived.unit], derived - -template<SymbolicConstant... Expr> -struct derived_unit; - -// [qty.unit.one], one - -struct one; -inline constexpr one one{}; - -// named derived units of a quantity of dimension one - -inline constexpr struct percent final : named_unit<"%", mag_ratio<1, 100> * one> { -} percent; - -inline constexpr struct per_mille final : - named_unit<symbol_text{u8"\u2030" /* U+2030 PER MILLE SIGN */, "%o"}, - mag_ratio<1, 1000> * one> { -} per_mille; - -inline constexpr struct parts_per_million final : - named_unit<"ppm", mag_ratio<1, 1'000'000> * one> { -} parts_per_million; - -inline constexpr auto ppm = parts_per_million; - -// [qty.unit.ops], operations - -consteval Unit auto inverse(Unit auto u); - -template<std::intmax_t Num, std::intmax_t Den = 1, Unit U> - requires see below -consteval Unit auto pow(U u); -consteval Unit auto sqrt(Unit auto u); -consteval Unit auto cbrt(Unit auto u); -consteval Unit auto square(Unit auto u); -consteval Unit auto cubic(Unit auto u); - -// [qty.unit.cmp], comparison - -template<Unit From, Unit To> -consteval bool convertible(From from, To to); - -// [qty.unit.obs], observers - -consteval QuantitySpec auto get_quantity_spec(AssociatedUnit auto u); -consteval Unit auto get_unit(AssociatedUnit auto u); - -consteval Unit auto get_common_unit(Unit auto... us) - requires see below; - -// [qty.unit.sym.fmt], symbol formatting - -enum class unit_symbol_solidus : std::int8_t { - one_denominator, - always, - never, - default_denominator = one_denominator -}; - -enum class unit_symbol_separator : std::int8_t { - space, - half_high_dot, - default_separator = space -}; - -struct unit_symbol_formatting { - character_set char_set = character_set::default_character_set; - unit_symbol_solidus solidus = unit_symbol_solidus::default_denominator; - unit_symbol_separator separator = unit_symbol_separator::default_separator; -}; - -template<typename CharT = char, std::output_iterator<CharT> Out, Unit U> -constexpr Out unit_symbol_to(Out out, U u, const unit_symbol_formatting& fmt = {}); - -template<unit_symbol_formatting fmt = {}, typename CharT = char, Unit U> -consteval std::string_view unit_symbol(U); - -// [qty.ref.concepts], concepts - -template<typename T> -concept Reference = see below; - -template<typename T, auto QS> -concept ReferenceOf = see below; - -// [qty.ref.syn], class template reference - -template<QuantitySpec Q, Unit U> -struct reference; - -// [qty.ref.ops], operations - -template<typename FwdRep, Reference R, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> - requires(!OffsetUnit<decltype(get_unit(R{}))>) -constexpr quantity<R{}, Rep> operator*(FwdRep&& lhs, R r); - -template<typename FwdRep, Reference R, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> - requires(!OffsetUnit<decltype(get_unit(R{}))>) -constexpr Quantity auto operator/(FwdRep&& lhs, R); - -template<typename FwdQ, Reference R, Quantity Q = std::remove_cvref_t<FwdQ>> -constexpr Quantity auto operator*(FwdQ&& q, R); - -template<typename FwdQ, Reference R, Quantity Q = std::remove_cvref_t<FwdQ>> -constexpr Quantity auto operator/(FwdQ&& q, R); - -template<Reference R, typename Rep> - requires RepresentationOf<std::remove_cvref_t<Rep>, get_quantity_spec(R{})> -constexpr auto operator*(R, Rep&&) = delete; - -template<Reference R, typename Rep> - requires RepresentationOf<std::remove_cvref_t<Rep>, get_quantity_spec(R{})> -constexpr auto operator/(R, Rep&&) = delete; - -template<Reference R, typename Q> - requires Quantity<std::remove_cvref_t<Q>> -constexpr auto operator*(R, Q&&) = delete; - -template<Reference R, typename Q> - requires Quantity<std::remove_cvref_t<Q>> -constexpr auto operator/(R, Q&&) = delete; - -// [qty.ref.obs], observers - -template<typename Q, typename U> -consteval QuantitySpec auto get_quantity_spec(reference<Q, U>); - -template<typename Q, typename U> -consteval Unit auto get_unit(reference<Q, U>); - -consteval AssociatedUnit auto get_common_reference(AssociatedUnit auto u1, - AssociatedUnit auto u2, - AssociatedUnit auto... rest) - requires see below; - -template<Reference R1, Reference R2, Reference... Rest> -consteval Reference auto get_common_reference(R1 r1, R2 r2, Rest... rest) - requires see below; - -// [qty.rep], representation - -enum class quantity_character { scalar, complex, vector, tensor }; - -// [qty.rep.traits], traits - -// [qty.fp.traits], floating-point - -template<typename Rep> -constexpr bool treat_as_floating_point = see below; - -// [qty.char.traits], quantity character - -template<typename T> -constexpr bool disable_scalar = false; -template<> -inline constexpr bool disable_scalar<bool> = true; -template<typename T> -constexpr bool disable_scalar<std::complex<T>> = true; - -template<typename T> -constexpr bool disable_complex = false; - -template<typename T> -constexpr bool disable_vector = false; - -// [qty.val.traits], values - -template<typename Rep> -struct representation_values; - -// [qty.rep.cpos], customization point objects - -inline namespace unspecified { - -inline constexpr unspecified real = unspecified; -inline constexpr unspecified imag = unspecified; -inline constexpr unspecified modulus = unspecified; - -inline constexpr unspecified magnitude = unspecified; - -} - -// [qty.rep.concepts], concepts - -template<typename T> -concept Representation = see below; - -template<typename T, quantity_character Ch> -concept RepresentationOf = see below; - -// [qty], quantity - -// [qty.like], interoperability - -template<typename T> -struct quantity_like_traits; // not defined - -template<typename T> -concept QuantityLike = see below; - -// [qty.syn], class template quantity - -template<typename T> -concept Quantity = see below; - -template<typename Q, auto QS> -concept QuantityOf = see below; - -template<Reference auto R, RepresentationOf<get_quantity_spec(R)> Rep = double> -class quantity; - -// [qty.delta], construction helper delta - -template<Reference R> -struct delta_; - -template<Reference auto R> -constexpr delta_<decltype(R)> delta{}; - -// [qty.non.mem.conv], non-member conversions - -template<Unit auto ToU, see below> - requires see below -constexpr Quantity auto value_cast(see below q); - -template<Representation ToRep, see below> - requires see below -constexpr quantity<see below, ToRep> value_cast(see below q); - -template<Unit auto ToU, Representation ToRep, see below> - requires see below -constexpr Quantity auto value_cast(see below q); -template<Representation ToRep, Unit auto ToU, see below> - requires see below -constexpr Quantity auto value_cast(see below q); - -template<Quantity ToQ, see below> - requires see below -constexpr Quantity auto value_cast(see below q); - -template<QuantitySpec auto ToQS, see below> - requires see below -constexpr Quantity auto quantity_cast(see below q); - -} - -// [qty.common.type], std​::​common_type specializations - -template<mp_units::Quantity Q1, mp_units::Quantity Q2> - requires see below -struct std::common_type<Q1, Q2>; - -template<mp_units::Quantity Q, mp_units::Representation Value> - requires see below -struct std::common_type<Q, Value>; - -template<mp_units::Quantity Q, mp_units::Representation Value> - requires requires { typename std::common_type<Q, Value>; } -struct std::common_type<Value, Q> : std::common_type<Q, Value> {}; - -namespace mp_units { - -// [qty.pt], quantity point - -// [qty.pt.orig], point origin - -// [qty.pt.orig.concepts], concepts - -template<typename T> -concept PointOrigin = see below; - -template<typename T, auto QS> -concept PointOriginFor = see below; - -// [qty.pt.orig.types], types - -// [qty.abs.pt.orig], absolute - -template<QuantitySpec auto QS> -struct absolute_point_origin; - -// [qty.rel.pt.orig], relative - -template<QuantityPoint auto QP> -struct relative_point_origin; - -// [qty.zeroth.pt.orig], zeroth - -template<QuantitySpec auto QS> -struct zeroth_point_origin_; - -template<QuantitySpec auto QS> -constexpr zeroth_point_origin_<QS> zeroth_point_origin{}; - -// [qty.def.pt.orig], default - -template<Reference R> -consteval PointOriginFor<get_quantity_spec(R{})> auto default_point_origin(R); - -// [qty.pt.like], interoperability - -template<typename T> -struct quantity_point_like_traits; // not defined - -template<typename T> -concept QuantityPointLike = see below; - -// [qty.pt.syn], class template quantity_point - -template<typename T> -concept QuantityPoint = see below; - -template<typename QP, auto V> -concept QuantityPointOf = see below; - -template<Reference auto R, - PointOriginFor<get_quantity_spec(R)> auto PO = default_point_origin(R), - RepresentationOf<get_quantity_spec(R)> Rep = double> -class quantity_point; - -// [qty.point], construction helper point - -template<Reference R> -struct point_; - -template<Reference auto R> -constexpr point_<decltype(R)> point{}; - -// [qty.pt.non.mem.conv], non-member conversions - -template<Unit auto ToU, see below> - requires see below -constexpr QuantityPoint auto value_cast(see below qp); - -template<Representation ToRep, see below> - requires see below -constexpr quantity_point<see below, see below, ToRep> value_cast(see below qp); - -template<Unit auto ToU, Representation ToRep, see below> - requires see below -constexpr QuantityPoint auto value_cast(see below qp); -template<Representation ToRep, Unit auto ToU, see below> - requires see below -constexpr QuantityPoint auto value_cast(see below qp); - -template<Quantity ToQ, see below> - requires see below -constexpr QuantityPoint auto value_cast(see below qp); - -template<QuantityPoint ToQP, see below> - requires see below -constexpr QuantityPoint auto value_cast(see below qp); - -template<QuantitySpec auto ToQS, see below> - requires see below -constexpr QuantityPoint auto quantity_cast(see below qp); - -} -

5.2.3 Module mp_units.systems synopsis [mp.units.systems.syn]

export module mp_units.systems; - -export import mp_units.core; -import std; - -export namespace mp_units { - -// [qty.chrono], std​::​chrono interoperability - -template<typename Rep, typename Period> -struct quantity_like_traits<std::chrono::duration<Rep, Period>>; - -template<typename Clock> -struct chrono_point_origin_; -template<typename Clock> -constexpr chrono_point_origin_<Clock> chrono_point_origin{}; - -template<typename Clock, typename Rep, typename Period> -struct quantity_point_like_traits< - std::chrono::time_point<Clock, std::chrono::duration<Rep, Period>>>; - -} -

5.3 Utilities [qty.utils]

5.3.1 Non-types [qty.utils.non.types]

template<typename T, template<see below> typename U> -consteval bool is-specialization-of(); // exposition only -template<typename T, template<see below> typename U> -consteval bool is-derived-from-specialization-of(); // exposition only -
Returns:
  • For the first signature, -true of T is a specialization of U, and -false otherwise.
  • For the second signature, -true if T has exactly one public base class -that is a specialization of U -and has no other base class that is a specialization of U, and -false otherwise.
Remarks: An implementation provides enough overloads for all arguments to U.

5.3.2 Ratio [qty.ratio]

namespace mp_units { - -struct ratio { // exposition only - std::intmax_t num; - std::intmax_t den; - - consteval ratio(std::intmax_t n, std::intmax_t d = 1); - - friend consteval bool operator==(ratio, ratio) = default; - friend consteval auto operator<=>(ratio lhs, ratio rhs) { return (lhs - rhs).num <=> 0; } - - friend consteval ratio operator-(ratio r) { return {-r.num, r.den}; } - - friend consteval ratio operator+(ratio lhs, ratio rhs) - { - return {lhs.num * rhs.den + lhs.den * rhs.num, lhs.den * rhs.den}; - } - - friend consteval ratio operator-(ratio lhs, ratio rhs) { return lhs + (-rhs); } - - friend consteval ratio operator*(ratio lhs, ratio rhs); - - friend consteval ratio operator/(ratio lhs, ratio rhs) - { - return lhs * ratio{rhs.den, rhs.num}; - } -}; - -consteval bool is-integral(ratio r) { return r.num % r.den == 0; } - -consteval ratio common-ratio(ratio r1, ratio r2); - -} -
ratio represents the rational number .
Unless otherwise specified, -in the following descriptions, -let R(r) be std​::​ratio<N, D>, -where N and D are the values of r.num and r.den.
consteval ratio(std::intmax_t n, std::intmax_t d = 1); -
Let N and D be the values of n and d.
Let R be std​::​ratio<N, D>.
Effects: Equivalent to -R.
Postconditions: num == R​::​num && den == R​::​den is true.
friend consteval ratio operator*(ratio lhs, ratio rhs); -
Let Res be std​::​ratio_multiply<R(lhs), R(rhs)>.
Effects: Equivalent to: -return {Res​::​num, Res​::​den};
consteval ratio common-ratio(ratio r1, ratio r2); -
Let Res be equal to -std::common_type<std::chrono::duration<int, R(r1)>, - std::chrono::duration<int, R(r2)>>::type::period -
Effects: Equivalent to: -return {Res​::​num, Res​::​den};

5.3.3 Symbol text [qty.sym.txt]

namespace mp_units { - -template<std::size_t N, std::size_t M> -class symbol_text { -public: - std::fixed_u8string<N> utf8; // exposition only - std::fixed_string<M> portable; // exposition only - - // constructors - constexpr symbol_text(char portable); - consteval symbol_text(const char (&portable)[N + 1]); - constexpr symbol_text(const std::fixed_string<N>& portable); - consteval symbol_text(const char8_t (&utf8)[N + 1], const char (&portable)[M + 1]); - constexpr symbol_text(const std::fixed_u8string<N>& utf8, - const std::fixed_string<M>& portable); - - // observers - constexpr const auto& utf8() const { return utf8; } - constexpr const auto& portable() const { return portable; } - constexpr bool empty() const { return utf8().empty(); } - - // string operations - template<std::size_t N2, std::size_t M2> - friend constexpr symbol_text<N + N2, M + M2> operator+(const symbol_text& lhs, - const symbol_text<N2, M2>& rhs); - - // comparison - template<std::size_t N2, std::size_t M2> - friend constexpr bool operator==(const symbol_text& lhs, - const symbol_text<N2, M2>& rhs) noexcept; - template<std::size_t N2, std::size_t M2> - friend constexpr auto operator<=>(const symbol_text& lhs, - const symbol_text<N2, M2>& rhs) noexcept; -}; - -symbol_text(char) -> symbol_text<1, 1>; - -template<std::size_t N> -symbol_text(const char (&)[N]) -> symbol_text<N - 1, N - 1>; - -template<std::size_t N> -symbol_text(const std::fixed_string<N>&) -> symbol_text<N, N>; - -template<std::size_t N, std::size_t M> -symbol_text(const char8_t (&)[N], const char (&)[M]) -> symbol_text<N - 1, M - 1>; - -template<std::size_t N, std::size_t M> -symbol_text(const std::fixed_u8string<N>&, const std::fixed_string<M>&) -> symbol_text<N, M>; - -} -
symbol_text represents a symbol text.
utf8 stores its UTF-8 representation, and -portable stores its portable representation.
symbol_text<N, M> is a structural type (N4971, [temp.param]).
In the descriptions that follow, -it is a Precondition that -
  • values of char are in the basic literal character set (N4971, [lex.charset]), and
  • for a parameter of the form const CharT (&txt)[M], -(txt[M - 1] == CharT()) is true.
constexpr symbol_text(char portable); -consteval symbol_text(const char (&portable)[N + 1]); -constexpr symbol_text(const std::fixed_string<N>& portable); -consteval symbol_text(const char8_t (&utf8)[N + 1], const char (&portable)[M + 1]); -constexpr symbol_text(const std::fixed_u8string<N>& utf8, const std::fixed_string<M>& portable); -
For the constructors without a parameter named utf8, -let utf8 be: -std::bit_cast<std::fixed_u8string<N>>(std::basic_fixed_string(portable)) -
Effects: Equivalent to the mem-initializer-list: -utf8{utf8}, portable{portable} -
template<std::size_t N2, std::size_t M2> -friend constexpr symbol_text<N + N2, M + M2> operator+(const symbol_text& lhs, - const symbol_text<N2, M2>& rhs); -
Effects: Equivalent to: -return symbol_text<N + N2, M + M2>(lhs.utf8() + rhs.utf8(), - lhs.portable() + rhs.portable()); -
template<std::size_t N2, std::size_t M2> -friend constexpr bool operator==(const symbol_text& lhs, - const symbol_text<N2, M2>& rhs) noexcept; -template<std::size_t N2, std::size_t M2> -friend constexpr auto operator<=>(const symbol_text& lhs, - const symbol_text<N2, M2>& rhs) noexcept; -
Let @ be the operator.
Effects: Equivalent to: -return std::make_tuple(std::cref(lhs.utf8()), std::cref(lhs.portable())) @ - std::make_tuple(std::cref(rhs.utf8()), std::cref(rhs.portable())); -

5.3.4 Symbolic expressions [qty.sym.expr]

5.3.4.1 General [qty.sym.expr.general]

Subclause [qty.sym.expr] specifies the components -used to maintain ordered, simplified, and readable -argument lists in the names of specializations.
[Example 1: using namespace si::unit_symbols; -int x = kg * km / square(h); // error: cannot construct from - // derived_unit<si​::​kilo_<si​::​gram>, si​::​kilo_<si​::​metre>, per<power<non_si​::​hour, 2>>> -
-The library ensures decltype(kg * km / square(h)) is styled-like as commented in diagnostics, -provided that, in the implementation-defined total order of types, -decltype(kg) is less than decltype(km).
— end example]

5.3.4.2 Concept SymbolicConstant [qty.sym.expr.concepts]

template<typename T> -concept SymbolicConstant = // exposition only - std::is_empty_v<T> && std::is_final_v<T> && std::is_trivially_default_constructible_v<T> && - std::is_trivially_copy_constructible_v<T> && std::is_trivially_move_constructible_v<T> && - std::is_trivially_destructible_v<T>; -
The concept SymbolicConstant -is used to constrain the types -that are used in symbolic expressions.

5.3.4.3 Types [qty.sym.expr.types]

namespace mp_units { - -template<typename T, typename... Ts> -struct per final {}; - -} -
per is used to store arguments with negative exponents.
A specialization of per -represents the product of the inverse of its template arguments.
A program that instantiates a specialization of per -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
namespace mp_units { - -template<typename F, int Num, int... Den> - requires see below -struct power final { - using factor = F; // exposition only - static constexpr ratio exponent{Num, Den...}; // exposition only -}; - -} -
power represents a power (IEC 60050, 102-02-08) -of the form .
[Note 1: 
Den is optional to shorten the type name when Den is 1.
— end note]
-A program that instantiates a specialization of power -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
Let r be ratio{Num, Den...}.
Let is-valid-ratio be -true if r is a valid constant expression, and -false otherwise.
The expression in the requires-clause is equivalent to: -is-valid-ratio && (r > ratio{0}) && (r != ratio{1}) -

5.3.4.4 Algorithms [qty.sym.expr.algos]

template<typename T> -using expr-type = see below; // exposition only -
expr-type<T> denotes -U if T is of the form power<U, Ints...>, and -T otherwise.
template<typename T, typename U> -consteval bool type-less-impl(); // exposition only -
Returns: true if T is less than U -in an implementation-defined total order for types, and -false otherwise.
template<typename Lhs, typename Rhs> -struct type-less : // exposition only - std::bool_constant<is-specialization-of<Rhs, power>() || - type-less-impl<expr-type<Lhs>, expr-type<Rhs>>()> {}; -
type-less meets the requirements of -the Pred parameter of the symbolic expression algorithms below.
template<typename... Ts> -struct type-list {}; // exposition only - -template<typename OneType, typename... Ts> -struct expr-fractions { // exposition only - using num = see below; // exposition only - using den = see below; // exposition only -} -
expr-fractions divides a symbolic expression to numerator and denominator parts.
Let EF be a specialization of expr-fractions.
  • If EF is of the form expr-fractions<OneType, Ts..., per<Us...>>, -then -
    • EF​::​num denotes type-list<Ts...>, and
    • EF​::​den denotes type-list<Us...>.
  • Otherwise, EF is of the form expr-fractions<OneType, Ts...>, and -
    • EF​::​num denotes type-list<Ts...>, and
    • EF​::​den denotes type-list<>.
The symbolic expression algorithms perform operations on symbolic constants.
A symbolic constant is a type that is a model of SymbolicConstant.
[Example 1: 
The dimension dim_length, the quantity time, and the unit one are symbolic constants.
— end example]
-The algorithms also support -powers with a symbolic constant base and a rational exponent, -products thereof, and -fractions thereof.
template<template<typename...> typename To, typename OneType, - template<typename, typename> typename Pred = type-less, typename Lhs, typename Rhs> -consteval auto expr-multiply(Lhs, Rhs); // exposition only - -template<template<typename...> typename To, typename OneType, - template<typename, typename> typename Pred = type-less, typename Lhs, typename Rhs> -consteval auto expr-divide(Lhs lhs, Rhs rhs); // exposition only - -template<template<typename...> typename To, typename OneType, typename T> -consteval auto expr-invert(T); // exposition only - -template<std::intmax_t Num, std::intmax_t Den, template<typename...> typename To, - typename OneType, template<typename, typename> typename Pred = type-less, typename T> - requires(Den != 0) -consteval auto expr-pow(T); // exposition only -
Mandates:
  • OneType is the neutral element (IEC 60050, 102-01-19) of the operation, and
  • Pred is a Cpp17BinaryTypeTrait (N4971, [meta.rqmts]) -with a base characteristic of std​::​bool_constant<B>.
    Pred<T, U> implements a total order for types; -B is true if T is ordered before U, and false otherwise.
Effects:
First, inputs to the operations are obtained from the types of the function parameters.
If the type of a function parameter is: -
  • A specialization of To, -then its input is the product of its template arguments, and -the following also apply.
  • A specialization of per, -then its input is the product of the inverse of its template arguments, and -the following also apply.
  • A specialization of the form power<F, Num>, -then its input is , or -a specialization of the form power<F, Num, Den>, -then its input is , and -the following also applies.
  • Otherwise, the input is the symbolic constant itself.
[Example 2: 
Item by item, this algorithm step goes from the C++ parameter type -decltype(km / square(h)), -styled in diagnostics like -derived_unit<si​::​kilo_<si​::​metre>, per<power<non_si​::​hour, 2>>, -
  • to decltype(km) ×per<power<decltype(h), 2> (product of To's arguments),
  • to (product of inverse of per's arguments),
  • to (powers as powers),
  • to where and (symbolic substitution) -in the mathematical domain.
— end example]
Then, the operation takes place: -
  • expr-multiply multiplies its inputs,
  • expr-divide divides the input of its first parameter by the input of its second parameter,
  • expr-invert divides 1 by its input, and
  • expr-pow raises its input to the .
Finally, let r be the result of the operation simplified as follows: -
  • All terms are part of the same fraction (if any).
  • There is at most a single term with a given symbolic constant.
  • There are no negative exponents.
  • 1 is only present as r and as a numerator with a denominator not equal to 1.
[Example 3: 
Item by item:

(single fraction)
(unique symbolic constants)
(positive exponents)
(non-redundant 1s)
— end example]
Returns: r is mapped to the return type: -
  • If , returns OneType{}.
  • Otherwise, if r is a symbolic constant, returns r.
  • Otherwise, first applies the following mappings to the terms of r: -
    • is mapped to power<x, n, d>, and - is mapped to power<x, n>, and
    • 1 is mapped to OneType{}.
  • Then, a denominator x of r (if any) is mapped to per<x>.
  • Then, sorts r without per (if any) and -the template arguments of per (if any) -according to Pred.
  • Finally, returns To<r>{}, where per (if any) is the last argument.
Remarks: A valid template argument list for To and per -is formed by interspersing commas between each mapped term.
If a mapping to std​::​intmax_t is not representable, -the program is ill-formed.
expr-map maps the contents of one symbolic expression to another resulting in a different type list.
template<template<typename> typename Proj, template<typename...> typename To, typename OneType, - template<typename, typename> typename Pred = type-less, typename T> -consteval auto expr-map(T); // exposition only -
Let -
  • expr-type-map<U> be -power<Proj<F>, Ints...> if U is of the form power<F, Ints...>, and -Proj<U> otherwise,
  • map-power(u) be -pow<Ints...>(F{}) if decltype(u) is of the form power<F, Ints...>, and -u otherwise, and
  • Nums and Dens -be packs denoting the template arguments of -T​::​nums and T​::​dens, respectively.
Returns: (OneType{} * ... * map-power(expr-type-map<Nums>{})) / -(OneType{} * ... * map-power(expr-type-map<Dens>{})) -

5.4 Reference [qty.ref]

5.4.1 General [qty.ref.general]

Subclause [qty.ref] specifies the components -for describing the reference of a quantity (IEC 60050, 112-01-01).

5.4.2 Dimension [qty.dim]

5.4.2.1 General [qty.dim.general]

Subclause [qty.dim] specifies the components -for defining the dimension of a quantity (IEC 60050, 112-01-11).

5.4.2.2 Concepts [qty.dim.concepts]

template<typename T> -concept Dimension = SymbolicConstant<T> && std::derived_from<T, dimension-interface>; - -template<typename T> -concept BaseDimension = // exposition only - Dimension<T> && (is-derived-from-specialization-of<T, base_dimension>()); - -template<typename T, auto D> -concept DimensionOf = Dimension<T> && Dimension<decltype(D)> && (T{} == D); -

5.4.2.3 Types [qty.dim.types]

namespace mp_units { - -template<symbol_text Symbol> -struct base_dimension : dimension-interface { - static constexpr auto symbol = Symbol; // exposition only -}; - -} -
base_dimension is used -to define the dimension of a base quantity (IEC 60050, 112-01-08).
Symbol is its symbolic representation.
[Example 1: inline constexpr struct dim_length final : base_dimension<"L"> {} dim_length; - — end example]
namespace mp_units { - -template<typename... Expr> -struct derived-dimension-impl // exposition only - : expr-fractions<struct dimension_one, Expr...> {}; - -template<SymbolicConstant... Expr> -struct derived_dimension final : dimension-interface, derived-dimension-impl<Expr...> {}; - -} -
derived_dimension is used by the library -to represent the dimension of a derived quantity (IEC 60050, 112-01-10).
[Example 2: constexpr auto dim_acceleration = isq::speed.dimension / isq::dim_time; -int x = dim_acceleration; // error: cannot construct from - // derived_dimension<isq​::​dim_length, per<power<isq​::​dim_time, 2>>> - — end example]
-A program that instantiates a specialization of derived_dimension -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
namespace mp_units { - -struct dimension_one final : dimension-interface, derived-dimension-impl<> {}; - -} -
dimension_one represents the dimension of a quantity of dimension one (IEC 60050, 112-01-13).

5.4.2.4 Operations [qty.dim.ops]

namespace mp_units { - -struct dimension-interface { // exposition only - template<Dimension Lhs, Dimension Rhs> - friend consteval Dimension auto operator*(Lhs, Rhs); - - template<Dimension Lhs, Dimension Rhs> - friend consteval Dimension auto operator/(Lhs, Rhs); - - template<Dimension Lhs, Dimension Rhs> - friend consteval bool operator==(Lhs, Rhs); -}; - -} -
template<Dimension Lhs, Dimension Rhs> -friend consteval Dimension auto operator*(Lhs, Rhs); -
Returns: expr-multiply<derived_dimension, struct dimension_one>(Lhs{}, Rhs{}).
template<Dimension Lhs, Dimension Rhs> -friend consteval Dimension auto operator/(Lhs, Rhs); -
Returns: expr-divide<derived_dimension, struct dimension_one>(Lhs{}, Rhs{}).
template<Dimension Lhs, Dimension Rhs> -friend consteval bool operator==(Lhs, Rhs); -
Returns: std​::​is_same_v<Lhs, Rhs>.
consteval Dimension auto inverse(Dimension auto d); -
Returns: dimension_one / d.
template<std::intmax_t Num, std::intmax_t Den = 1, Dimension D> - requires(Den != 0) -consteval Dimension auto pow(D d); -
Returns: expr-pow<Num, Den, derived_dimension, struct dimension_one>(d).
consteval Dimension auto sqrt(Dimension auto d); -
Returns: pow<1, 2>(d).
consteval Dimension auto cbrt(Dimension auto d); -
Returns: pow<1, 3>(d).

5.4.2.5 Symbol formatting [qty.dim.sym.fmt]

template<typename CharT = char, std::output_iterator<CharT> Out, Dimension D> -constexpr Out dimension_symbol_to(Out out, D d, const dimension_symbol_formatting& fmt = {}); -
Effects: TBD.
Returns: TBD.
template<dimension_symbol_formatting fmt = {}, typename CharT = char, Dimension D> -consteval std::string_view dimension_symbol(D); -
Effects: Equivalent to: -TBD. -

5.4.3 Quantity specification [qty.spec]

5.4.3.1 General [qty.spec.general]

Subclause [qty.spec] specifies the components -for defining a quantity (IEC 60050, 112-01-01).

5.4.3.2 Concepts [qty.spec.concepts]

template<typename T> -concept QuantitySpec = SymbolicConstant<T> && std::derived_from<T, quantity-spec-interface>; - -template<typename T> -concept QuantityKindSpec = // exposition only - QuantitySpec<T> && is-specialization-of<T, kind_of_>(); - -template<typename T> -concept NamedQuantitySpec = // exposition only - QuantitySpec<T> && is-derived-from-specialization-of<T, quantity_spec>() && - (!QuantityKindSpec<T>); - -template<typename T> -concept DerivedQuantitySpec = // exposition only - QuantitySpec<T> && - (is-specialization-of<T, derived_quantity_spec>() || - (QuantityKindSpec<T> && - is-specialization-of<decltype(auto(T::quantity-spec)), derived_quantity_spec>())); - -template<auto Child, auto Parent> -concept ChildQuantitySpecOf = (is-child-of(Child, Parent)); // exposition only - -template<auto To, auto From> -concept NestedQuantityKindSpecOf = // exposition only - QuantitySpec<decltype(From)> && QuantitySpec<decltype(To)> && - (get_kind(From) != get_kind(To)) && ChildQuantitySpecOf<To, get_kind(From).quantity-spec>; - -template<auto From, auto To> -concept QuantitySpecConvertibleTo = // exposition only - QuantitySpec<decltype(From)> && QuantitySpec<decltype(To)> && implicitly_convertible(From, To); - -template<auto From, auto To> -concept QuantitySpecExplicitlyConvertibleTo = // exposition only - QuantitySpec<decltype(From)> && QuantitySpec<decltype(To)> && explicitly_convertible(From, To); - -template<auto From, auto To> -concept QuantitySpecCastableTo = // exposition only - QuantitySpec<decltype(From)> && QuantitySpec<decltype(To)> && castable(From, To); - -template<typename T, auto QS> -concept QuantitySpecOf = - QuantitySpec<T> && QuantitySpec<decltype(QS)> && QuantitySpecConvertibleTo<T{}, QS> && - !NestedQuantityKindSpecOf<T{}, QS> && - (QuantityKindSpec<T> || !NestedQuantityKindSpecOf<QS, T{}>); - -template<typename T> -concept QSProperty = (!QuantitySpec<T>); // exposition only -

5.4.3.3 Types [qty.spec.types]

5.4.3.3.1 Named [named.qty]

namespace mp_units { - -struct is_kind {}; - -template<BaseDimension auto Dim, QSProperty auto... Args> -struct quantity_spec<Dim, Args...> : quantity-spec-interface { - using base-type = quantity_spec; - static constexpr BaseDimension auto dimension = Dim; - static constexpr quantity_character character = see below; -}; - -template<DerivedQuantitySpec auto Eq, QSProperty auto... Args> -struct quantity_spec<Eq, Args...> : quantity-spec-interface { - using base-type = quantity_spec; - static constexpr auto equation = Eq; - static constexpr Dimension auto dimension = Eq.dimension; - static constexpr quantity_character character = see below; -}; - -template<NamedQuantitySpec auto QS, QSProperty auto... Args> -struct quantity_spec<QS, Args...> : quantity-spec-interface { - using base-type = quantity_spec; - static constexpr auto parent = QS; - static constexpr auto equation = parent.equation; // exposition only, present only - // if the qualified-id parent.equation is valid and denotes an object - static constexpr Dimension auto dimension = parent.dimension; - static constexpr quantity_character character = see below; -}; - -template<NamedQuantitySpec auto QS, DerivedQuantitySpec auto Eq, QSProperty auto... Args> - requires QuantitySpecExplicitlyConvertibleTo<Eq, QS> -struct quantity_spec<QS, Eq, Args...> : quantity-spec-interface { - using base-type = quantity_spec; - static constexpr auto parent = QS; - static constexpr auto equation = Eq; - static constexpr Dimension auto dimension = parent.dimension; - static constexpr quantity_character character = see below; -}; - -} -
A named quantity is a type that models NamedQuantitySpec.
A specialization of quantity_spec is used as a base type when defining a named quantity.
In the following descriptions, let Q be a named quantity defined with an alluded signature.
The identifier of Q represents its quantity name (IEC 60050, 112-01-02).
Let Ch be an enumerator value of quantity_character.
The possible arguments to quantity_spec are -
  • ,
  • ,
  • , and
  • .
If the first argument is a base quantity dimension, -then Q is that base quantity (IEC 60050, 112-01-08).
If an argument is a quantity calculus (IEC 60050, 112-01-30) C, -then Q is implicitly convertible from C.
If the first argument is a named quantity, -then Q is of its kind (IEC 60050, 112-01-04).
The member character represents -the set of the numerical value of Q ([qty.char.traits]) -and is equal to -
  • Ch if specified,
  • otherwise, quantity_character​::​real_scalar for the first signature, and
  • otherwise, (BC).character, -where BC is the argument preceding Ch in the signatures above.
is_kind specifies Q to start a new hierarchy tree of a kind.
Optional arguments may appear in any order.
[Example 1: // The first signature defines a base quantity. -inline constexpr struct length final : quantity_spec<dim_length> { -} length; // Length is a base quantity. - -// The second signature defines a derived quantity. -inline constexpr struct area final : quantity_spec<pow<2>(length)> { -} area; // An area equals length by length. - -// The third and fourth signatures add a leaf to a hierarchy of kinds. -inline constexpr struct width final : quantity_spec<length> { -} width; // Width is a kind of length. - -// The fourth signature also refines the calculus required for implicit conversions. -inline constexpr struct angular_measure final : - quantity_spec<dimensionless, arc_length / radius, is_kind> { -} angular_measure; // Requires an arc length per radius, not just any quantity of dimension one. - — end example]

5.4.3.3.2 Derived [derived.qty]

namespace mp_units { - -template<NamedQuantitySpec Q> -using to-dimension = decltype(auto(Q::dimension)); // exposition only - -template<typename... Expr> -struct derived-quantity-spec-impl : // exposition only - quantity-spec-interface, - expr-fractions<struct dimensionless, Expr...> { - using base-type = derived-quantity-spec-impl; - using base = expr-fractions<struct dimensionless, Expr...>; - - static constexpr Dimension auto dimension = - expr-map<to-dimension, derived_dimension, struct dimension_one>(base{}); - static constexpr quantity_character character = see below; -}; - -template<SymbolicConstant... Expr> -struct derived_quantity_spec final : derived-quantity-spec-impl<Expr...> {}; - -} -
derived_quantity_spec is used by the library -to represent the result of a quantity calculus not equal to a named quantity.
[Example 1: constexpr auto area = pow<2>(isq::length); -int x = area; // error: cannot construct from derived_quantity_spec<power<isq​::​length, 2>> - — end example]
-A program that instantiates a specialization of derived_quantity_spec -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
Let -
  • Nums and Dens -be packs denoting the template arguments of -base​::​nums and base​::​dens, respectively,
  • QUANTITY-CHARACTER-OF(Pack) be -std::max({quantity_character::real_scalar, expr-type<Pack>::character...}) - -and
  • num_char be QUANTITY-CHARACTER-OF(Nums) and -den_char be QUANTITY-CHARACTER-OF(Dens).
-The member character is equal to -quantity_character​::​real_scalar if num_char == den_char is true, and -std​::​max(num_char, den_char) otherwise.

5.4.3.3.3 Base quantity of dimension one [dimless.qty]

namespace mp_units { - -struct dimensionless final : quantity_spec<derived_quantity_spec<>> {}; - -} -
dimensionless represents the base quantity of dimension one (IEC 60050, 112-01-13).

5.4.3.3.4 Kind of [kind.of.qty]

namespace mp_units { - -template<QuantitySpec Q> - requires(!QuantityKindSpec<Q>) && (get-kind-tree-root(Q{}) == Q{}) -struct kind_of_ final : Q::base-type { - using base-type = kind_of_; // exposition only - static constexpr auto quantity-spec = Q{}; // exposition only -}; - -} -
kind_of<Q> represents a kind of quantity (IEC 60050, 112-01-04) Q.

5.4.3.4 Utilities [qty.spec.utils]

template<QuantitySpec auto... From, QuantitySpec Q> -consteval QuantitySpec auto clone-kind-of(Q q); // exposition only -
Effects: Equivalent to: -if constexpr ((... && QuantityKindSpec<decltype(From)>)) - return kind_of<Q{}>; -else - return q; -
template<QuantitySpec Q> -consteval auto remove-kind(Q q); // exposition only -
Effects: Equivalent to: -if constexpr (QuantityKindSpec<Q>) - return Q::quantity-spec; -else - return q; -
template<QuantitySpec QS, Unit U> - requires(!AssociatedUnit<U>) || UnitOf<U, QS{}> -consteval Reference auto make-reference(QS, U u); // exposition only -
Effects: Equivalent to: -if constexpr (requires { requires get_quantity_spec(U{}) == QS{}; }) - return u; -else - return reference<QS, U>{}; -

5.4.3.5 Operations [qty.spec.ops]

namespace mp_units { - -struct quantity-spec-interface { // exposition only - template<QuantitySpec Lhs, QuantitySpec Rhs> - friend consteval QuantitySpec auto operator*(Lhs lhs, Rhs rhs); - - template<QuantitySpec Lhs, QuantitySpec Rhs> - friend consteval QuantitySpec auto operator/(Lhs lhs, Rhs rhs); - - template<typename Self, UnitOf<Self{}> U> - consteval Reference auto operator[](this Self self, U u); - - template<typename Self, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>> - requires QuantitySpecExplicitlyConvertibleTo<Q::quantity_spec, Self{}> - constexpr Quantity auto operator()(this Self self, FwdQ&& q); - - template<QuantitySpec Lhs, QuantitySpec Rhs> - friend consteval bool operator==(Lhs, Rhs); -}; - -} -
template<QuantitySpec Lhs, QuantitySpec Rhs> -friend consteval QuantitySpec auto operator*(Lhs lhs, Rhs rhs); -
Returns: clone-kind-of<Lhs{}, Rhs{}>(expr-multiply<derived_quantity_spec, struct dimensionless>( - remove-kind(lhs), remove-kind(rhs))) -
template<QuantitySpec Lhs, QuantitySpec Rhs> -friend consteval QuantitySpec auto operator/(Lhs lhs, Rhs rhs); -
Returns: clone-kind-of<Lhs{}, Rhs{}>(expr-divide<derived_quantity_spec, struct dimensionless>( - remove-kind(lhs), remove-kind(rhs))) -
template<typename Self, UnitOf<Self{}> U> -consteval Reference auto operator[](this Self self, U u); -
Returns: make-reference(self, u).
template<typename Self, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>> - requires QuantitySpecExplicitlyConvertibleTo<Q::quantity_spec, Self{}> -constexpr Quantity auto operator()(this Self self, FwdQ&& q); -
Returns: quantity{std::forward<FwdQ>(q).numerical-value, make-reference(self, Q::unit)} -
template<QuantitySpec Lhs, QuantitySpec Rhs> -friend consteval bool operator==(Lhs, Rhs); -
Returns: std​::​is_same_v<Lhs, Rhs>.
consteval QuantitySpec auto inverse(QuantitySpec auto q); -
Returns: dimensionless / q.
template<std::intmax_t Num, std::intmax_t Den = 1, QuantitySpec Q> - requires(Den != 0) -consteval QuantitySpec auto pow(Q q); -
Returns: clone-kind-of<Q{}>( - expr-pow<Num, Den, derived_quantity_spec, struct dimensionless>(remove-kind(q))); -
consteval QuantitySpec auto sqrt(QuantitySpec auto q); -
Returns: pow<1, 2>(q).
consteval QuantitySpec auto cbrt(QuantitySpec auto q); -
Returns: pow<1, 3>(q).

5.4.3.6 Hierarchy algorithms [qty.spec.hier.algos]

5.4.3.6.1 Conversion [qty.spec.conv]

consteval bool implicitly_convertible(QuantitySpec auto from, QuantitySpec auto to); -
Returns: TBD.
consteval bool explicitly_convertible(QuantitySpec auto from, QuantitySpec auto to); -
Returns: TBD.
consteval bool castable(QuantitySpec auto from, QuantitySpec auto to); -
Returns: TBD.
consteval bool interconvertible(QuantitySpec auto qs1, QuantitySpec auto qs2); -
Returns: implicitly_convertible(qs1, qs2) && implicitly_convertible(qs2, qs1).

5.4.3.6.2 Get kind [qty.get.kind]

template<QuantitySpec Q> -consteval QuantitySpec auto get-kind-tree-root(Q q); // exposition only -
Returns:
  • If QuantityKindSpec<Q> is true, -returns remove-kind(q).
  • Otherwise, if -is-derived-from-specialization-of<Q, quantity_spec>() -is true, and -the specialization of Q​::​quantity_spec has a template argument equal to is_kind, -returns q.
  • Otherwise, if Q​::​parent is a valid expression, -returns get-kind-tree-root(Q​::​parent).
  • Otherwise, if DerivedQuantitySpec<Q> is true, -returns -expr-map<to-kind, derived_quantity_spec, struct dimensionless>(q) - -where to-kind is defined as follows: -template<QuantitySpec Q> -using to-kind = decltype(get-kind-tree-root(Q{})); // exposition only -
  • Otherwise, returns q.
template<QuantitySpec Q> -consteval QuantityKindSpec auto get_kind(Q); -
Returns: kind_of<get-kind-tree-root(Q{})>.

5.4.3.6.3 Get common quantity specification [get.common.qty.spec]

consteval QuantitySpec auto get_common_quantity_spec(QuantitySpec auto... qs) - requires see below; -
Let -
  • q1 be qs...[0],
  • q2 be qs...[1],
  • Q1 be decltype(q1),
  • Q2 be decltype(q2), and
  • rest be a pack denoting the elements of qs without q1 and q2.
Effects: Equivalent to: -if constexpr (sizeof...(qs) == 1) - return q1; -else if constexpr (sizeof...(qs) == 2) { - using QQ1 = decltype(remove-kind(q1)); - using QQ2 = decltype(remove-kind(q2)); - - if constexpr (std::is_same_v<Q1, Q2>) - return q1; - else if constexpr (NestedQuantityKindSpecOf<Q1{}, Q2{}>) - return QQ1{}; - else if constexpr (NestedQuantityKindSpecOf<Q2{}, Q1{}>) - return QQ2{}; - else if constexpr ((QuantityKindSpec<Q1> && !QuantityKindSpec<Q2>) || - (DerivedQuantitySpec<QQ1> && NamedQuantitySpec<QQ2> && - implicitly_convertible(Q1{}, Q2{}))) - return q2; - else if constexpr ((!QuantityKindSpec<Q1> && QuantityKindSpec<Q2>) || - (NamedQuantitySpec<QQ1> && DerivedQuantitySpec<QQ2> && - implicitly_convertible(Q2{}, Q1{}))) - return q1; - else if constexpr (constexpr auto common_base = get-common-base<Q1{}, Q2{}>()) - return *common_base; - else if constexpr (implicitly_convertible(Q1{}, Q2{})) - return q2; - else if constexpr (implicitly_convertible(Q2{}, Q1{})) - return q1; - else if constexpr (implicitly_convertible(get-kind-tree-root(Q1{}), - get-kind-tree-root(Q2{}))) - return get-kind-tree-root(q2); - else - return get-kind-tree-root(q1); -} else - return get_common_quantity_spec(get_common_quantity_spec(q1, q2), rest...); -
Remarks: The expression in the requires-clause is equivalent to: -(sizeof...(qs) != 0 && - (sizeof...(qs) == 1 || - (sizeof...(qs) == 2 && - (QuantitySpecConvertibleTo<get-kind-tree-root(Q1{}), get-kind-tree-root(Q2{})> || - QuantitySpecConvertibleTo<get-kind-tree-root(Q2{}), get-kind-tree-root(Q1{})>)) || - requires { get_common_quantity_spec(get_common_quantity_spec(q1, q2), rest...); })) -

5.4.3.6.4 Get common base [qty.get.common.base]

In this subclause and [qty.is.child.of], -let the kind of quantity (IEC 60050, 112-01-04) hierarchy of q be the tuple -, -where par is parent.
template<QuantitySpec auto A, QuantitySpec auto B> -consteval auto get-common-base(); // exposition only -
Let -
  • be the number of elements in h(A),
  • be the number of elements in h(B),
  • s be ,
  • A be a tuple of the last s elements of h(A), and
  • B be a tuple of the last s elements of h(B).
Effects: Looks for x, the first pair-wise equal element in A and B.
Returns: std​::​optional(x), if x is found, and std​::​optional<unspecified>() otherwise.

5.4.3.6.5 Is child of [qty.is.child.of]

template<QuantitySpec Child, QuantitySpec Parent> -consteval bool is-child-of(Child ch, Parent p); // exposition only -
Returns: If h(p) has more elements than h(ch), returns false.
Otherwise, let C be a tuple of the last s elements of h(ch), -where s is the number of elements in h(p).
Returns == p.

5.4.4 Unit [qty.unit]

5.4.4.1 General [qty.unit.general]

Subclause [qty.unit] specifies the components -for defining a unit of measurement (IEC 60050, 112-01-14).

5.4.4.2 Magnitude [qty.unit.mag]

5.4.4.2.1 General [qty.unit.mag.general]

Subclause [qty.unit.mag] specifies the components -used to represent the numerical value (IEC 60050, 112-01-29) of a unit -with support for powers (IEC 60050, 102-02-08) of real numbers (IEC 60050, 102-02-05).

5.4.4.2.2 Concepts [qty.unit.mag.concepts]

template<typename T> -concept MagConstant = SymbolicConstant<T> && is-derived-from-specialization-of<T, mag_constant>(); - -template<typename T> -concept UnitMagnitude = (is-specialization-of<T, unit-magnitude>()); - -template<typename T> -concept MagArg = std::integral<T> || MagConstant<T>; // exposition only -

5.4.4.2.3 Types [qty.unit.mag.types]

namespace mp_units { - -template<symbol_text Symbol, long double Value> - requires(Value > 0) -struct mag_constant { - static constexpr auto symbol = Symbol; // exposition only - static constexpr long double value = Value; // exposition only -}; - -} -
A specialization of mag_constant represents a real number (IEC 60050, 102-02-05).
Symbol is its symbol, and -Value is (an approximation of) its value.
namespace mp_units { - -template<auto... Ms> -struct unit-magnitude { // exposition only - // [qty.unit.mag.ops], operations - - template<UnitMagnitude M> - friend consteval UnitMagnitude auto operator*(unit-magnitude lhs, M rhs); - - friend consteval auto operator/(unit-magnitude lhs, UnitMagnitude auto rhs); - - template<UnitMagnitude Rhs> - friend consteval bool operator==(unit-magnitude, Rhs); - - template<int Num, int Den = 1> - friend consteval auto pow(unit-magnitude); // exposition only - - // [qty.unit.mag.utils], utilities - - friend consteval bool is-positive-integral-power(unit-magnitude); // exposition only - - template<auto... Ms2> - friend consteval auto common-magnitude(unit-magnitude, // exposition only - unit-magnitude<Ms2...>); -}; - -} -
A specialization of unit-magnitude -represents the product of its template arguments.
For the purposes of specifying the implementation-defined limits, -let the representation of the terms of unit-magnitude be the structure -struct { - ratio exp; - base-type base; -}; - -representing the number , -where base-type is a model of MagArg.
  • There is a single term for each base-type.
  • exp.num is not expanded into base.
    [Note 1: 
    is not permitted.
    — end note]
  • exp.den can reduce the base.
    [Note 2: 
    is permitted.
    — end note]
  • If the result of an operation on std​::​intmax_t values is undefined, -the behavior is -implementation-defined.

5.4.4.2.4 Operations [qty.unit.mag.ops]

template<UnitMagnitude M> -friend consteval UnitMagnitude auto operator*(unit-magnitude lhs, M rhs); -
Returns:
  • If sizeof...(Ms) == 0 is true, returns rhs.
  • Otherwise, if std​::​is_same_v<M, unit-magnitude<>>, returns lhs.
  • Otherwise, returns an unspecified value equal to lhs ×rhs.
friend consteval auto operator/(unit-magnitude lhs, UnitMagnitude auto rhs); -
Returns: lhs * pow<-1>(rhs).
template<UnitMagnitude Rhs> -friend consteval bool operator==(unit-magnitude, Rhs); -
Returns: std​::​is_same_v<unit-magnitude, Rhs>.
template<int Num, int Den = 1> -friend consteval auto pow(unit-magnitude base); // exposition only -
Returns:
  • If Num == 0 is true, returns unit-magnitude<>{}.
  • Otherwise, returns an unspecified value equal to .
template<MagArg auto V> -constexpr UnitMagnitude auto mag = see below; -
Constraints: V is greater than 0.
Effects: If MagConstant<decltype(V)> is satisfied, -initializes mag with unit-magnitude<V>{}.
Otherwise, initializes mag with -an unspecified value equal to V.
template<std::intmax_t N, std::intmax_t D> - requires(N > 0) -constexpr UnitMagnitude auto mag_ratio = see below; -
Effects: Initializes mag_ratio with -an unspecified value equal to .
template<MagArg auto Base, int Num, int Den = 1> -constexpr UnitMagnitude auto mag_power = pow<Num, Den>(mag<Base>); -
Constraints: Base is greater than 0.

5.4.4.2.5 Utilities [qty.unit.mag.utils]

friend consteval bool is-positive-integral-power(unit-magnitude x); // exposition only -
Returns: false if x has a negative or rational exponent, and -true otherwise.
template<auto... Ms2> -friend consteval auto common-magnitude(unit-magnitude, unit-magnitude<Ms2...>); // exposition only -
Returns: The largest magnitude C -such that each input magnitude is expressible -by only positive powers relative to C.

5.4.4.3 Traits [qty.unit.traits]

template<Unit auto U> -constexpr bool space_before_unit_symbol = true; -
The formatting functions ([qty.unit.sym.fmt]) use space_before_unit_symbol -to determine whether there is a space -between the numerical value and the unit symbol.
Remarks: Pursuant to N4971, [namespace.std] ([spec.ext]), -users may specialize space_before_unit_symbol -for cv-unqualified program-defined types.
Such specializations shall be usable in constant expressions (N4971, [expr.const]) -and have type const bool.

5.4.4.4 Concepts [qty.unit.concepts]

template<typename T> -concept Unit = SymbolicConstant<T> && std::derived_from<T, unit-interface>; - -template<typename T> -concept PrefixableUnit = Unit<T> && is-derived-from-specialization-of<T, named_unit>(); - -template<typename T> -concept AssociatedUnit = Unit<U> && has-associated-quantity(U{}); - -template<typename U, auto QS> -concept UnitOf = AssociatedUnit<U> && QuantitySpec<decltype(QS)> && - QuantitySpecConvertibleTo<get_quantity_spec(U{}), QS> && - (get_kind(QS) == get_kind(get_quantity_spec(U{})) || - !NestedQuantityKindSpecOf<get_quantity_spec(U{}), QS>); - -template<auto From, auto To> -concept UnitConvertibleTo = // exposition only - Unit<decltype(From)> && Unit<decltype(To)> && (convertible(From, To)); - -template<typename U, auto FromU, auto QS> -concept UnitCompatibleWith = // exposition only - Unit<U> && Unit<decltype(FromU)> && QuantitySpec<decltype(QS)> && - (!AssociatedUnit<U> || UnitOf<U, QS>) && UnitConvertibleTo<FromU, U{}>; - -template<typename T> -concept OffsetUnit = Unit<T> && requires { T::point-origin; }; // exposition only - -template<typename From, typename To> -concept PotentiallyConvertibleTo = // exposition only - Unit<From> && Unit<To> && - ((AssociatedUnit<From> && AssociatedUnit<To> && - implicitly_convertible(get_quantity_spec(From{}), get_quantity_spec(To{}))) || - (!AssociatedUnit<From> && !AssociatedUnit<To>)); -

5.4.4.5 Types [qty.unit.types]

5.4.4.5.1 Canonical [qty.canon.unit]

namespace mp_units { - -template<UnitMagnitude M, Unit U> -struct canonical-unit { // exposition only - M mag; - U reference_unit; -}; - -} -
canonical-unit represents a unit expressed in terms of base units (IEC 60050, 112-01-18).
[Note 1: 
Other types representing units are equal only if they have the same type.
canonical-unit is used to implement binary relations other than equality.
— end note]
reference_unit is simplified ([qty.sym.expr.algos]).
consteval auto get-canonical-unit(Unit auto u); // exposition only -
Returns: The instantiation of canonical-unit for u.

5.4.4.5.2 Scaled [qty.scaled.unit]

namespace mp_units { - -template<UnitMagnitude auto M, Unit U> - requires(M != unit-magnitude<>{} && M != mag<1>) -struct scaled_unit final : unit-interface { - using base-type = scaled_unit; // exposition only - static constexpr UnitMagnitude auto mag = M; // exposition only - static constexpr U reference-unit{}; // exposition only - static constexpr auto point-origin = U::point_origin; // exposition only, present only - // if the qualified-id U​::​point_origin is valid and denotes an object -}; - -} -
scaled_unit<M, U> is used by the library -to represent the unit M ×U.

5.4.4.5.3 Named [qty.named.unit]

namespace mp_units { - -template<symbol_text Symbol, QuantityKindSpec auto QS> - requires(!Symbol.empty()) && BaseDimension<decltype(auto(QS.dimension))> -struct named_unit<Symbol, QS> : unit-interface { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto quantity-spec = QS; // exposition only -}; - -template<symbol_text Symbol, QuantityKindSpec auto QS, PointOrigin auto PO> - requires(!Symbol.empty()) && BaseDimension<decltype(auto(QS.dimension))> -struct named_unit<Symbol, QS, PO> : unit-interface { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto quantity-spec = QS; // exposition only - static constexpr auto point-origin = PO; // exposition only -}; - -template<symbol_text Symbol> - requires(!Symbol.empty()) -struct named_unit<Symbol> : unit-interface { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only -}; - -template<symbol_text Symbol, Unit auto U> - requires(!Symbol.empty()) -struct named_unit<Symbol, U> : decltype(U)::base-type { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only -}; - -template<symbol_text Symbol, Unit auto U, PointOrigin auto PO> - requires(!Symbol.empty()) -struct named_unit<Symbol, U, PO> : decltype(U)::base-type { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto point-origin = PO; // exposition only -}; - -template<symbol_text Symbol, AssociatedUnit auto U, QuantityKindSpec auto QS> - requires(!Symbol.empty()) && (QS.dimension == get-associated-quantity(U).dimension) -struct named_unit<Symbol, U, QS> : decltype(U)::base-type { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto quantity-spec = QS; // exposition only -}; - -template<symbol_text Symbol, AssociatedUnit auto U, QuantityKindSpec auto QS, - PointOrigin auto PO> - requires(!Symbol.empty()) && (QS.dimension == get-associated-quantity(U).dimension) -struct named_unit<Symbol, U, QS, PO> : decltype(U)::base-type { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto quantity-spec = QS; // exposition only - static constexpr auto point-origin = PO; // exposition only -}; - -} -
A named unit is a type that models PrefixableUnit.
A specialization of named_unit is used as a base type when defining a named unit.
In the following descriptions, let U be a named unit defined with an alluded signature.
The identifier of U represents -its unit name (IEC 60050, 112-01-15) -or special unit name (IEC 60050, 112-01-16).
Symbol is its unit symbol (IEC 60050, 112-01-17).
The possible arguments to named_unit are -
  • ,
  • ,
  • , and
  • .
The first signature defines the unit of a base quantity -without a unit prefix (IEC 60050, 112-01-26).
The second signature defines a unit -that can be reused by several base quantities.
The third and fourth signatures with a unit expression argument E -define U as implicitly convertible from E.
The first and fourth signatures with a kind of quantity (IEC 60050, 112-01-04) Q -also restrict U to Q.
A point origin argument specifies the default point origin of U ([qty.pt.syn]).
[Example 1: // The first signature defines a base unit restricted to a kind of base quantity. -inline constexpr struct second final : named_unit<"s", kind_of<time>> { -} second; - -// The third and fourth signatures give a name to the unit argument. -inline constexpr struct minute final : named_unit<"min", mag<60> * second> { -} minute; // . - -// The fourth signature also further restricts the kind of quantity. -inline constexpr struct hertz final : named_unit<"Hz", inverse(second), kind_of<frequency>> { -} hertz; // Hz can't measure becquerel, activity, - // or any other quantity with dimension - // that isn't a kind of frequency. - — end example]

5.4.4.5.4 Prefixed [qty.prefixed.unit]

namespace mp_units { - -template<symbol_text Symbol, UnitMagnitude auto M, PrefixableUnit auto U> - requires(!Symbol.empty()) -struct prefixed_unit : decltype(M * U)::base-type { - using base-type = prefixed_unit; // exposition only - static constexpr auto symbol = Symbol + U.symbol; // exposition only -}; - -} -
prefixed_unit<Symbol, M, U> represents the unit U with a unit prefix (IEC 60050, 112-01-26).
Symbol is the symbol of the unit prefix.
M is the factor of the unit prefix.
A specialization of prefixed_unit is used as a base type when defining a unit prefix.
[Example 1: template<PrefixableUnit auto U> -struct kilo_ : prefixed_unit<"k", mag_power<10, 3>, U> {}; - -template<PrefixableUnit auto U> -constexpr kilo_<U> kilo; - -inline constexpr auto kilogram = kilo<si::gram>; - — end example]

5.4.4.5.5 Common [qty.common.unit]

namespace mp_units { - -template<Unit U1, Unit U2, Unit... Rest> -struct common_unit final : decltype(get-common-scaled-unit(U1{}, U2{}, Rest{}...))::base-type -{ - using base-type = common_unit; // exposition only - static constexpr auto common-unit = // exposition only - get-common-scaled-unit(U1{}, U2{}, Rest{}...); -}; - -} -
common_unit is used by the library -to encapsulate a conversion factor between units (IEC 60050, 112-01-33) -common to the operands of quantity addition.
[Example 1: 
The result of 1 * km + 1 * mi -has a common unit -encapsulated by common_unit<mi, km>.
— end example]
-A program that instantiates a specialization of common_unit -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
template<Unit U1, Unit U2, Unit... Rest> -consteval Unit auto get-common-scaled-unit(U1, U2, Rest... rest) // exposition only - requires see below; -
Effects: Equivalent to: -constexpr auto res = [] { - constexpr auto canonical_lhs = get-canonical-unit(U1{}); - constexpr auto canonical_rhs = get-canonical-unit(U2{}); - constexpr auto common_mag = common-magnitude(canonical_lhs.mag, canonical_rhs.mag); - if constexpr (common_mag == mag<1>) - return canonical_lhs.reference_unit; - else - return scaled_unit<common_mag, decltype(auto(canonical_lhs.reference_unit))>{}; -}(); -if constexpr (sizeof...(rest) == 0) - return res; -else - return get-common-scaled-unit(res, rest...); -
Remarks: The expression in the requires-clause is equivalent to: -(convertible(U1{}, U2{}) && (sizeof...(Rest) == 0 || requires { - get-common-scaled-unit(get-common-scaled-unit(u1, u2), rest...); - })) -

5.4.4.5.6 Derived [qty.derived.unit]

namespace mp_units { - -template<typename... Expr> -struct derived-unit-impl : // exposition only - unit-interface, - expr-fractions<struct one, Expr...> { - using base-type = derived-unit-impl; // exposition only -}; - -template<SymbolicConstant... Expr> -struct derived_unit final : derived-unit-impl<Expr...> {}; - -} -
derived_unit is used by the library -to represent a derived unit (IEC 60050, 112-01-19).
[Example 1: using namespace si::unit_symbols; -int x = m * m; // error: cannot construct from derived_unit<power<si​::​metre, 2>> -int y = m * s; // error: cannot construct from derived_unit<si​::​metre, si​::​second> -int z = m / s; // error: cannot construct from derived_unit<si​::​metre, per<si​::​second>> - — end example]
-A program that instantiates a specialization of derived_unit -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.

5.4.4.5.7 One [qty.unit.one]

namespace mp_units { - -struct one final : derived-unit-impl<> {}; - -} -
one represents the base unit (IEC 60050, 112-01-18) of a quantity of dimension one (IEC 60050, 112-01-13).

5.4.4.6 Operations [qty.unit.ops]

namespace mp_units { - -struct unit-interface { // exposition only - template<UnitMagnitude M, Unit U> - friend consteval Unit auto operator*(M, U u); - - friend consteval Unit auto operator*(Unit auto, UnitMagnitude auto) = delete; - - template<UnitMagnitude M, Unit U> - friend consteval Unit auto operator/(M mag, U u); - - template<Unit Lhs, Unit Rhs> - friend consteval Unit auto operator*(Lhs lhs, Rhs rhs); - - template<Unit Lhs, Unit Rhs> - friend consteval Unit auto operator/(Lhs lhs, Rhs rhs); - - // [qty.unit.cmp], comparison - - template<Unit Lhs, Unit Rhs> - friend consteval bool operator==(Lhs, Rhs); - - template<Unit Lhs, Unit Rhs> - friend consteval bool equivalent(Lhs lhs, Rhs rhs); -}; - -} -
template<UnitMagnitude M, Unit U> -friend consteval Unit auto operator*(M, U u); -
Effects: Equivalent to: -if constexpr (std::is_same_v<M, decltype(auto(mag<1>))>) - return u; -else if constexpr (is-specialization-of<U, scaled_unit>()) { - if constexpr (M{} * U::mag == mag<1>) - return U::reference-unit; - else - return scaled_unit<M{} * U::mag, decltype(auto(U::reference-unit))>{}; -} else - return scaled_unit<M{}, U>{}; -
friend consteval Unit auto operator*(Unit auto, UnitMagnitude auto) = delete; -
Recommended practice: Suggest swapping the operands.
template<UnitMagnitude M, Unit U> -friend consteval Unit auto operator/(M mag, U u); -
Returns: mag * inverse(u).
template<Unit Lhs, Unit Rhs> -friend consteval Unit auto operator*(Lhs lhs, Rhs rhs); -
Returns: expr-multiply<derived_unit, struct one>(lhs, rhs).
template<Unit Lhs, Unit Rhs> -friend consteval Unit auto operator/(Lhs lhs, Rhs rhs); -
Returns: expr-divide<derived_unit, struct one>(lhs, rhs).
consteval Unit auto inverse(Unit auto u); -
Returns: one / u.
template<std::intmax_t Num, std::intmax_t Den = 1, Unit U> - requires(Den != 0) -consteval Unit auto pow(U u); -
Returns: expr-pow<Num, Den, derived_unit, struct one>(u).
consteval Unit auto sqrt(Unit auto u); -
Returns: pow<1, 2>(u).
consteval Unit auto cbrt(Unit auto u); -
Returns: pow<1, 3>(u).
consteval Unit auto square(Unit auto u); -
Returns: pow<2>(u).
consteval Unit auto cubic(Unit auto u); -
Returns: pow<3>(u).

5.4.4.7 Comparison [qty.unit.cmp]

template<Unit Lhs, Unit Rhs> -friend consteval bool operator==(Lhs, Rhs); -
Returns: std​::​is_same_v<Lhs, Rhs>.
template<Unit Lhs, Unit Rhs> -friend consteval bool equivalent(Lhs lhs, Rhs rhs); -
Effects: Equivalent to: -const auto lhs_canonical = get-canonical-unit(lhs); -const auto rhs_canonical = get-canonical-unit(rhs); -return lhs_canonical.mag == rhs_canonical.mag && - lhs_canonical.reference_unit == rhs_canonical.reference_unit; -
template<Unit From, Unit To> -consteval bool convertible(From from, To to); -
Effects: Equivalent to: -if constexpr (std::is_same_v<From, To>) - return true; -else if constexpr (PotentiallyConvertibleTo<From, To>) - return std::is_same_v<decltype(get-canonical-unit(from).reference_unit), - decltype(get-canonical-unit(to).reference_unit)>; -else - return false; -

5.4.4.8 Observers [qty.unit.obs]

consteval QuantitySpec auto get_quantity_spec(AssociatedUnit auto u); -
Returns: kind_of<get-associated-quantity(u)>.
consteval Unit auto get_unit(AssociatedUnit auto u); -
Returns: u.
consteval Unit auto get_common_unit(Unit auto... us) - requires see below; -
Let -
  • u1 be us...[0],
  • u2 be us...[1],
  • U1 be decltype(u1),
  • U2 be decltype(u2), and
  • rest be a pack denoting the elements of us without u1 and u2.
Effects: Equivalent to: -if constexpr (sizeof...(us) == 1) - return u1; -else if constexpr (sizeof...(us) == 2) { - if constexpr (is-derived-from-specialization-of<U1, common_unit>()) { - return TBD.; - } else if constexpr (is-derived-from-specialization-of<U2, common_unit>()) - return get_common_unit(u2, u1); - else if constexpr (std::is_same_v<U1, U2>) - return u1; - else if constexpr (equivalent(U1{}, U2{})) { - if constexpr (std::derived_from<U1, typename U2::base-type>) - return u1; - else if constexpr (std::derived_from<U2, typename U1::base-type>) - return u2; - else - return std::conditional_t<type-less-impl<U1, U2>(), U1, U2>{}; - } else { - constexpr auto canonical_lhs = get-canonical-unit(U1{}); - constexpr auto canonical_rhs = get-canonical-unit(U2{}); - - if constexpr (is-positive-integral-power(canonical_lhs.mag / canonical_rhs.mag)) - return u2; - else if constexpr (is-positive-integral-power(canonical_rhs.mag / canonical_lhs.mag)) - return u1; - else { - if constexpr (type-less<U1, U2>{}) - return common_unit<U1, U2>{}; - else - return common_unit<U2, U1>{}; - } - } -} else - return get_common_unit(get_common_unit(u1, u2), rest...); -
Remarks: The expression in the requires-clause is equivalent to: -(sizeof...(us) != 0 && (sizeof...(us) == 1 || // - (sizeof...(us) == 2 && convertible(U1{}, U2{})) || - requires { get_common_unit(get_common_unit(u1, u2), rest...); })) -

5.4.4.9 Associated quantity [assoc.qty]

template<Unit U> -consteval bool has-associated-quantity(U); // exposition only -
Returns:
  • If U​::​quantity-spec is a valid expression, -returns true.
  • Otherwise, if U​::​reference-unit is a valid expression, -returns -has-associated-quantity(U::reference-unit) -
  • Otherwise, if -is-derived-from-specialization-of<U, expr-fractions>() -is true, -let Nums and Dens -be packs denoting the template arguments of -U​::​nums and U​::​dens, respectively.
    Returns -(... && has-associated-quantity(expr-type<Nums>{})) && - (... && has-associated-quantity(expr-type<Dens>{})) -
  • Otherwise, returns false.
template<AssociatedUnit U> -consteval auto get-associated-quantity(U u); // exposition only -
Returns:
  • If U is of the form common_unit<Us...>, -returns -get_common_quantity_spec(get-associated-quantity(Us{})...) -
  • Otherwise, if U​::​quantity-spec is a valid expression, -returns -remove-kind(U::quantity-spec) -
  • Otherwise, if U​::​reference-unit is a valid expression, -returns -get-associated-quantity(U::reference-unit) -
  • Otherwise, if -is-derived-from-specialization-of<U, expr-fractions>() -is true, -returns -expr-map<to-quantity-spec, derived_quantity_spec, struct dimensionless>(u) - -where to-quantity-spec is defined as follows: -template<AssociatedUnit U> -using to-quantity-spec = decltype(get-associated-quantity(U{})); // exposition only -

5.4.4.10 Symbol formatting [qty.unit.sym.fmt]

template<typename CharT = char, std::output_iterator<CharT> Out, Unit U> -constexpr Out unit_symbol_to(Out out, U u, const unit_symbol_formatting& fmt = {}); -
Effects: TBD.
Returns: TBD.
template<unit_symbol_formatting fmt = {}, typename CharT = char, Unit U> -consteval std::string_view unit_symbol(U); -
Effects: Equivalent to: -TBD. -

5.4.5 Concepts [qty.ref.concepts]

template<typename T> -concept Reference = AssociatedUnit<T> || (is-specialization-of<T, reference>()); -
A type T that satisfies Reference -represents the reference of a quantity (IEC 60050, 112-01-01).
template<typename T, auto QS> -concept ReferenceOf = Reference<T> && QuantitySpecOf<decltype(get_quantity_spec(T{})), QS>; -

5.4.6 Class template reference [qty.ref.syn]

namespace mp_units { - -template<QuantitySpec auto Q, Unit auto U> -using reference-t = reference<decltype(Q), decltype(U)>; // exposition only - -template<QuantitySpec Q, Unit U> -struct reference { - // [qty.ref.ops], operations - - template<typename Q2, typename U2> - friend consteval auto operator*(reference, reference<Q2, U2>) - -> reference-t<Q{} * Q2{}, U{} * U2{}>; - - template<AssociatedUnit U2> - friend consteval auto operator*(reference, U2) - -> reference-t<Q{} * get_quantity_spec(U2{}), U{} * U2{}>; - - template<AssociatedUnit U1> - friend consteval auto operator*(U1, reference) - -> reference-t<get_quantity_spec(U1{}) * Q{}, U1{} * U{}>; - - template<typename Q2, typename U2> - friend consteval auto operator/(reference, reference<Q2, U2>) - -> reference-t<Q{} / Q2{}, U{} / U2{}>; - - template<AssociatedUnit U2> - friend consteval auto operator/(reference, U2) - -> reference-t<Q{} / get_quantity_spec(U2{}), U{} / U2{}>; - - template<AssociatedUnit U1> - friend consteval auto operator/(U1, reference) - -> reference-t<get_quantity_spec(U1{}) / Q{}, U1{} / U{}>; - - friend consteval auto inverse(reference) -> reference-t<inverse(Q{}), inverse(U{})>; - - template<std::intmax_t Num, std::intmax_t Den = 1> - requires(Den != 0) - friend consteval auto pow(reference) -> reference-t<pow<Num, Den>(Q{}), pow<Num, Den>(U{})>; - friend consteval auto sqrt(reference) -> reference-t<sqrt(Q{}), sqrt(U{})>; - friend consteval auto cbrt(reference) -> reference-t<cbrt(Q{}), cbrt(U{})>; - - // [qty.ref.cmp], comparison - - template<typename Q2, typename U2> - friend consteval bool operator==(reference, reference<Q2, U2>); - - template<AssociatedUnit U2> - friend consteval bool operator==(reference, U2 u2); - - template<typename Q2, typename U2> - friend consteval bool convertible(reference, reference<Q2, U2>); - - template<AssociatedUnit U2> - friend consteval bool convertible(reference, U2 u2); - - template<AssociatedUnit U1> - friend consteval bool convertible(U1 u1, reference); -}; - -} -
reference<Q, U> represents the reference of a quantity (IEC 60050, 112-01-01).
The unit of measurement U (IEC 60050, 112-01-14) -is used to measure a value of the quantity Q (IEC 60050, 112-01-28).
[Note 1: 
reference is typically implicitly instantiated -when specifying that a unit measures a more specific quantity.
[Example 1: using namespace si::unit_symbols; -auto x = 1 * m; // measures a length -auto y = 1 * isq::width[m]; // measures a width -auto z = 1 * isq::diameter[m]; // measures a diameter - — end example]
— end note]

5.4.7 Operations [qty.ref.ops]

Each member function with a trailing-return-type -of -> reference-t<T...> -returns {}.
template<typename FwdRep, Reference R, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> - requires(!OffsetUnit<decltype(get_unit(R{}))>) -constexpr quantity<R{}, Rep> operator*(FwdRep&& lhs, R r); -
Effects: Equivalent to: -return quantity{std​::​forward<FwdRep>(lhs), r};
template<typename FwdRep, Reference R, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> - requires(!OffsetUnit<decltype(get_unit(R{}))>) -constexpr Quantity auto operator/(FwdRep&& lhs, R); -
Effects: Equivalent to: -return quantity{std​::​forward<FwdRep>(lhs), inverse(R{})};
template<typename FwdQ, Reference R, Quantity Q = std::remove_cvref_t<FwdQ>> -constexpr Quantity auto operator*(FwdQ&& q, R); -template<typename FwdQ, Reference R, Quantity Q = std::remove_cvref_t<FwdQ>> -constexpr Quantity auto operator/(FwdQ&& q, R); -
Let @ be the operator.
Effects: Equivalent to: -return quantity{std::forward<FwdQ>(q).numerical-value, Q::reference @ R{}}; -
template<Reference R, typename Rep> - requires RepresentationOf<std::remove_cvref_t<Rep>, get_quantity_spec(R{})> -constexpr auto operator*(R, Rep&&) = delete; - -template<Reference R, typename Rep> - requires RepresentationOf<std::remove_cvref_t<Rep>, get_quantity_spec(R{})> -constexpr auto operator/(R, Rep&&) = delete; - -template<Reference R, typename Q> - requires Quantity<std::remove_cvref_t<Q>> -constexpr auto operator*(R, Q&&) = delete; - -template<Reference R, typename Q> - requires Quantity<std::remove_cvref_t<Q>> -constexpr auto operator/(R, Q&&) = delete; -
Recommended practice: Suggest swapping the operands.

5.4.8 Comparison [qty.ref.cmp]

template<typename Q2, typename U2> -friend consteval bool operator==(reference, reference<Q2, U2>); -
Returns: Q{} == Q2{} && U{} == U2{}.
template<AssociatedUnit U2> -friend consteval bool operator==(reference, U2 u2); -
Returns: Q{} == get_quantity_spec(u2) && U{} == u2.
template<typename Q2, typename U2> -friend consteval bool convertible(reference, reference<Q2, U2>); -
Returns: implicitly_convertible(Q{}, Q2{}) && convertible(U{}, U2{}).
template<AssociatedUnit U2> -friend consteval bool convertible(reference, U2 u2); -
Returns: implicitly_convertible(Q{}, get_quantity_spec(u2)) && convertible(U{}, u2).
template<AssociatedUnit U1> -friend consteval bool convertible(U1 u1, reference); -
Returns: implicitly_convertible(get_quantity_spec(u1), Q{}) && convertible(u1, U{}).

5.4.9 Observers [qty.ref.obs]

template<typename Q, typename U> -consteval QuantitySpec auto get_quantity_spec(reference<Q, U>); -
Returns: Q{}.
template<typename Q, typename U> -consteval Unit auto get_unit(reference<Q, U>); -
Returns: U{}.
consteval AssociatedUnit auto get_common_reference(AssociatedUnit auto u1, - AssociatedUnit auto u2, - AssociatedUnit auto... rest) - requires see below; -
Returns: get_common_unit(u1, u2, rest...).
Remarks: The expression in the requires-clause is equivalent to: -requires { - get_common_quantity_spec(get_quantity_spec(u1), get_quantity_spec(u2), - get_quantity_spec(rest)...); - { get_common_unit(u1, u2, rest...) } -> AssociatedUnit; -} -
template<Reference R1, Reference R2, Reference... Rest> -consteval Reference auto get_common_reference(R1 r1, R2 r2, Rest... rest) - requires see below; -
Returns: reference-t<get_common_quantity_spec(get_quantity_spec(R1{}), get_quantity_spec(R2{}), - get_quantity_spec(rest)...), - get_common_unit(get_unit(R1{}), get_unit(R2{}), get_unit(rest)...)>{}; -
Remarks: The expression in the requires-clause is equivalent to: -requires { - get_common_quantity_spec(get_quantity_spec(r1), get_quantity_spec(r2), - get_quantity_spec(rest)...); - get_common_unit(get_unit(r1), get_unit(r2), get_unit(rest)...); -} -

5.5 Representation [qty.rep]

5.5.1 General [qty.rep.general]

Subclause [qty.rep] specifies the components -used to constrain the numerical value of a quantity (IEC 60050, 112-01-29).

5.5.2 Traits [qty.rep.traits]

5.5.2.1 Floating-point [qty.fp.traits]

template<typename T> -struct actual-value-type : cond-value-type<T> {}; // see N4971, [readable.traits] - -template<typename T> - requires(!std::is_pointer_v<T> && !std::is_array_v<T>) && - requires { typename std::indirectly_readable_traits<T>::value_type; } -struct actual-value-type<T> : std::indirectly_readable_traits<T> {}; - -template<typename T> -using actual-value-type-t = actual-value-type<T>::value_type; - -template<typename Rep> -constexpr bool treat_as_floating_point = - std::chrono::treat_as_floating_point_v<actual-value-type-t<Rep>>; -
quantity and quantity_point use treat_as_floating_point -to help determine whether implicit conversions are allowed among them.
Remarks: Pursuant to N4971, [namespace.std] ([spec.ext]), -users may specialize treat_as_floating_point -for cv-unqualified program-defined types.
Such specializations shall be usable in constant expressions (N4971, [expr.const]) -and have type const bool.

5.5.2.2 Quantity character [qty.char.traits]

template<typename T> -constexpr bool disable_scalar = false; -template<typename T> -constexpr bool disable_complex = false; -template<typename T> -constexpr bool disable_vector = false; -
Some quantities are defined as having a numerical value (IEC 60050, 112-01-29) of a specific set (IEC 60050, 102-01-02).
The representation concepts use these traits -to help determine the sets T represents.
Remarks: Pursuant to N4971, [namespace.std] ([spec.ext]), -users may specialize these templates -for cv-unqualified program-defined types.
Such specializations shall be usable in constant expressions (N4971, [expr.const]) -and have type const bool.
[Note 1: 
These templates prevent use of representation types with the library -that satisfy but do not in fact model their corresponding concept.
— end note]

5.5.2.3 Values [qty.val.traits]

quantity and quantity_point use representation_values -to construct special values of its representation type.
namespace mp_units { - -template<typename Rep> -struct representation_values : std::chrono::duration_values<Rep> { - static constexpr Rep one() noexcept; -}; - -} -
The requirements on std​::​chrono​::​duration_values<Rep> (N4971, [time.traits.duration.values]) -also apply to representation_values<Rep>.
static constexpr Rep one() noexcept; -
Returns: Rep(1).
Remarks: The value returned shall be the neutral element for multiplication (IEC 60050, 102-01-19).

5.5.3 Customization point objects [qty.rep.cpos]

5.5.3.2 mp_units​::​real [qty.real.cpo]

The name mp_units​::​real denotes a customization point object (N4971, [customization.point.object]).
Given a subexpression E with type T, -let t be an lvalue that denotes the reified object for E.
Then: -
  • If T does not model WeaklyRegular, -mp_units​::​real(E) is ill-formed.
  • If auto(t.real()) is a valid expression whose type models Scalar, -mp_units​::​real(E) is expression-equivalent to auto(t.real()).
  • Otherwise, if T is a class or enumeration type and -auto(real(t)) is a valid expression whose type models Scalar -where the meaning of real is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​real(E) is expression-equivalent to that expression.
  • Otherwise, mp_units​::​real(E) is ill-formed.

5.5.3.3 mp_units​::​imag [qty.imag.cpo]

The name mp_units​::​imag denotes a customization point object (N4971, [customization.point.object]).
Given a subexpression E with type T, -let t be an lvalue that denotes the reified object for E.
Then: -
  • If T does not model WeaklyRegular, -mp_units​::​imag(E) is ill-formed.
  • If auto(t.imag()) is a valid expression whose type models Scalar, -mp_units​::​imag(E) is expression-equivalent to auto(t.imag()).
  • Otherwise, if T is a class or enumeration type and -auto(imag(t)) is a valid expression whose type models Scalar -where the meaning of imag is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​imag(E) is expression-equivalent to that expression.
  • Otherwise, mp_units​::​imag(E) is ill-formed.

5.5.3.4 mp_units​::​modulus [qty.modulus.cpo]

The name mp_units​::​modulus denotes a customization point object (N4971, [customization.point.object]).
Given a subexpression E with type T, -let t be an lvalue that denotes the reified object for E.
Then: -
  • If T does not model WeaklyRegular, -mp_units​::​modulus(E) is ill-formed.
  • If auto(t.modulus()) is a valid expression whose type models Scalar, -mp_units​::​modulus(E) is expression-equivalent to auto(t.modulus()).
  • Otherwise, if T is a class or enumeration type and -auto(modulus(t)) is a valid expression whose type models Scalar -where the meaning of modulus is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​modulus(E) is expression-equivalent to that expression.
  • If auto(t.abs()) is a valid expression whose type models Scalar, -mp_units​::​modulus(E) is expression-equivalent to auto(t.abs()).
  • Otherwise, if T is a class or enumeration type and -auto(abs(t)) is a valid expression whose type models Scalar -where the meaning of abs is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​modulus(E) is expression-equivalent to that expression.
  • Otherwise, mp_units​::​modulus(E) is ill-formed.

5.5.3.5 mp_units​::​magnitude [qty.mag.cpo]

The name mp_units​::​magnitude denotes a customization point object (N4971, [customization.point.object]).
Given a subexpression E with type T, -let t be an lvalue that denotes the reified object for E.
Then: -
  • If T does not model WeaklyRegular, -mp_units​::​magnitude(E) is ill-formed.
  • If auto(t.magnitude()) is a valid expression whose type models Scalar, -mp_units​::​magnitude(E) is expression-equivalent to auto(t.magnitude()).
  • Otherwise, if T is a class or enumeration type and -auto(magnitude(t)) is a valid expression whose type models Scalar -where the meaning of magnitude is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​magnitude(E) is expression-equivalent to that expression.
  • Otherwise, if auto(t.abs()) is a valid expression whose type models Scalar, -mp_units​::​magnitude(​E) is expression-equivalent to auto(t.abs()).
  • Otherwise, if T is a class or enumeration type and -auto(abs(t)) is a valid expression whose type models Scalar -where the meaning of magnitude is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​magnitude(E) is expression-equivalent to that expression.
  • Otherwise, mp_units​::​magnitude(E) is ill-formed.

5.5.4 Concepts [qty.rep.concepts]

template<typename T> -concept WeaklyRegular = std::copyable<T> && std::equality_comparable<T>; // exposition only - -template<typename T> -concept Scalar = (!disable_scalar<T>) && WeaklyRegular<T> && requires(T a, T b) { // exposition only - // scalar operations - { -a } -> std::common_with<T>; - { a + b } -> std::common_with<T>; - { a - b } -> std::common_with<T>; - { a * b } -> std::common_with<T>; - { a / b } -> std::common_with<T>; -}; -
TBD.
template<typename T> -using value-type-t = actual-value-type-t<T>; // exposition only, see [qty.fp.traits] - -template<typename T> -concept Complex = // exposition only - (!disable_complex<T>) && WeaklyRegular<T> && Scalar<value-type-t<T>> && - std::constructible_from<T, value-type-t<T>, value-type-t<T>> && - requires(T a, T b, value-type-t<T> s) { - // complex operations - { -a } -> std::common_with<T>; - { a + b } -> std::common_with<T>; - { a - b } -> std::common_with<T>; - { a * b } -> std::common_with<T>; - { a / b } -> std::common_with<T>; - { a * s } -> std::common_with<T>; - { s * a } -> std::common_with<T>; - { a / s } -> std::common_with<T>; - ::mp_units::real(a); - ::mp_units::imag(a); - ::mp_units::modulus(a); - }; -
TBD.
template<typename T> -concept Vector = // exposition only - (!disable_vector<T>) && WeaklyRegular<T> && Scalar<value-type-t<T>> && - requires(T a, T b, value-type-t<T> s) { - // vector operations - { -a } -> std::common_with<T>; - { a + b } -> std::common_with<T>; - { a - b } -> std::common_with<T>; - { a * s } -> std::common_with<T>; - { s * a } -> std::common_with<T>; - { a / s } -> std::common_with<T>; - ::mp_units::magnitude(a); - }; -
TBD.
template<typename T> -using scaling-factor-type-t = // exposition only - std::conditional_t<treat_as_floating_point<T>, long double, std::intmax_t>; - -template<typename T> -concept ScalarRepresentation = // exposition only - (!is-specialization-of<T, quantity>()) && Scalar<T> && - requires(T a, T b, scaling-factor-type-t<T> f) { - // scaling - { a * f } -> std::common_with<T>; - { f * a } -> std::common_with<T>; - { a / f } -> std::common_with<T>; - }; -
TBD.
template<typename T> -concept ComplexRepresentation = // exposition only - (!is-specialization-of<T, quantity>()) && Complex<T> && - requires(T a, T b, scaling-factor-type-t<T> f) { - // scaling - { a * T(f) } -> std::common_with<T>; - { T(f) * a } -> std::common_with<T>; - { a / T(f) } -> std::common_with<T>; - }; -
TBD.
template<typename T> -concept VectorRepresentation = // exposition only - (!is-specialization-of<T, quantity>()) && Vector<T>; -
TBD.
template<typename T> -concept Representation = ScalarRepresentation<T> || ComplexRepresentation<T> || - VectorRepresentation<T>; -
A type T models Representation if -it represents the numerical value of a quantity (IEC 60050, 112-01-29).
template<typename T, quantity_character Ch> -concept IsOfCharacter = (Ch == quantity_character::real_scalar && Scalar<T>) || // exposition only - (Ch == quantity_character::complex_scalar && Complex<T>) || - (Ch == quantity_character::vector && Vector<T>); - -template<typename T, auto V> -concept RepresentationOf = - Representation<T> && ((QuantitySpec<decltype(V)> && - (QuantityKindSpec<decltype(V)> || IsOfCharacter<T, V.character>)) || - (std::same_as<quantity_character, decltype(V)> && IsOfCharacter<T, V>)); -
A type T models RepresentationOf<V> if -T models Representation and -
  • V is a kind of quantity, or
  • if V is a quantity, then T represents a value of its character, or
  • if V is a quantity character, then T represents a value of V.

5.6 Quantity [qty]

5.6.1 General [qty.general]

Subclause [qty] describes the class template quantity -that represents the value of a quantity (IEC 60050, 112-01-28) -that is an element of a vector space (IEC 60050, 102-03-01,102-03-04).

5.6.2 Interoperability [qty.like]

The interfaces specified in this subclause and subclause [qty.pt.like] -are used by quantity and quantity_point -to specify conversions with other types representing quantities.
[Note 1: 
[qty.chrono] implements them for std​::​chrono​::​duration and std​::​chrono​::​time_point.
— end note]
template<typename T, template<typename> typename Traits> -concept qty-like-impl = requires(const T& qty, const Traits<T>::rep& num) { // exposition only - { Traits<T>::to_numerical_value(qty) } -> std::same_as<typename Traits<T>::rep>; - { Traits<T>::from_numerical_value(num) } -> std::same_as<T>; - requires std::same_as<decltype(Traits<T>::explicit_import), const bool>; - requires std::same_as<decltype(Traits<T>::explicit_export), const bool>; - typename std::bool_constant<Traits<T>::explicit_import>; - typename std::bool_constant<Traits<T>::explicit_export>; -}; - -template<typename T> -concept QuantityLike = !Quantity<T> && qty-like-impl<T, quantity_like_traits> && requires { - typename quantity<quantity_like_traits<T>::reference, typename quantity_like_traits<T>::rep>; -}; -
In the following descriptions, let -
  • Traits be quantity_like_traits or quantity_point_like_traits,
  • Q be a type for which Traits<Q> is specialized,
  • qty be an lvalue of type const Q, and
  • num be an lvalue of type const Traits<Q>​::​rep.
Q models qty-like-impl<Traits> if and only if: -
  • Traits<Q>​::​to_numerical_value(qty) returns the numerical value (IEC 60050, 112-01-29) of qty.
  • Traits<Q>​::​from_numerical_value(num) returns a Q with numerical value num.
  • If Traits is quantity_point_like_traits, -both numerical values are offset from Traits<Q>​::​point_origin.
If the following expression is true, the specified conversion will be explicit.
  • Traits<Q>​::​explicit_import for the conversion from Q to this library's type.
  • Traits<Q>​::​explicit_export for the conversion from this library's type to Q.

5.6.3 Class template quantity [qty.syn]

namespace mp_units { - -template<typename T> -concept Quantity = (is-derived-from-specialization-of<T, quantity>()); // exposition only - -template<typename Q, auto QS> -concept QuantityOf = // exposition only - Quantity<Q> && QuantitySpecOf<decltype(auto(Q::quantity_spec)), QS>; - -template<Unit UFrom, Unit UTo> -consteval bool integral-conversion-factor(UFrom from, UTo to) // exposition only -{ - return is-integral(get-canonical-unit(from).mag / get-canonical-unit(to).mag); -} - -template<typename T> -concept IsFloatingPoint = treat_as_floating_point<T>; // exposition only - -template<typename FromRep, typename ToRep, auto FromUnit = one, auto ToUnit = one> -concept ValuePreservingTo = // exposition only - Representation<std::remove_cvref_t<FromRep>> && Representation<ToRep> && - Unit<decltype(FromUnit)> && Unit<decltype(ToUnit)> && std::assignable_from<ToRep&, FromRep> && - (IsFloatingPoint<ToRep> || (!IsFloatingPoint<std::remove_cvref_t<FromRep>> && - (integral-conversion-factor(FromUnit, ToUnit)))); - -template<typename QFrom, typename QTo> -concept QuantityConvertibleTo = // exposition only - Quantity<QFrom> && Quantity<QTo> && - QuantitySpecConvertibleTo<QFrom::quantity_spec, QTo::quantity_spec> && - UnitConvertibleTo<QFrom::unit, QTo::unit> && - ValuePreservingTo<typename QFrom::rep, typename QTo::rep, QFrom::unit, QTo::unit> && - requires(QFrom q) { sudo-cast<QTo>(q); }; // see [qty.non.mem.conv] - -template<auto QS, typename Func, typename T, typename U> -concept InvokeResultOf = // exposition only - QuantitySpec<decltype(QS)> && std::regular_invocable<Func, T, U> && - RepresentationOf<std::invoke_result_t<Func, T, U>, QS>; - -template<typename Func, typename Q1, typename Q2, - auto QS = std::invoke_result_t<Func, decltype(auto(Q1::quantity_spec)), - decltype(auto(Q2::quantity_spec))>{}> -concept InvocableQuantities = // exposition only - QuantitySpec<decltype(QS)> && Quantity<Q1> && Quantity<Q2> && - InvokeResultOf<QS, Func, typename Q1::rep, typename Q2::rep>; - -template<auto R1, auto R2> -concept HaveCommonReference = requires { get_common_reference(R1, R2); }; // exposition only - -template<typename Func, Quantity Q1, Quantity Q2> -using common-quantity-for = // exposition only - quantity<get_common_reference(Q1::reference, Q2::reference), - std::invoke_result_t<Func, typename Q1::rep, typename Q2::rep>>; - -template<typename Func, typename Q1, typename Q2> -concept CommonlyInvocableQuantities = // exposition only - Quantity<Q1> && Quantity<Q2> && HaveCommonReference<Q1::reference, Q2::reference> && - std::convertible_to<Q1, common-quantity-for<Func, Q1, Q2>> && - std::convertible_to<Q2, common-quantity-for<Func, Q1, Q2>> && - InvocableQuantities<Func, Q1, Q2, - get_common_quantity_spec(Q1::quantity_spec, Q2::quantity_spec)>; - -template<auto R1, auto R2, typename Rep1, typename Rep2> -concept SameValueAs = // exposition only - (equivalent(get_unit(R1), get_unit(R2))) && std::convertible_to<Rep1, Rep2>; - -template<typename T> -using quantity-like-type = // exposition only - quantity<quantity_like_traits<T>::reference, typename quantity_like_traits<T>::rep>; - -template<typename T, typename U, typename TT = std::remove_reference_t<T>> -concept Mutable = (!std::is_const_v<TT>) && std::derived_from<TT, U>; // exposition only - -template<Reference auto R, RepresentationOf<get_quantity_spec(R)> Rep = double> -class quantity { -public: - Rep numerical-value; // exposition only - - // member types and values - static constexpr Reference auto reference = R; - static constexpr QuantitySpec auto quantity_spec = get_quantity_spec(reference); - static constexpr Dimension auto dimension = quantity_spec.dimension; - static constexpr Unit auto unit = get_unit(reference); - using rep = Rep; - - // [qty.static], static member functions - static constexpr quantity zero() noexcept - requires see below; - static constexpr quantity one() noexcept - requires see below; - static constexpr quantity min() noexcept - requires see below; - static constexpr quantity max() noexcept - requires see below; - - // [qty.cons], constructors and assignment - - quantity() = default; - quantity(const quantity&) = default; - quantity(quantity&&) = default; - ~quantity() = default; - - template<typename FwdValue, Reference R2> - requires SameValueAs<R2{}, R, std::remove_cvref_t<FwdValue>, Rep> - constexpr quantity(FwdValue&& v, R2); - - template<typename FwdValue, Reference R2, typename Value = std::remove_cvref_t<FwdValue>> - requires(!SameValueAs<R2{}, R, Value, Rep>) && - QuantityConvertibleTo<quantity<R2{}, Value>, quantity> - constexpr quantity(FwdValue&& v, R2); - - template<ValuePreservingTo<Rep> FwdValue> - requires(unit == ::mp_units::one) - constexpr quantity(FwdValue&& v); - - template<QuantityConvertibleTo<quantity> Q> - constexpr explicit(see below) quantity(const Q& q); - - template<QuantityLike Q> - requires QuantityConvertibleTo<quantity-like-type<Q>, quantity> - constexpr explicit(see below) quantity(const Q& q); - - quantity& operator=(const quantity&) = default; - quantity& operator=(quantity&&) = default; - - template<ValuePreservingTo<Rep> FwdValue> - requires(unit == ::mp_units::one) - constexpr quantity& operator=(FwdValue&& v); - - // [qty.conv], conversions - - template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires QuantityConvertibleTo<quantity, quantity<make-reference(quantity_spec, ToU{}), Rep>> - constexpr QuantityOf<quantity_spec> auto in(ToU) const; - - template<RepresentationOf<quantity_spec> ToRep> - requires QuantityConvertibleTo<quantity, quantity<reference, ToRep>> - constexpr QuantityOf<quantity_spec> auto in() const; - - template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires QuantityConvertibleTo<quantity, - quantity<make-reference(quantity_spec, ToU{}), ToRep>> - constexpr QuantityOf<quantity_spec> auto in(ToU) const; - - template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires requires(const quantity q) { value_cast<ToU{}>(q); } - constexpr QuantityOf<quantity_spec> auto force_in(ToU) const; - - template<RepresentationOf<quantity_spec> ToRep> - requires requires(const quantity q) { value_cast<ToRep>(q); } - constexpr QuantityOf<quantity_spec> auto force_in() const; - - template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires requires(const quantity q) { value_cast<ToU{}, ToRep>(q); } - constexpr QuantityOf<quantity_spec> auto force_in(ToU) const; - - // [qty.obs], numerical value observers - - template<Unit U> - requires(equivalent(U{}, unit)) - constexpr rep& numerical_value_ref_in(U) & noexcept; - template<Unit U> - requires(equivalent(U{}, unit)) - constexpr const rep& numerical_value_ref_in(U) const & noexcept; - template<Unit U> - requires(equivalent(U{}, unit)) - void numerical_value_ref_in(U) const && = delete; - - template<UnitCompatibleWith<unit, quantity_spec> U> - requires QuantityConvertibleTo<quantity, quantity<make-reference(quantity_spec, U{}), Rep>> - constexpr rep numerical_value_in(U) const noexcept; - - template<UnitCompatibleWith<unit, quantity_spec> U> - requires requires(const quantity q) { value_cast<U{}>(q); } - constexpr rep force_numerical_value_in(U) const noexcept; - - // [qty.conv.ops], conversion operations - - template<typename V_, std::constructible_from<Rep> Value = std::remove_cvref_t<V_>> - requires(unit == ::mp_units::one) - explicit operator V_() const & noexcept; - - template<typename Q_, QuantityLike Q = std::remove_cvref_t<Q_>> - requires QuantityConvertibleTo<quantity, quantity-like-type<Q>> - constexpr explicit(see below) operator Q_() const noexcept(see below); - - // [qty.unary.ops], unary operations - - constexpr QuantityOf<quantity_spec> auto operator+() const - requires see below; - constexpr QuantityOf<quantity_spec> auto operator-() const - requires see below; - - template<Mutable<quantity> Q> - friend constexpr decltype(auto) operator++(Q&& q) - requires see below; - template<Mutable<quantity> Q> - friend constexpr decltype(auto) operator--(Q&& q) - requires see below; - - constexpr QuantityOf<quantity_spec> auto operator++(int) - requires see below; - constexpr QuantityOf<quantity_spec> auto operator--(int) - requires see below; - - // [qty.assign.ops], compound assignment operations - - template<Mutable<quantity> Q, auto R2, typename Rep2> - requires see below - friend constexpr decltype(auto) operator+=(Q&& lhs, const quantity<R2, Rep2>& rhs); - template<Mutable<quantity> Q, auto R2, typename Rep2> - requires see below - friend constexpr decltype(auto) operator-=(Q&& lhs, const quantity<R2, Rep2>& rhs); - template<Mutable<quantity> Q, auto R2, typename Rep2> - requires see below - friend constexpr decltype(auto) operator%=(Q&& lhs, const quantity<R2, Rep2>& rhs); - - template<Mutable<quantity> Q, ValuePreservingTo<Rep> Value> - requires see below - friend constexpr decltype(auto) operator*=(Q&& lhs, const Value& rhs); - template<Mutable<quantity> Q, ValuePreservingTo<Rep> Value> - requires see below - friend constexpr decltype(auto) operator/=(Q&& lhs, const Value& rhs); - - template<Mutable<quantity> Q, QuantityOf<dimensionless> Q2> - requires see below - friend constexpr decltype(auto) operator*=(Q&& lhs, const Q2& rhs); - template<Mutable<quantity> Q, QuantityOf<dimensionless> Q2> - requires see below - friend constexpr decltype(auto) operator/=(Q&& lhs, const Q2& rhs); - - // [qty.arith.ops], arithmetic operations - - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires CommonlyInvocableQuantities<std::plus<>, quantity, quantity<R2, Rep2>> - friend constexpr Quantity auto operator+(const Q& lhs, const quantity<R2, Rep2>& rhs); - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires CommonlyInvocableQuantities<std::minus<>, quantity, quantity<R2, Rep2>> - friend constexpr Quantity auto operator-(const Q& lhs, const quantity<R2, Rep2>& rhs); - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires(!treat_as_floating_point<Rep>) && (!treat_as_floating_point<Rep2>) && - CommonlyInvocableQuantities<std::modulus<>, quantity, quantity<R2, Rep2>> - friend constexpr Quantity auto operator%(const Q& lhs, const quantity<R2, Rep2>& rhs); - - template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::plus<>, Rep, const Value&> - friend constexpr Quantity auto operator+(const Q& lhs, const Value& rhs); - template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::minus<>, Rep, const Value&> - friend constexpr Quantity auto operator-(const Q& lhs, const Value& rhs); - template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::modulus<>, Rep, const Value&> - friend constexpr Quantity auto operator%(const Q& lhs, const Value& rhs); - - template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::plus<>, Rep, const Value&> - friend constexpr Quantity auto operator+(const Value& lhs, const Q& rhs); - template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::minus<>, Rep, const Value&> - friend constexpr Quantity auto operator-(const Value& lhs, const Q& rhs); - template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::modulus<>, Rep, const Value&> - friend constexpr Quantity auto operator%(const Value& lhs, const Q& rhs); - - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires InvocableQuantities<std::multiplies<>, quantity, quantity<R2, Rep2>> - friend constexpr Quantity auto operator*(const Q& lhs, const quantity<R2, Rep2>& rhs); - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires InvocableQuantities<std::divides<>, quantity, quantity<R2, Rep2>> - friend constexpr Quantity auto operator/(const Q& lhs, const quantity<R2, Rep2>& rhs); - - template<std::derived_from<quantity> Q, typename Value> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::multiplies<>, Rep, const Value&> - friend constexpr QuantityOf<quantity_spec> auto operator*(const Q& lhs, const Value& rhs); - template<std::derived_from<quantity> Q, typename Value> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::divides<>, Rep, const Value&> - friend constexpr QuantityOf<quantity_spec> auto operator/(const Q& lhs, const Value& rhs); - - template<typename Value, std::derived_from<quantity> Q> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::multiplies<>, const Value&, Rep> - friend constexpr QuantityOf<quantity_spec> auto operator*(const Value& lhs, const Q& rhs); - template<typename Value, std::derived_from<quantity> Q> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::divides<>, const Value&, Rep> - friend constexpr Quantity auto operator/(const Value&, const Q&); - - // [qty.cmp], comparison - - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires see below - friend constexpr bool operator==(const Q& lhs, const quantity<R2, Rep2>& rhs); - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires see below - friend constexpr auto operator<=>(const Q& lhs, const quantity<R2, Rep2>& rhs); - - template<std::derived_from<quantity> Q, Representation Value> - requires see below - friend constexpr bool operator==(const Q& lhs, const Value& rhs); - template<std::derived_from<quantity> Q, Representation Value> - requires see below - friend constexpr auto operator<=>(const Q& lhs, const Value& rhs); - - // [qty.val.cmp], value comparison - friend constexpr bool is_eq_zero(const quantity& q) requires see below; - friend constexpr bool is_neq_zero(const quantity& q) requires see below; - friend constexpr bool is_lt_zero(const quantity& q) requires see below; - friend constexpr bool is_gt_zero(const quantity& q) requires see below; - friend constexpr bool is_lteq_zero(const quantity& q) requires see below; - friend constexpr bool is_gteq_zero(const quantity& q) requires see below; -}; - -template<Representation Value, Reference R> -quantity(Value, R) -> quantity<R{}, Value>; - -template<Representation Value> -quantity(Value) -> quantity<one, Value>; - -template<QuantityLike Q> -explicit(quantity_like_traits<Q>::explicit_import) quantity(Q) - -> quantity<quantity_like_traits<Q>::reference, typename quantity_like_traits<Q>::rep>; - -} -
quantity<R, Rep> is a structural type (N4971, [temp.param]) -if Rep is a structural type.

5.6.4 Static member functions [qty.static]

static constexpr quantity zero() noexcept - requires see below; -static constexpr quantity one() noexcept - requires see below; -static constexpr quantity min() noexcept - requires see below; -static constexpr quantity max() noexcept - requires see below; -
Let F be one of zero, one, min, and max.
Returns: {representation_values<rep>​::​F(), R}.
Remarks: The expression in the requires-clause is equivalent to: -requires { representation_values<rep>::F(); } -

5.6.5 Constructors and assignment [qty.cons]

template<typename FwdValue, Reference R2> - requires SameValueAs<R2{}, R, std::remove_cvref_t<FwdValue>, Rep> -constexpr quantity(FwdValue&& v, R2); - -template<ValuePreservingTo<Rep> FwdValue> - requires(unit == ::mp_units::one) -constexpr quantity(FwdValue&& v); -
Effects: Initializes numerical-value with std​::​forward<FwdValue>(v).
template<typename FwdValue, Reference R2, typename Value = std::remove_cvref_t<FwdValue>> - requires(!SameValueAs<R2{}, R, Value, Rep>) && - QuantityConvertibleTo<quantity<R2{}, Value>, quantity> -constexpr quantity(FwdValue&& v, R2); -
Effects: Equivalent to -quantity(quantity<R2{}, Value>{std​::​forward<FwdValue>(v), R2{}}).
template<QuantityConvertibleTo<quantity> Q> -constexpr explicit(!std::convertible_to<typename Q::rep, Rep>) quantity(const Q& q); -
Effects: Equivalent to sudo-cast<quantity>(q) ([qty.non.mem.conv]).
template<QuantityLike Q> - requires QuantityConvertibleTo<quantity-like-type<Q>, quantity> -constexpr explicit(see below) quantity(const Q& q); -
Effects: Equivalent to: -quantity(::mp_units::quantity{quantity_like_traits<Q>::to_numerical_value(q), - quantity_like_traits<Q>::reference}) -
Remarks: The expression inside explicit is equivalent to: -quantity_like_traits<Q>::explicit_import || - !std::convertible_to<typename quantity_like_traits<Q>::rep, Rep> -
template<ValuePreservingTo<Rep> FwdValue> - requires(unit == ::mp_units::one) -constexpr quantity& operator=(FwdValue&& v); -
Effects: Equivalent to numerical-value = std​::​forward<FwdValue>(v).
Returns: *this.

5.6.6 Conversions [qty.conv]

template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires QuantityConvertibleTo<quantity, quantity<make-reference(quantity_spec, ToU{}), Rep>> -constexpr QuantityOf<quantity_spec> auto in(ToU) const; -
Effects: Equivalent to: -return quantity<make-reference(quantity_spec, ToU{}), Rep>{*this};
template<RepresentationOf<quantity_spec> ToRep> - requires QuantityConvertibleTo<quantity, quantity<reference, ToRep>> -constexpr QuantityOf<quantity_spec> auto in() const; -
Effects: Equivalent to: -return quantity<reference, ToRep>{*this};
template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires QuantityConvertibleTo<quantity, - quantity<make-reference(quantity_spec, ToU{}), ToRep>> -constexpr QuantityOf<quantity_spec> auto in(ToU) const; -
Effects: Equivalent to: -return quantity<make-reference(quantity_spec, ToU{}), ToRep>{*this}; -
template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires requires(const quantity q) { value_cast<ToU{}>(q); } -constexpr QuantityOf<quantity_spec> auto force_in(ToU) const; -
Effects: Equivalent to: -return value_cast<ToU{}>(*this);
template<RepresentationOf<quantity_spec> ToRep> - requires requires(const quantity q) { value_cast<ToRep>(q); } -constexpr QuantityOf<quantity_spec> auto force_in() const; -
Effects: Equivalent to: -return value_cast<ToRep>(*this);
template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires requires(const quantity q) { value_cast<ToU{}, ToRep>(q); } -constexpr QuantityOf<quantity_spec> auto force_in(ToU) const; -
Effects: Equivalent to: -return value_cast<ToU{}, ToRep>(*this);

5.6.7 Numerical value observers [qty.obs]

template<Unit U> - requires(equivalent(U{}, unit)) -constexpr rep& numerical_value_ref_in(U) & noexcept; -template<Unit U> - requires(equivalent(U{}, unit)) -constexpr const rep& numerical_value_ref_in(U) const & noexcept; -
Returns: numerical-value.
template<UnitCompatibleWith<unit, quantity_spec> U> - requires QuantityConvertibleTo<quantity, quantity<make-reference(quantity_spec, U{}), Rep>> -constexpr rep numerical_value_in(U) const noexcept; -
Effects: Equivalent to: -return (*this).in(U{}).numerical-value;
template<UnitCompatibleWith<unit, quantity_spec> U> - requires requires(const quantity q) { value_cast<U{}>(q); } -constexpr rep force_numerical_value_in(U) const noexcept; -
Effects: Equivalent to: -return (*this).force_in(U{}).numerical-value;

5.6.8 Conversion operations [qty.conv.ops]

template<typename V_, std::constructible_from<Rep> Value = std::remove_cvref_t<V_>> - requires(unit == ::mp_units::one) -explicit operator V_() const & noexcept; -
Returns: numerical-value.
template<typename Q_, QuantityLike Q = std::remove_cvref_t<Q_>> - requires QuantityConvertibleTo<quantity, quantity-like-type<Q>> -constexpr explicit(see below) operator Q_() const noexcept(see below); -
Effects: Equivalent to: -return quantity_like_traits<Q>::from_numerical_value( - numerical_value_in(get_unit(quantity_like_traits<Q>::reference))); -
Remarks: The expression inside explicit is equivalent to: -quantity_like_traits<Q>::explicit_export || - !std::convertible_to<Rep, typename quantity_like_traits<Q>::rep> -
-The exception specification is equivalent to: -noexcept(quantity_like_traits<Q>::from_numerical_value(numerical-value)) && - std::is_nothrow_copy_constructible_v<rep> -

5.6.9 Unary operations [qty.unary.ops]

In the following descriptions, -let @ be the operator.
constexpr QuantityOf<quantity_spec> auto operator+() const - requires see below; -constexpr QuantityOf<quantity_spec> auto operator-() const - requires see below; -
Effects: Equivalent to: -return ​::​mp_units​::​quantity{@numerical-value, reference};
Remarks: The expression in the requires-clause is equivalent to: -requires(const rep v) { - { @v } -> std::common_with<rep>; -} -
template<Mutable<quantity> Q> -friend constexpr decltype(auto) operator++(Q&& q) - requires see below; -template<Mutable<quantity> Q> -friend constexpr decltype(auto) operator--(Q&& q) - requires see below; -
Effects: Equivalent to -@q.numerical-value.
Returns: std​::​forward<Q>(q).
Remarks: The expression in the requires-clause is equivalent to: -requires(rep& v) { - { @v } -> std::same_as<rep&>; -} -
constexpr QuantityOf<quantity_spec> auto operator++(int) - requires see below; -constexpr QuantityOf<quantity_spec> auto operator--(int) - requires see below; -
Effects: Equivalent to: -return ​::​mp_units​::​quantity{numerical-value@, reference};
Remarks: The expression in the requires-clause is equivalent to: -requires(rep& v) { - { v@ } -> std::common_with<rep>; -} -

5.6.10 Compound assignment operations [qty.assign.ops]

In the following descriptions, -let @ be the operator.
template<Mutable<quantity> Q, auto R2, typename Rep2> - requires see below -friend constexpr decltype(auto) operator+=(Q&& lhs, const quantity<R2, Rep2>& rhs); -template<Mutable<quantity> Q, auto R2, typename Rep2> - requires see below -friend constexpr decltype(auto) operator-=(Q&& lhs, const quantity<R2, Rep2>& rhs); -template<Mutable<quantity> Q, auto R2, typename Rep2> - requires see below -friend constexpr decltype(auto) operator%=(Q&& lhs, const quantity<R2, Rep2>& rhs); -
Preconditions: If @ is %=, then is_neq_zero(rhs) is true.
Effects: Equivalent to -lhs.numerical-value @ rhs.in(lhs.unit).numerical-value.
Returns: std​::​forward<Q>(lhs).
Remarks: Let C be -
  • (!treat_as_floating_point<rep>) if @ is %=, and
  • true otherwise.
-The expression in the requires-clause is equivalent to: -QuantityConvertibleTo<quantity<R2, Rep2>, quantity> && C && -requires(rep& a, const Rep2 b) { - { a @ b } -> std::same_as<rep&>; -} -
Recommended practice: If equivalent(unit, get_unit(rhs.reference)) is true, -then the expression rhs.in(lhs.unit) is replaced with rhs.
template<Mutable<quantity> Q, ValuePreservingTo<Rep> Value> - requires see below -friend constexpr decltype(auto) operator*=(Q&& lhs, const Value& rhs); -template<Mutable<quantity> Q, ValuePreservingTo<Rep> Value> - requires see below -friend constexpr decltype(auto) operator/=(Q&& lhs, const Value& rhs); -
Preconditions: If @ is /=, then rhs != representation_values<Value>​::​zero() is true.
Effects: Equivalent to -lhs.numerical-value @ rhs.
Returns: std​::​forward<Q>(lhs).
Remarks: The expression in the requires-clause is equivalent to: -(!Quantity<Value>) && requires(rep& a, const Value b) { - { a @ b } -> std::same_as<rep&>; -} -
template<Mutable<quantity> Q, QuantityOf<dimensionless> Q2> - requires see below -friend constexpr decltype(auto) operator*=(Q&& lhs, const Q2& rhs); -template<Mutable<quantity> Q, QuantityOf<dimensionless> Q2> - requires see below -friend constexpr decltype(auto) operator/=(Q&& lhs, const Q2& rhs); -
Effects: Equivalent to: -return std​::​forward<Q>(lhs) @ rhs.numerical-value;
Remarks: The expression in the requires-clause is equivalent to: -(Q2::unit == ::mp_units::one) && ValuePreservingTo<typename Q2::rep, Rep> && -requires(rep& a, const Q2::rep b) { - { a @ b } -> std::same_as<rep&>; -} -

5.6.11 Arithmetic operations [qty.arith.ops]

In the following descriptions, -let @ be the operator.
template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires CommonlyInvocableQuantities<std::plus<>, quantity, quantity<R2, Rep2>> -friend constexpr Quantity auto operator+(const Q& lhs, const quantity<R2, Rep2>& rhs); -template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires CommonlyInvocableQuantities<std::minus<>, quantity, quantity<R2, Rep2>> -friend constexpr Quantity auto operator-(const Q& lhs, const quantity<R2, Rep2>& rhs); -template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires(!treat_as_floating_point<Rep>) && (!treat_as_floating_point<Rep2>) && - CommonlyInvocableQuantities<std::modulus<>, quantity, quantity<R2, Rep2>> -friend constexpr Quantity auto operator%(const Q& lhs, const quantity<R2, Rep2>& rhs); -
Let F be the first argument to CommonlyInvocableQuantities.
Preconditions: If @ is %, then is_neq_zero(rhs) is true.
Effects: Equivalent to: -using ret = common-quantity-for<F, quantity, quantity<R2, Rep2>>; -const ret ret_lhs(lhs); -const ret ret_rhs(rhs); -return ::mp_units::quantity{ - ret_lhs.numerical_value_ref_in(ret::unit) @ ret_rhs.numerical_value_ref_in(ret::unit), - ret::reference}; -
template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::plus<>, Rep, const Value&> -friend constexpr Quantity auto operator+(const Q& lhs, const Value& rhs); -template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::minus<>, Rep, const Value&> -friend constexpr Quantity auto operator-(const Q& lhs, const Value& rhs); -template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::modulus<>, Rep, const Value&> -friend constexpr Quantity auto operator%(const Q& lhs, const Value& rhs); -
Effects: Equivalent to: -return lhs @ ​::​mp_units​::​quantity{rhs};
template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::plus<>, Rep, const Value&> -friend constexpr Quantity auto operator+(const Value& lhs, const Q& rhs); -template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::minus<>, Rep, const Value&> -friend constexpr Quantity auto operator-(const Value& lhs, const Q& rhs); -template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::modulus<>, Rep, const Value&> -friend constexpr Quantity auto operator%(const Value& lhs, const Q& rhs); -
Effects: Equivalent to: -return ​::​mp_units​::​quantity{lhs} @ rhs;
template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires InvocableQuantities<std::multiplies<>, quantity, quantity<R2, Rep2>> -friend constexpr Quantity auto operator*(const Q& lhs, const quantity<R2, Rep2>& rhs); -template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires InvocableQuantities<std::divides<>, quantity, quantity<R2, Rep2>> -friend constexpr Quantity auto operator/(const Q& lhs, const quantity<R2, Rep2>& rhs); -
Preconditions: If @ is /, then is_neq_zero(rhs) is true.
Effects: Equivalent to: -return ::mp_units::quantity{ - lhs.numerical_value_ref_in(unit) @ rhs.numerical_value_ref_in(rhs.unit), R @ R2}; -
template<std::derived_from<quantity> Q, typename Value> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::multiplies<>, Rep, const Value&> -friend constexpr QuantityOf<quantity_spec> auto operator*(const Q& lhs, const Value& rhs); -template<std::derived_from<quantity> Q, typename Value> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::divides<>, Rep, const Value&> -friend constexpr QuantityOf<quantity_spec> auto operator/(const Q& lhs, const Value& rhs); -
Preconditions: If @ is /, then rhs != representation_values<Value>​::​zero() is true.
Effects: Equivalent to: -return ::mp_units::quantity{lhs.numerical_value_ref_in(unit) @ rhs, R}; -
template<typename Value, std::derived_from<quantity> Q> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::multiplies<>, const Value&, Rep> -friend constexpr QuantityOf<quantity_spec> auto operator*(const Value& lhs, const Q& rhs); -template<typename Value, std::derived_from<quantity> Q> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::divides<>, const Value&, Rep> -friend constexpr Quantity auto operator/(const Value& lhs, const Q& rhs); -
Preconditions: If @ is /, then is_neq_zero(rhs) is true.
Effects: Equivalent to: -return ::mp_units::quantity{lhs @ rhs.numerical_value_ref_in(unit), ::mp_units::one @ R}; -

5.6.12 Comparison [qty.cmp]

In the following descriptions, -let @ be the operator.
template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires see below -friend constexpr bool operator==(const Q& lhs, const quantity<R2, Rep2>& rhs); -template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires see below -friend constexpr auto operator<=>(const Q& lhs, const quantity<R2, Rep2>& rhs); -
Let C be -std​::​equality_comparable if @ is ==, and -std​::​three_way_comparable if @ is <=>.
Effects: Equivalent to: -using ct = std::common_type_t<quantity, quantity<R2, Rep2>>; -const ct ct_lhs(lhs); -const ct ct_rhs(rhs); -return ct_lhs.numerical_value_ref_in(ct::unit) @ ct_rhs.numerical_value_ref_in(ct::unit); -
Remarks: The expression in the requires-clause is equivalent to: -requires { - typename std::common_type_t<quantity, quantity<R2, Rep2>>; -} && C<typename std::common_type_t<quantity, quantity<R2, Rep2>>::rep> -
template<std::derived_from<quantity> Q, Representation Value> - requires see below -friend constexpr bool operator==(const Q& lhs, const Value& rhs); -template<std::derived_from<quantity> Q, Representation Value> - requires see below -friend constexpr auto operator<=>(const Q& lhs, const Value& rhs); -
Let C be -std​::​equality_comparable_with if @ is ==, and -std​::​three_way_comparable_with if @ is <=>.
Returns: lhs.numerical_value_ref_in(unit) @ rhs.
Remarks: The expression in the requires-clause is equivalent to: -(Q::unit == ::mp_units::one) && C<Rep, Value> -

5.6.13 Value comparison [qty.val.cmp]

friend constexpr bool is_eq_zero(const quantity& q) requires see below; -friend constexpr bool is_neq_zero(const quantity& q) requires see below; -friend constexpr bool is_lt_zero(const quantity& q) requires see below; -friend constexpr bool is_gt_zero(const quantity& q) requires see below; -friend constexpr bool is_lteq_zero(const quantity& q) requires see below; -friend constexpr bool is_gteq_zero(const quantity& q) requires see below; -
Let is_F_zero be the function name.
Returns:
Remarks: Let C be -std​::​equality_comparable_with if F is eq or neq, and -std​::​three_way_comparable_with otherwise.
The expression in the requires-clause is equivalent to: -requires { - { T::zero() } -> C<quantity>; -} -

5.6.14 Construction helper delta [qty.delta]

namespace mp_units { - -template<Reference R> -struct delta_ { - template<typename FwdRep, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> - constexpr quantity<R{}, Rep> operator()(FwdRep&& lhs) const; -}; - -} -
template<typename FwdRep, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> -constexpr quantity<R{}, Rep> operator()(FwdRep&& lhs) const; -
Effects: Equivalent to: -return quantity{std​::​forward<FwdRep>(lhs), R{}};

5.6.15 Non-member conversions [qty.non.mem.conv]

template<Quantity To, typename FwdFrom, Quantity From = std::remove_cvref_t<FwdFrom>> - requires see below -constexpr To sudo-cast(FwdFrom&& q); // exposition only -
Returns: TBD.
value_cast is an explicit cast that allows truncation.
template<Unit auto ToU, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>> - requires(convertible(Q::reference, ToU)) -constexpr Quantity auto value_cast(FwdQ&& q); -
Effects: Equivalent to: -return sudo-cast<quantity<make-reference(Q::quantity_spec, ToU), typename Q::rep>>( - std::forward<FwdQ>(q)); -
template<Representation ToRep, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>> - requires RepresentationOf<ToRep, Q::quantity_spec> && - std::constructible_from<ToRep, typename Q::rep> -constexpr quantity<Q::reference, ToRep> value_cast(FwdQ&& q); -
Effects: Equivalent to: -return sudo-cast<quantity<Q::reference, ToRep>>(std::forward<FwdQ>(q)); -
template<Unit auto ToU, Representation ToRep, typename FwdQ, - Quantity Q = std::remove_cvref_t<FwdQ>> - requires see below -constexpr Quantity auto value_cast(FwdQ&& q); -template<Representation ToRep, Unit auto ToU, typename FwdQ, - Quantity Q = std::remove_cvref_t<FwdQ>> - requires see below -constexpr Quantity auto value_cast(FwdQ&& q); -
Effects: Equivalent to: -return sudo-cast<quantity<make-reference(Q::quantity_spec, ToU), ToRep>>( - std::forward<FwdQ>(q)); -
Remarks: The expression in the requires-clause is equivalent to: -(convertible(Q::reference, ToU)) && RepresentationOf<ToRep, Q::quantity_spec> && -std::constructible_from<ToRep, typename Q::rep> -
template<Quantity ToQ, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>> - requires(convertible(Q::reference, ToQ::unit)) && (ToQ::quantity_spec == Q::quantity_spec) && - std::constructible_from<typename ToQ::rep, typename Q::rep> -constexpr Quantity auto value_cast(FwdQ&& q); -
Effects: Equivalent to: return sudo-cast<ToQ>(std​::​forward<FwdQ>(q));
quantity_cast is an explicit cast that allows converting to more specific quantities.
[Example 1: auto length = isq::length(42 * m); -auto distance = quantity_cast<isq::distance>(length); - — end example]
template<QuantitySpec auto ToQS, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>> - requires QuantitySpecCastableTo<Q::quantity_spec, ToQS> -constexpr Quantity auto quantity_cast(FwdQ&& q); -
Effects: Equivalent to: -return quantity{std::forward<FwdQ>(q).numerical-value, make-reference(ToQS, Q::unit)}; -

5.6.16 std​::​common_type specializations [qty.common.type]

template<mp_units::Quantity Q1, mp_units::Quantity Q2> - requires requires { - { mp_units::get_common_reference(Q1::reference, Q2::reference) } -> mp_units::Reference; - typename std::common_type_t<typename Q1::rep, typename Q2::rep>; - requires mp_units::RepresentationOf<std::common_type_t<typename Q1::rep, typename Q2::rep>, - mp_units::get_common_quantity_spec(Q1::quantity_spec, - Q2::quantity_spec)>; - } -struct std::common_type<Q1, Q2> { - using type = mp_units::quantity<mp_units::get_common_reference(Q1::reference, Q2::reference), - std::common_type_t<typename Q1::rep, typename Q2::rep>>; -}; - -template<mp_units::Quantity Q, mp_units::Representation Value> - requires(Q::unit == mp_units::one) && requires { - typename mp_units::quantity<Q::reference, std::common_type_t<typename Q::rep, Value>>; - } -struct std::common_type<Q, Value> { - using type = mp_units::quantity<Q::reference, std::common_type_t<typename Q::rep, Value>>; -}; -

5.7 Quantity point [qty.pt]

5.7.1 General [qty.pt.general]

Subclause [qty.pt] describes the class template quantity_point -that represents the value of a quantity (IEC 60050, 112-01-28) -that is an element of an affine space (IEC 60050, 102-03-02,102-04-01).

5.7.2 Point origin [qty.pt.orig]

5.7.2.1 General [qty.pt.orig.general]

This subclause specifies the components -for defining the origin of an affine space.
An origin is a point from which measurements (IEC 60050, 112-04-01) take place.

5.7.2.2 Concepts [qty.pt.orig.concepts]

template<typename T> -concept PointOrigin = SymbolicConstant<T> && std::derived_from<T, point-origin-interface>; - -template<typename T, auto QS> -concept PointOriginFor = PointOrigin<T> && QuantitySpecOf<decltype(QS), T::quantity-spec>; - -template<typename T, auto V> -concept SameAbsolutePointOriginAs = // exposition only - PointOrigin<T> && PointOrigin<decltype(V)> && same-absolute-point-origins(T{}, V); -

5.7.2.3 Types [qty.pt.orig.types]

5.7.2.3.1 Absolute [qty.abs.pt.orig]

namespace mp_units { - -template<QuantitySpec auto QS> -struct absolute_point_origin : point-origin-interface { - static constexpr QuantitySpec auto quantity-spec = QS; // exposition only -}; - -} -
An absolute origin is an origin -chosen by convention and not defined in terms of another origin.
A specialization of absolute_point_origin is used as a base type when defining an absolute origin.
QS is the quantity the origin represents.

5.7.2.3.2 Relative [qty.rel.pt.orig]

namespace mp_units { - -template<QuantityPoint auto QP> -struct relative_point_origin : point-origin-interface { - static constexpr QuantityPoint auto quantity-point = QP; // exposition only - static constexpr QuantitySpec auto quantity-spec = see below; // exposition only - static constexpr PointOrigin auto absolute-point-origin = // exposition only - QP.absolute_point_origin; -}; - -} -
A relative origin is an origin -of a subspace (IEC 60050, 102-03-03).
A specialization of relative_point_origin is used as a base type when defining a relative origin O.
O is offset from QP.absolute_point_origin by QP.quantity_from_zero().
The member quantity-spec is equal to -QP.point_origin.quantity-spec if -QuantityKindSpec<decltype(auto(QP.quantity-spec))> - -is satisfied, and -to QP.quantity-spec otherwise.

5.7.2.3.3 Zeroth [qty.zeroth.pt.orig]

namespace mp_units { - -template<QuantitySpec auto QS> -struct zeroth_point_origin_ final : absolute_point_origin<QS> {}; - -} -
zeroth_point_origin_<QS> represents an origin -chosen by convention as the value 0 of the quantity QS.

5.7.2.4 Operations [qty.pt.orig.ops]

namespace mp_units { - -struct point-origin-interface { - template<PointOrigin PO, typename FwdQ, - QuantityOf<PO::quantity-spec> Q = std::remove_cvref_t<FwdQ>> - friend constexpr quantity_point<Q::reference, PO{}, typename Q::rep> operator+(PO, FwdQ&& q); - template<Quantity FwdQ, PointOrigin PO, - QuantityOf<PO::quantity-spec> Q = std::remove_cvref_t<FwdQ>> - friend constexpr quantity_point<Q::reference, PO{}, typename Q::rep> operator+(FwdQ&& q, PO); - - template<PointOrigin PO, Quantity Q> - requires ReferenceOf<decltype(auto(Q::reference)), PO::quantity-spec> - friend constexpr QuantityPoint auto operator-(PO po, const Q& q) - requires requires { -q; }; - - template<PointOrigin PO1, SameAbsolutePointOriginAs<PO1{}> PO2> - requires see below - friend constexpr Quantity auto operator-(PO1 po1, PO2 po2); - - template<PointOrigin PO1, PointOrigin PO2> - friend consteval bool operator==(PO1 po1, PO2 po2); -}; - -} -
template<PointOrigin PO, typename FwdQ, - QuantityOf<PO::quantity-spec> Q = std::remove_cvref_t<FwdQ>> -friend constexpr quantity_point<Q::reference, PO{}, typename Q::rep> operator+(PO, FwdQ&& q); -template<Quantity FwdQ, PointOrigin PO, - QuantityOf<PO::quantity-spec> Q = std::remove_cvref_t<FwdQ>> -friend constexpr quantity_point<Q::reference, PO{}, typename Q::rep> operator+(FwdQ&& q, PO); -
Effects: Equivalent to: -return quantity_point{std​::​forward<FwdQ>(q), PO{}};
template<PointOrigin PO, Quantity Q> - requires ReferenceOf<decltype(auto(Q::reference)), PO::quantity-spec> -friend constexpr QuantityPoint auto operator-(PO po, const Q& q) - requires requires { -q; }; -
Effects: Equivalent to: -return po + -q;
template<PointOrigin PO1, SameAbsolutePointOriginAs<PO1{}> PO2> - requires see below -friend constexpr Quantity auto operator-(PO1 po1, PO2 po2); -
Effects: Equivalent to: -if constexpr (is-derived-from-specialization-of<PO1, absolute_point_origin>()) { - return po1 - po2.quantity-point; -} else if constexpr (is-derived-from-specialization-of<PO2, absolute_point_origin>()) { - return po1.quantity-point - po2; -} else { - return po1.quantity-point - po2.quantity-point; -} -
Remarks: The expression in the requires-clause is equivalent to: -QuantitySpecOf<decltype(auto(PO1::quantity-spec)), PO2::quantity-spec> && - (is-derived-from-specialization-of<PO1, relative_point_origin>() || - is-derived-from-specialization-of<PO2, relative_point_origin>()) -
template<PointOrigin PO1, PointOrigin PO2> -friend consteval bool operator==(PO1 po1, PO2 po2); -
Effects: Equivalent to: -if constexpr (is-derived-from-specialization-of<PO1, absolute_point_origin>() && - is-derived-from-specialization-of<PO2, absolute_point_origin>()) - return std::is_same_v<PO1, PO2> || - (is-specialization-of<PO1, zeroth_point_origin>() && - is-specialization-of<PO2, zeroth_point_origin>() && - interconvertible(po1.quantity-spec, po2.quantity-spec)); -else if constexpr (is-derived-from-specialization-of<PO1, relative_point_origin>() && - is-derived-from-specialization-of<PO2, relative_point_origin>()) - return PO1::quantity-point == PO2::quantity-point; -else if constexpr (is-derived-from-specialization-of<PO1, relative_point_origin>()) - return same-absolute-point-origins(po1, po2) && - is_eq_zero(PO1::quantity-point.quantity_from_zero()); -else if constexpr (is-derived-from-specialization-of<PO2, relative_point_origin>()) - return same-absolute-point-origins(po1, po2) && - is_eq_zero(PO2::quantity-point.quantity_from_zero()); -

5.7.2.5 Utilities [qty.pt.orig.utils]

5.7.2.5.1 Same absolute [qty.same.abs.pt.origs]

template<PointOrigin PO1, PointOrigin PO2> -consteval bool same-absolute-point-origins(PO1 po1, PO2 po2); // exposition only -
Effects: Equivalent to: -if constexpr (is-derived-from-specialization-of<PO1, absolute_point_origin>() && - is-derived-from-specialization-of<PO2, absolute_point_origin>()) - return po1 == po2; -else if constexpr (is-derived-from-specialization-of<PO1, relative_point_origin>() && - is-derived-from-specialization-of<PO2, relative_point_origin>()) - return po1.absolute-point-origin == po2.absolute-point-origin; -else if constexpr (is-derived-from-specialization-of<PO1, relative_point_origin>()) - return po1.absolute-point-origin == po2; -else if constexpr (is-derived-from-specialization-of<PO2, relative_point_origin>()) - return po1 == po2.absolute-point-origin; -else - return false; -

5.7.2.5.2 Default [qty.def.pt.orig]

template<Reference R> -consteval PointOriginFor<get_quantity_spec(R{})> auto default_point_origin(R); -
Effects: Equivalent to: -if constexpr (requires { get_unit(R{}).point-origin; }) - return get_unit(R{}).point-origin; -else - return zeroth_point_origin<get_quantity_spec(R{})>; -

5.7.3 Interoperability [qty.pt.like]

template<typename T> -concept QuantityPointLike = - !QuantityPoint<T> && - qty-like-impl<T, quantity_point_like_traits> && // see [qty.like] - requires { - typename quantity_point<quantity_point_like_traits<T>::reference, - quantity_point_like_traits<T>::point_origin, - typename quantity_point_like_traits<T>::rep>; - }; -

5.7.4 Class template quantity_point [qty.pt.syn]

namespace mp_units { - -template<typename T> -concept QuantityPoint = (is-derived-from-specialization-of<T, quantity_point>()); - -template<typename QP, auto V> -concept QuantityPointOf = - QuantityPoint<QP> && (QuantitySpecOf<decltype(auto(QP::quantity_spec)), V> || - SameAbsolutePointOriginAs<decltype(auto(QP::absolute_point_origin)), V>); - -template<Reference auto R, - PointOriginFor<get_quantity_spec(R)> auto PO = default_point_origin(R), - RepresentationOf<get_quantity_spec(R)> Rep = double> -class quantity_point { -public: - // member types and values - static constexpr Reference auto reference = R; - static constexpr QuantitySpec auto quantity_spec = get_quantity_spec(reference); - static constexpr Dimension auto dimension = quantity_spec.dimension; - static constexpr Unit auto unit = get_unit(reference); - static constexpr PointOrigin auto absolute_point_origin = see below; - static constexpr PointOrigin auto point_origin = PO; - using rep = Rep; - using quantity_type = quantity<reference, Rep>; - - quantity_type quantity-from-origin; // exposition only - - // [qty.pt.static], static member functions - static constexpr quantity_point min() noexcept - requires see below; - static constexpr quantity_point max() noexcept - requires see below; - - // [qty.pt.cons], constructors and assignment - - quantity_point() = default; - quantity_point(const quantity_point&) = default; - quantity_point(quantity_point&&) = default; - ~quantity_point() = default; - - template<typename FwdQ, QuantityOf<quantity_spec> Q = std::remove_cvref_t<FwdQ>> - requires std::constructible_from<quantity_type, FwdQ> && - (point_origin == default_point_origin(R)) && - (implicitly_convertible(Q::quantity_spec, quantity_spec)) - constexpr explicit quantity_point(FwdQ&& q); - - template<typename FwdQ, QuantityOf<quantity_spec> Q = std::remove_cvref_t<FwdQ>> - requires std::constructible_from<quantity_type, FwdQ> - constexpr quantity_point(FwdQ&& q, decltype(PO)); - - template<typename FwdQ, PointOrigin PO2, - QuantityOf<PO2::quantity-spec> Q = std::remove_cvref_t<FwdQ>> - requires std::constructible_from<quantity_type, FwdQ> && SameAbsolutePointOriginAs<PO2, PO> - constexpr quantity_point(FwdQ&& q, PO2); - - template<QuantityPointOf<absolute_point_origin> QP> - requires std::constructible_from<quantity_type, typename QP::quantity_type> - constexpr explicit(!std::convertible_to<typename QP::quantity_type, quantity_type>) - quantity_point(const QP& qp); - - template<QuantityPointLike QP> - requires see below - constexpr explicit(see below) quantity_point(const QP& qp); - - quantity_point& operator=(const quantity_point&) = default; - quantity_point& operator=(quantity_point&&) = default; - - // [qty.pt.conv], conversions - - template<SameAbsolutePointOriginAs<absolute_point_origin> NewPO> - constexpr QuantityPointOf<(NewPO{})> auto point_for(NewPO new_origin) const; - - template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below - constexpr QuantityPointOf<quantity_spec> auto in(ToU) const; - - template<RepresentationOf<quantity_spec> ToRep> - requires see below - constexpr QuantityPointOf<quantity_spec> auto in() const; - - template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below - constexpr QuantityPointOf<quantity_spec> auto in(ToU) const; - - template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below - constexpr QuantityPointOf<quantity_spec> auto force_in(ToU) const; - - template<RepresentationOf<quantity_spec> ToRep> - requires see below - constexpr QuantityPointOf<quantity_spec> auto force_in() const; - - template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below - constexpr QuantityPointOf<quantity_spec> auto force_in(ToU) const; - - // [qty.pt.obs], quantity value observers - - template<PointOrigin PO2> - requires(PO2{} == point_origin) - constexpr quantity_type& quantity_ref_from(PO2) & noexcept; - template<PointOrigin PO2> - requires(PO2{} == point_origin) - constexpr const quantity_type& quantity_ref_from(PO2) const & noexcept; - template<PointOrigin PO2> - requires(PO2{} == point_origin) - void quantity_ref_from(PO2) const && = delete; - - template<PointOrigin PO2> - requires requires(const quantity_point qp) { qp - PO2{}; } - constexpr Quantity auto quantity_from(PO2) const; - - template<QuantityPointOf<absolute_point_origin> QP> - constexpr Quantity auto quantity_from(const QP&) const; - - constexpr Quantity auto quantity_from_zero() const; - - // [qty.pt.conv.ops], conversion operations - template<typename QP_, QuantityPointLike QP = std::remove_cvref_t<QP_>> - requires see below - constexpr explicit(see below) operator QP_() const & noexcept(see below); - template<typename QP_, QuantityPointLike QP = std::remove_cvref_t<QP_>> - requires see below - constexpr explicit(see below) operator QP_() && noexcept(see below); - - // [qty.pt.unary.ops], unary operations - - template<Mutable<quantity_point> QP> - friend constexpr decltype(auto) operator++(QP&& qp) - requires see below; - template<Mutable<quantity_point> QP> - friend constexpr decltype(auto) operator--(QP&& qp) - requires see below; - - constexpr quantity_point operator++(int) - requires see below; - constexpr quantity_point operator--(int) - requires see below; - - // [qty.pt.assign.ops], compound assignment operations - template<Mutable<quantity_point> QP, auto R2, typename Rep2> - requires see below - friend constexpr decltype(auto) operator+=(QP&& qp, const quantity<R2, Rep2>& q); - template<Mutable<quantity_point> QP, auto R2, typename Rep2> - requires see below - friend constexpr decltype(auto) operator-=(QP&& qp, const quantity<R2, Rep2>& q); - - // [qty.pt.arith.ops], arithmetic operations - - template<std::derived_from<quantity_point> QP, auto R2, typename Rep2> - friend constexpr QuantityPoint auto operator+(const QP& qp, const quantity<R2, Rep2>& q) - requires see below; - template<std::derived_from<quantity_point> QP, auto R2, typename Rep2> - friend constexpr QuantityPoint auto operator+(const quantity<R2, Rep2>& q, const QP& qp) - requires see below; - template<std::derived_from<quantity_point> QP, auto R2, typename Rep2> - friend constexpr QuantityPoint auto operator-(const QP& qp, const quantity<R2, Rep2>& q) - requires see below; - - template<std::derived_from<quantity_point> QP, QuantityPointOf<absolute_point_origin> QP2> - friend constexpr Quantity auto operator-(const QP& lhs, const QP2& rhs) - requires see below; - - template<std::derived_from<quantity_point> QP, PointOrigin PO2> - requires see below - friend constexpr Quantity auto operator-(const QP& qp, PO2 po); - template<std::derived_from<quantity_point> QP, PointOrigin PO2> - requires see below - friend constexpr Quantity auto operator-(PO2 po, const QP& qp); - - // [qty.pt.cmp], comparison - template<std::derived_from<quantity_point> QP, QuantityPointOf<absolute_point_origin> QP2> - requires see below - friend constexpr bool operator==(const QP& lhs, const QP2& rhs); - template<std::derived_from<quantity_point> QP, QuantityPointOf<absolute_point_origin> QP2> - requires see below - friend constexpr auto operator<=>(const QP& lhs, const QP2& rhs); -}; - -template<Quantity Q> -explicit quantity_point(Q q) - -> quantity_point<Q::reference, default_point_origin(Q::reference), typename Q::rep>; - -template<Quantity Q, PointOriginFor<Q::quantity_spec> PO> -quantity_point(Q, PO) -> quantity_point<Q::reference, PO{}, typename Q::rep>; - -template<QuantityPointLike QP, typename Traits = quantity_point_like_traits<QP>> -explicit(quantity_point_like_traits<QP>::explicit_import) quantity_point(QP) - -> quantity_point<Traits::reference, Traits::point_origin, typename Traits::rep>; - -} -
quantity_point<R, PO, Rep> is a structural type (N4971, [temp.param]) -if Rep is a structural type.
The member absolute_point_origin is equal to PO if -is-derived-from-specialization-of<decltype(PO), absolute_point_origin>() - -is true, and -to PO.quantity-point.absolute_point_origin otherwise.

5.7.5 Static member functions [qty.pt.static]

static constexpr quantity_point min() noexcept - requires see below; -static constexpr quantity_point max() noexcept - requires see below; -
Let F be one of min and max.
Returns: {quantity_type​::​F(), PO}.
Remarks: The expression in the requires-clause is equivalent to: -requires { quantity_type::F(); } -

5.7.6 Constructors [qty.pt.cons]

template<typename FwdQ, QuantityOf<quantity_spec> Q = std::remove_cvref_t<FwdQ>> - requires std::constructible_from<quantity_type, FwdQ> && - (point_origin == default_point_origin(R)) && - (implicitly_convertible(Q::quantity_spec, quantity_spec)) -constexpr explicit quantity_point(FwdQ&& q); - -template<typename FwdQ, QuantityOf<quantity_spec> Q = std::remove_cvref_t<FwdQ>> - requires std::constructible_from<quantity_type, FwdQ> -constexpr quantity_point(FwdQ&& q, decltype(PO)); -
Effects: Initializes quantity-from-origin with std​::​forward<FwdQ>(q).
template<typename FwdQ, PointOrigin PO2, - QuantityOf<PO2::quantity-spec> Q = std::remove_cvref_t<FwdQ>> - requires std::constructible_from<quantity_type, FwdQ> && SameAbsolutePointOriginAs<PO2, PO> -constexpr quantity_point(FwdQ&& q, PO2); -
Effects: Equivalent to: -quantity_point(quantity_point<Q::reference, PO2{}, typename Q::rep>{std::forward<FwdQ>(q), - PO2{}}) -
template<QuantityPointOf<absolute_point_origin> QP> - requires std::constructible_from<quantity_type, typename QP::quantity_type> -constexpr explicit(!std::convertible_to<typename QP::quantity_type, quantity_type>) - quantity_point(const QP& qp); -
Effects: If point_origin == QP​::​point_origin is true, -initializes quantity-from-origin with qp.quantity_ref_from(point_origin).
Otherwise, initializes quantity-from-origin with qp - point_origin.
template<QuantityPointLike QP> - requires see below -constexpr explicit(see below) quantity_point(const QP& qp); -
Let Traits be quantity_point_like_traits<QP>.
Effects: Initializes quantity-from-origin with -Traits::to_numerical_value(qp), get_unit(Traits::reference) -
Remarks: The expression in the requires-clause is equivalent to: -(Traits::point_origin == point_origin) && - std::convertible_to<quantity<Traits::reference, typename Traits::rep>, quantity_type> -
-The expression inside explicit is equivalent to: -Traits::explicit_import || - !std::convertible_to<quantity<Traits::reference, typename Traits::rep>, quantity_type> -

5.7.7 Conversions [qty.pt.conv]

template<SameAbsolutePointOriginAs<absolute_point_origin> NewPO> -constexpr QuantityPointOf<(NewPO{})> auto point_for(NewPO new_origin) const; -
Effects: Equivalent to: -if constexpr (std::is_same_v<NewPO, decltype(point_origin)>) - return *this; -else - return ::mp_units::quantity_point{*this - new_origin, new_origin}; -
template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below -constexpr QuantityPointOf<quantity_spec> auto in(ToU) const; - -template<RepresentationOf<quantity_spec> ToRep> - requires see below -constexpr QuantityPointOf<quantity_spec> auto in() const; - -template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below -constexpr QuantityPointOf<quantity_spec> auto in(ToU) const; - -template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below -constexpr QuantityPointOf<quantity_spec> auto force_in(ToU) const; - -template<RepresentationOf<quantity_spec> ToRep> - requires see below -constexpr QuantityPointOf<quantity_spec> auto force_in() const; - -template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below -constexpr QuantityPointOf<quantity_spec> auto force_in(ToU) const; -
Let converted-quantity-expr be an expression denoting -the function call to the corresponding member of quantity_ref_from(point_origin).
Effects: Equivalent to: -return ::mp_units::quantity_point{converted-quantity-expr, point_origin}; -
Remarks: The expression in the requires-clause is equivalent to: -requires { converted-quantity-expr; } -

5.7.8 Quantity value observers [qty.pt.obs]

template<PointOrigin PO2> - requires(PO2{} == point_origin) -constexpr quantity_type& quantity_ref_from(PO2) & noexcept; -template<PointOrigin PO2> - requires(PO2{} == point_origin) -constexpr const quantity_type& quantity_ref_from(PO2) const & noexcept; -
Returns: quantity-from-origin.
template<PointOrigin PO2> - requires requires(const quantity_point qp) { qp - PO2{}; } -constexpr Quantity auto quantity_from(PO2 rhs) const; - -template<QuantityPointOf<absolute_point_origin> QP> -constexpr Quantity auto quantity_from(const QP& rhs) const; -
Effects: Equivalent to: -return *this - rhs;
constexpr Quantity auto quantity_from_zero() const; -
Effects: Equivalent to: -if constexpr (requires { unit.point-origin; }) { - // can lose the input unit - const auto q = quantity_from(unit.point-origin); - if constexpr (requires { q.in(unit); }) - // restore the unit - return q.in(unit); - else - return q; -} else - return quantity_from(absolute_point_origin); -

5.7.9 Conversion operations [qty.pt.conv.ops]

template<typename QP_, QuantityPointLike QP = std::remove_cvref_t<QP_>> - requires see below -constexpr explicit(see below) operator QP_() const & noexcept(see below); -template<typename QP_, QuantityPointLike QP = std::remove_cvref_t<QP_>> - requires see below -constexpr explicit(see below) operator QP_() && noexcept(see below); -
Let Traits be quantity_point_like_traits<QP>.
Let result-expr be -Traits::from_numerical_value(std::move(quantity-from-origin).numerical-value) -
Returns: result-expr.
Remarks: The expression in the requires-clause is equivalent to: -(point_origin == Traits::point_origin) && - std::convertible_to<quantity_type, quantity<Traits::reference, typename Traits::rep>> -
-The expression inside explicit is equivalent to: -Traits::explicit_export || - !std::convertible_to<quantity_type, quantity<Traits::reference, typename Traits::rep>> -
-Let T be -std​::​is_nothrow_copy_constructible_v for the first signature, and -std​::​is_nothrow_move_constructible_v for the second signature.
The exception specification is equivalent to: -noexcept(result-expr) && T<rep> -

5.7.10 Unary operations [qty.pt.unary.ops]

In the following descriptions, -let @ be the operator.
template<Mutable<quantity_point> QP> -friend constexpr decltype(auto) operator++(QP&& qp) - requires see below; -template<Mutable<quantity_point> QP> -friend constexpr decltype(auto) operator--(QP&& qp) - requires see below; -
Effects: Equivalent to -@qp.quantity-from-origin.
Returns: std​::​forward<QP>(qp).
Remarks: The expression in the requires-clause is equivalent to: -requires { @qp.quantity-from-origin; } -
constexpr quantity_point operator++(int) - requires see below; -constexpr quantity_point operator--(int) - requires see below; -
Effects: Equivalent to: -return {quantity-from-origin@, PO};
Remarks: The expression in the requires-clause is equivalent to: -requires { quantity-from-origin@; } -

5.7.11 Compound assignment operations [qty.pt.assign.ops]

template<Mutable<quantity_point> QP, auto R2, typename Rep2> - requires see below -friend constexpr decltype(auto) operator+=(QP&& qp, const quantity<R2, Rep2>& q); -template<Mutable<quantity_point> QP, auto R2, typename Rep2> - requires see below -friend constexpr decltype(auto) operator-=(QP&& qp, const quantity<R2, Rep2>& q); -
Let @ be the operator.
Effects: Equivalent to -qp.quantity-from-origin @ q.
Returns: std​::​forward<QP>(qp).
Remarks: The expression in the requires-clause is equivalent to: -QuantityConvertibleTo<quantity<R2, Rep2>, quantity_type> && - requires { qp.quantity-from-origin @ q; } -

5.7.12 Arithmetic operations [qty.pt.arith.ops]

In the following descriptions, -let @ be the operator.
template<std::derived_from<quantity_point> QP, auto R2, typename Rep2> -friend constexpr QuantityPoint auto operator+(const QP& qp, const quantity<R2, Rep2>& q) - requires see below; -template<std::derived_from<quantity_point> QP, auto R2, typename Rep2> -friend constexpr QuantityPoint auto operator+(const quantity<R2, Rep2>& q, const QP& qp) - requires see below; -template<std::derived_from<quantity_point> QP, auto R2, typename Rep2> -friend constexpr QuantityPoint auto operator-(const QP& qp, const quantity<R2, Rep2>& q) - requires see below; -
Effects: Equivalent to: -if constexpr (is-specialization-of<PO, zeroth_point_origin>()) - return ::mp_units::quantity_point{qp.quantity_ref_from(PO) @ q}; -else - return ::mp_units::quantity_point{qp.quantity_ref_from(PO) @ q, PO}; -
Remarks: The expression in the requires-clause is equivalent to: -ReferenceOf<decltype(R2), PO.quantity-spec> && requires { - qp.quantity_ref_from(PO) @ q; -} -
template<std::derived_from<quantity_point> QP, QuantityPointOf<absolute_point_origin> QP2> -friend constexpr Quantity auto operator-(const QP& lhs, const QP2& rhs) - requires see below; -
Effects: Equivalent to: -return lhs.quantity_ref_from(point_origin) - rhs.quantity_ref_from(QP2::point_origin) + - (lhs.point_origin - rhs.point_origin); -
Remarks: The expression in the requires-clause is equivalent to: -requires { lhs.quantity_ref_from(point_origin) - rhs.quantity_ref_from(QP2::point_origin); } -
Recommended practice: The subtraction of two equal origins is not evaluated.
template<std::derived_from<quantity_point> QP, PointOrigin PO2> - requires see below -friend constexpr Quantity auto operator-(const QP& qp, PO2 po); -template<std::derived_from<quantity_point> QP, PointOrigin PO2> - requires see below -friend constexpr Quantity auto operator-(PO2 po, const QP& qp); -
Effects: For the first signature, -equivalent to: -if constexpr (point_origin == po) - return qp.quantity_ref_from(point_origin); -else if constexpr (is-derived-from-specialization-of<PO2, - ::mp_units::absolute_point_origin>()) { - return qp.quantity_ref_from(point_origin) + (qp.point_origin - qp.absolute_point_origin); -} else { - return qp.quantity_ref_from(point_origin) - - po.quantity-point.quantity_ref_from(po.quantity-point.point_origin) + - (qp.point_origin - po.quantity-point.point_origin); -} -
-For the second signature, -equivalent to: return -(qp - po);
Remarks: The expression in the requires-clause is equivalent to: -QuantityPointOf<quantity_point, PO2{}> && - ReferenceOf<decltype(auto(reference)), PO2::quantity-spec> -
Recommended practice: The subtraction of two equal origins is not evaluated.

5.7.13 Comparison [qty.pt.cmp]

template<std::derived_from<quantity_point> QP, QuantityPointOf<absolute_point_origin> QP2> - requires see below -friend constexpr bool operator==(const QP& lhs, const QP2& rhs); -template<std::derived_from<quantity_point> QP, QuantityPointOf<absolute_point_origin> QP2> - requires see below -friend constexpr auto operator<=>(const QP& lhs, const QP2& rhs); -
Let @ be the operator, and -let C be -std​::​equality_comparable_with if @ is ==, and -std​::​three_way_comparable_with if @ is <=>.
Effects: Equivalent to: -return lhs - lhs.absolute_point_origin @ rhs - rhs.absolute_point_origin; -
Remarks: The expression in the requires-clause is equivalent to: -C<quantity_type, typename QP2::quantity_type> -
Recommended practice: If the origins are equal, instead evaluate -lhs.quantity_ref_from(point_origin) @ rhs.quantity_ref_from(QP2::point_origin) -

5.7.14 Construction helper point [qty.point]

namespace mp_units { - -template<Reference R> -struct point_ { - template<typename FwdRep, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> - constexpr quantity_point<R{}, default_point_origin(R{}), Rep> operator()(FwdRep&& lhs) const; -}; - -} -
template<typename FwdRep, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> -constexpr quantity_point<R{}, default_point_origin(R{}), Rep> operator()(FwdRep&& lhs) const; -
Effects: Equivalent to: -return quantity_point{quantity{std​::​forward<FwdRep>(lhs), R{}}};

5.7.15 Non-member conversions [qty.pt.non.mem.conv]

template<QuantityPoint ToQP, typename FwdFromQP, - QuantityPoint FromQP = std::remove_cvref_t<FwdFromQP>> - requires see below -constexpr QuantityPoint auto sudo-cast(FwdFromQP&& qp); -
Returns: TBD.
value_cast is an explicit cast that allows truncation.
template<Unit auto ToU, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires(convertible(QP::reference, ToU)) -constexpr QuantityPoint auto value_cast(FwdQP&& qp); -
Effects: Equivalent to: -return quantity_point{value_cast<ToU>(std::forward<FwdQP>(qp).quantity-from-origin), - QP::point_origin}; -
template<Representation ToRep, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires RepresentationOf<ToRep, QP::quantity_spec> && - std::constructible_from<ToRep, typename QP::rep> -constexpr quantity_point<QP::reference, QP::point_origin, ToRep> value_cast(FwdQP&& qp); -
Effects: Equivalent to: -return {value_cast<ToRep>(std::forward<FwdQP>(qp).quantity-from-origin), QP::point_origin}; -
template<Unit auto ToU, Representation ToRep, typename FwdQP, - QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires see below -constexpr QuantityPoint auto value_cast(FwdQP&& qp); -template<Representation ToRep, Unit auto ToU, typename FwdQP, - QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires see below -constexpr QuantityPoint auto value_cast(FwdQP&& qp); -
Effects: Equivalent to: -return quantity_point{value_cast<ToU, ToRep>(std::forward<FwdQP>(qp).quantity-from-origin), - QP::point_origin}; -
Remarks: The expression in the requires-clause is equivalent to: -(convertible(QP::reference, ToU)) && RepresentationOf<ToRep, QP::quantity_spec> && -std::constructible_from<ToRep, typename QP::rep> -
template<Quantity ToQ, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires(convertible(QP::reference, ToQ::unit)) && (ToQ::quantity_spec == QP::quantity_spec) && - std::constructible_from<typename ToQ::rep, typename QP::rep> -constexpr QuantityPoint auto value_cast(FwdQP&& qp); -
Effects: Equivalent to: -return quantity_point{value_cast<ToQ>(std::forward<FwdQP>(qp).quantity-from-origin), - QP::point_origin}; -
template<QuantityPoint ToQP, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires(convertible(QP::reference, ToQP::unit)) && - (ToQP::quantity_spec == QP::quantity_spec) && - (same-absolute-point-origins(ToQP::point_origin, QP::point_origin)) && - std::constructible_from<typename ToQP::rep, typename QP::rep> -constexpr QuantityPoint auto value_cast(FwdQP&& qp); -
Effects: Equivalent to: -return sudo-cast<ToQP>(std​::​forward<FwdQP>(qp));
quantity_cast is an explicit cast that allows converting to more specific quantities.
template<QuantitySpec auto ToQS, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires QuantitySpecCastableTo<QP::quantity_spec, ToQS> -constexpr QuantityPoint auto quantity_cast(FwdQP&& qp); -
Effects: Equivalent to: -return QP{quantity_cast<ToQS>(std::forward<FwdQP>(qp).quantity_from_origin), - QP::point_origin}; -

5.9 std​::​chrono interoperability [qty.chrono]

namespace mp_units { - -template<typename Period> -consteval auto time-unit-from-chrono-period() -{ - using namespace si; - - if constexpr (is_same_v<Period, std::chrono::nanoseconds::period>) - return nano<second>; - else if constexpr (is_same_v<Period, std::chrono::microseconds::period>) - return micro<second>; - else if constexpr (is_same_v<Period, std::chrono::milliseconds::period>) - return milli<second>; - else if constexpr (is_same_v<Period, std::chrono::seconds::period>) - return second; - else if constexpr (is_same_v<Period, std::chrono::minutes::period>) - return minute; - else if constexpr (is_same_v<Period, std::chrono::hours::period>) - return hour; - else if constexpr (is_same_v<Period, std::chrono::days::period>) - return day; - else if constexpr (is_same_v<Period, std::chrono::weeks::period>) - return mag<7> * day; - else - return mag_ratio<Period::num, Period::den> * second; -} - -template<typename Rep, typename Period> -struct quantity_like_traits<std::chrono::duration<Rep, Period>> { - static constexpr auto reference = time-unit-from-chrono-period<Period>(); - static constexpr bool explicit_import = false; - static constexpr bool explicit_export = false; - using rep = Rep; - using T = std::chrono::duration<Rep, Period>; - - static constexpr rep to_numerical_value(const T& q) noexcept( - std::is_nothrow_copy_constructible_v<rep>) - { - return q.count(); - } - - static constexpr T from_numerical_value(const rep& v) noexcept( - std::is_nothrow_copy_constructible_v<rep>) - { - return T(v); - } -}; - -template<typename Clock> -struct chrono_point_origin_ final : absolute_point_origin<isq::time> { - using clock = Clock; -}; - -template<typename Clock, typename Rep, typename Period> -struct quantity_point_like_traits< - std::chrono::time_point<Clock, std::chrono::duration<Rep, Period>>> { - static constexpr auto reference = time-unit-from-chrono-period<Period>(); - static constexpr auto point_origin = chrono_point_origin<Clock>; - static constexpr bool explicit_import = false; - static constexpr bool explicit_export = false; - using rep = Rep; - using T = std::chrono::time_point<Clock, std::chrono::duration<Rep, Period>>; - - static constexpr rep to_numerical_value(const T& tp) noexcept( - std::is_nothrow_copy_constructible_v<rep>) - { - return tp.time_since_epoch().count(); - } - - static constexpr T from_numerical_value(const rep& v) noexcept( - std::is_nothrow_copy_constructible_v<rep>) - { - return T(std::chrono::duration<Rep, Period>(v)); - } -}; - -} -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/fulltoc.html b/HEAD/api_reference/gen/fulltoc.html deleted file mode 100644 index bef72524..00000000 --- a/HEAD/api_reference/gen/fulltoc.html +++ /dev/null @@ -1,14 +0,0 @@ -Draft C++ Standard: Contents

mp-units Library Reference Documentations

(Generated on 2025-04-03 from the LaTeX sources by cxxdraft-htmlgen. This is not an ISO publication.)

Note: this is an early draft. It's known to be incomplet and incorrekt, and it has lots of bad formatting.

Contents

1 Scope [scope]

2 References [refs]

3 Terms and definitions [defs]

4 Specification [spec]

4.1 External [spec.ext]

4.2 Categories [spec.cats]

4.4 Library-wide requirements [spec.reqs]

4.4.1 Reserved names [spec.res.names]

5 Quantities and units library [quantities]

5.2 mp-units module synopses [mp.units.syns]

5.2.1 Module mp_units synopsis [mp.units.syn]

5.2.2 Module mp_units.core synopsis [mp.units.core.syn]

5.2.3 Module mp_units.systems synopsis [mp.units.systems.syn]

5.4 Reference [qty.ref]

5.4.6 Class template reference [qty.ref.syn]

5.4.7 Operations [qty.ref.ops]

5.4.8 Comparison [qty.ref.cmp]

5.5 Representation [qty.rep]

5.5.3 Customization point objects [qty.rep.cpos]

5.5.3.2 mp_units​::​real [qty.real.cpo]

5.5.3.3 mp_units​::​imag [qty.imag.cpo]

5.5.3.4 mp_units​::​modulus [qty.modulus.cpo]

5.5.3.5 mp_units​::​magnitude [qty.mag.cpo]

5.6 Quantity [qty]

5.6.2 Interoperability [qty.like]

5.6.3 Class template quantity [qty.syn]

5.6.4 Static member functions [qty.static]

5.6.5 Constructors and assignment [qty.cons]

5.6.6 Conversions [qty.conv]

5.6.7 Numerical value observers [qty.obs]

5.6.8 Conversion operations [qty.conv.ops]

5.6.9 Unary operations [qty.unary.ops]

5.6.10 Compound assignment operations [qty.assign.ops]

5.6.11 Arithmetic operations [qty.arith.ops]

5.6.12 Comparison [qty.cmp]

5.6.13 Value comparison [qty.val.cmp]

5.6.14 Construction helper delta [qty.delta]

5.6.15 Non-member conversions [qty.non.mem.conv]

5.6.16 std​::​common_type specializations [qty.common.type]

5.7 Quantity point [qty.pt]

5.7.3 Interoperability [qty.pt.like]

5.7.4 Class template quantity_point [qty.pt.syn]

5.7.5 Static member functions [qty.pt.static]

5.7.6 Constructors [qty.pt.cons]

5.7.7 Conversions [qty.pt.conv]

5.7.8 Quantity value observers [qty.pt.obs]

5.7.9 Conversion operations [qty.pt.conv.ops]

5.7.10 Unary operations [qty.pt.unary.ops]

5.7.11 Compound assignment operations [qty.pt.assign.ops]

5.7.12 Arithmetic operations [qty.pt.arith.ops]

5.7.13 Comparison [qty.pt.cmp]

5.7.14 Construction helper point [qty.point]

5.7.15 Non-member conversions [qty.pt.non.mem.conv]

5.9 std​::​chrono interoperability [qty.chrono]

Index

Index of library modules

Index of library names

Index of library concepts

Index of implementation-defined behavior

\ No newline at end of file diff --git a/HEAD/api_reference/gen/generalindex.html b/HEAD/api_reference/gen/generalindex.html deleted file mode 100644 index 1eea99a3..00000000 --- a/HEAD/api_reference/gen/generalindex.html +++ /dev/null @@ -1 +0,0 @@ -14882: Index

Index


A D

M N O Q R S U


A

absolute origin, see origin, absolute

D

definitions, [defs]

M

module
mp-units, [spec.mods]
mp-units library, [scope]

N

named quantity, see quantity, named
named unit, see unit, named

O

Q

quantity

R

references, [refs]
relative origin, see origin, relative

S

scope, [scope]

U

unit
\ No newline at end of file diff --git a/HEAD/api_reference/gen/get.common.qty.spec.html b/HEAD/api_reference/gen/get.common.qty.spec.html deleted file mode 100644 index a4f718ab..00000000 --- a/HEAD/api_reference/gen/get.common.qty.spec.html +++ /dev/null @@ -1,45 +0,0 @@ -[get.common.qty.spec]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.3 Quantity specification [qty.spec]

5.4.3.6 Hierarchy algorithms [qty.spec.hier.algos]

5.4.3.6.3 Get common quantity specification [get.common.qty.spec]

consteval QuantitySpec auto get_common_quantity_spec(QuantitySpec auto... qs) - requires see below; -
Let -
  • q1 be qs...[0],
  • q2 be qs...[1],
  • Q1 be decltype(q1),
  • Q2 be decltype(q2), and
  • rest be a pack denoting the elements of qs without q1 and q2.
Effects: Equivalent to: -if constexpr (sizeof...(qs) == 1) - return q1; -else if constexpr (sizeof...(qs) == 2) { - using QQ1 = decltype(remove-kind(q1)); - using QQ2 = decltype(remove-kind(q2)); - - if constexpr (std::is_same_v<Q1, Q2>) - return q1; - else if constexpr (NestedQuantityKindSpecOf<Q1{}, Q2{}>) - return QQ1{}; - else if constexpr (NestedQuantityKindSpecOf<Q2{}, Q1{}>) - return QQ2{}; - else if constexpr ((QuantityKindSpec<Q1> && !QuantityKindSpec<Q2>) || - (DerivedQuantitySpec<QQ1> && NamedQuantitySpec<QQ2> && - implicitly_convertible(Q1{}, Q2{}))) - return q2; - else if constexpr ((!QuantityKindSpec<Q1> && QuantityKindSpec<Q2>) || - (NamedQuantitySpec<QQ1> && DerivedQuantitySpec<QQ2> && - implicitly_convertible(Q2{}, Q1{}))) - return q1; - else if constexpr (constexpr auto common_base = get-common-base<Q1{}, Q2{}>()) - return *common_base; - else if constexpr (implicitly_convertible(Q1{}, Q2{})) - return q2; - else if constexpr (implicitly_convertible(Q2{}, Q1{})) - return q1; - else if constexpr (implicitly_convertible(get-kind-tree-root(Q1{}), - get-kind-tree-root(Q2{}))) - return get-kind-tree-root(q2); - else - return get-kind-tree-root(q1); -} else - return get_common_quantity_spec(get_common_quantity_spec(q1, q2), rest...); -
Remarks: The expression in the requires-clause is equivalent to: -(sizeof...(qs) != 0 && - (sizeof...(qs) == 1 || - (sizeof...(qs) == 2 && - (QuantitySpecConvertibleTo<get-kind-tree-root(Q1{}), get-kind-tree-root(Q2{})> || - QuantitySpecConvertibleTo<get-kind-tree-root(Q2{}), get-kind-tree-root(Q1{})>)) || - requires { get_common_quantity_spec(get_common_quantity_spec(q1, q2), rest...); })) -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/icon.png b/HEAD/api_reference/gen/icon.png deleted file mode 100644 index 3acaef02536a9ff1d816c3971c3fd2a580bab333..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 132 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4mJh`2Kmqb6B!s7Sc;uILpV4%IBGajIv5xj zI14-?iy0XBd>I({<}lv-HYc2cfkDmF#WBR9H#tFqHH7{D!WkKrYF@c1E=DtTD!XDE i_+H4fEpFgqV3-rb#gO7ZuZn?zfx*+&&t;ucLK6Tl(jbBW diff --git a/HEAD/api_reference/gen/impldefindex.html b/HEAD/api_reference/gen/impldefindex.html deleted file mode 100644 index 19032070..00000000 --- a/HEAD/api_reference/gen/impldefindex.html +++ /dev/null @@ -1 +0,0 @@ -14882: Index of implementation-defined behavior

Index of implementation-defined behavior

behavior of unit-magnitude operations that do not fit in a std​::​intmax_t, [qty.unit.mag.types]
\ No newline at end of file diff --git a/HEAD/api_reference/gen/index.html b/HEAD/api_reference/gen/index.html deleted file mode 100644 index 90a236d6..00000000 --- a/HEAD/api_reference/gen/index.html +++ /dev/null @@ -1,15 +0,0 @@ -Draft C++ Standard: Contents

mp-units Library Reference Documentations

(Generated on 2025-04-03 from the LaTeX sources by cxxdraft-htmlgen. This is not an ISO publication.)

Note: this is an early draft. It's known to be incomplet and incorrekt, and it has lots of bad formatting.

Contents

2 References [refs][refs]

3 Terms and definitions [defs][defs]

4 Specification [spec][spec]

4.1 External [spec.ext]

4.2 Categories [spec.cats]

4.4 Library-wide requirements [spec.reqs]

4.4.1 Reserved names [spec.res.names]

5 Quantities and units library [quantities][quantities]

5.2 mp-units module synopses [mp.units.syns]

5.2.1 Module mp_units synopsis [mp.units.syn]

5.2.2 Module mp_units.core synopsis [mp.units.core.syn]

5.2.3 Module mp_units.systems synopsis [mp.units.systems.syn]

5.4 Reference [qty.ref]

5.4.6 Class template reference [qty.ref.syn]

5.4.7 Operations [qty.ref.ops]

5.4.8 Comparison [qty.ref.cmp]

5.5 Representation [qty.rep]

5.5.3 Customization point objects [qty.rep.cpos]

5.5.3.2 mp_units​::​real [qty.real.cpo]

5.5.3.3 mp_units​::​imag [qty.imag.cpo]

5.5.3.4 mp_units​::​modulus [qty.modulus.cpo]

5.5.3.5 mp_units​::​magnitude [qty.mag.cpo]

5.6 Quantity [qty]

5.6.2 Interoperability [qty.like]

5.6.3 Class template quantity [qty.syn]

5.6.4 Static member functions [qty.static]

5.6.5 Constructors and assignment [qty.cons]

5.6.6 Conversions [qty.conv]

5.6.7 Numerical value observers [qty.obs]

5.6.8 Conversion operations [qty.conv.ops]

5.6.9 Unary operations [qty.unary.ops]

5.6.10 Compound assignment operations [qty.assign.ops]

5.6.11 Arithmetic operations [qty.arith.ops]

5.6.12 Comparison [qty.cmp]

5.6.13 Value comparison [qty.val.cmp]

5.6.14 Construction helper delta [qty.delta]

5.6.15 Non-member conversions [qty.non.mem.conv]

5.6.16 std​::​common_type specializations [qty.common.type]

5.7 Quantity point [qty.pt]

5.7.3 Interoperability [qty.pt.like]

5.7.4 Class template quantity_point [qty.pt.syn]

5.7.5 Static member functions [qty.pt.static]

5.7.6 Constructors [qty.pt.cons]

5.7.7 Conversions [qty.pt.conv]

5.7.8 Quantity value observers [qty.pt.obs]

5.7.9 Conversion operations [qty.pt.conv.ops]

5.7.10 Unary operations [qty.pt.unary.ops]

5.7.11 Compound assignment operations [qty.pt.assign.ops]

5.7.12 Arithmetic operations [qty.pt.arith.ops]

5.7.13 Comparison [qty.pt.cmp]

5.7.14 Construction helper point [qty.point]

5.7.15 Non-member conversions [qty.pt.non.mem.conv]

5.9 std​::​chrono interoperability [qty.chrono]

Index

Index of library modules

Index of library names

Index of library concepts

Index of implementation-defined behavior

\ No newline at end of file diff --git a/HEAD/api_reference/gen/kind.of.qty.html b/HEAD/api_reference/gen/kind.of.qty.html deleted file mode 100644 index 41528983..00000000 --- a/HEAD/api_reference/gen/kind.of.qty.html +++ /dev/null @@ -1,11 +0,0 @@ -[kind.of.qty]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.3 Quantity specification [qty.spec]

5.4.3.3 Types [qty.spec.types]

5.4.3.3.4 Kind of [kind.of.qty]

namespace mp_units { - -template<QuantitySpec Q> - requires(!QuantityKindSpec<Q>) && (get-kind-tree-root(Q{}) == Q{}) -struct kind_of_ final : Q::base-type { - using base-type = kind_of_; // exposition only - static constexpr auto quantity-spec = Q{}; // exposition only -}; - -} -
kind_of<Q> represents a kind of quantity (IEC 60050, 112-01-04) Q.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/libraryindex.html b/HEAD/api_reference/gen/libraryindex.html deleted file mode 100644 index 0276988f..00000000 --- a/HEAD/api_reference/gen/libraryindex.html +++ /dev/null @@ -1 +0,0 @@ -14882: Index of library names

Index of library names


A B

C D E F G H I K M N O P Q R S T U V Z


A

absolute_point_origin, [qty.abs.pt.orig]
AssociatedUnit
convertible, [qty.ref.cmp]
get-associated-quantity, [assoc.qty]
get_common_reference, [qty.ref.obs]
get_quantity_spec, [qty.unit.obs]
get_unit, [qty.unit.obs]
operator*, [qty.ref.syn]
operator/, [qty.ref.syn]
operator==, [qty.ref.cmp]
AssociatedUnit, [qty.unit.concepts]

B

base_dimension, [qty.dim.types]

C

canonical-unit, [qty.canon.unit]
castable
QuantitySpec, [qty.spec.conv]
cbrt
Dimension, [qty.dim.ops]
QuantitySpec, [qty.spec.ops]
reference, [qty.ref.syn]
character_set, [mp.units.core.syn]
chrono_point_origin, [mp.units.systems.syn]
chrono_point_origin_, [qty.chrono]
clone-kind-of
QuantitySpec, [qty.spec.utils]
common-magnitude
UnitMagnitude, [qty.unit.mag.utils]
common-ratio
common_unit, [qty.common.unit]
convertible
AssociatedUnit, [qty.ref.cmp]
reference, [qty.ref.cmp]
cubic

D

default_point_origin
delta_, [qty.delta]
operator(), [qty.delta]
derived_dimension, [qty.dim.types]
derived_quantity_spec, [derived.qty]
derived_unit, [qty.derived.unit]
Dimension
dimension_symbol, [qty.dim.sym.fmt]
dimension_symbol_to, [qty.dim.sym.fmt]
inverse, [qty.dim.ops]
operator*, [qty.dim.ops]
operator/, [qty.dim.ops]
operator==, [qty.dim.ops]
dimension-interface, [qty.dim.ops]
dimension_symbol
dimension_symbol_formatting, [mp.units.core.syn]
dimension_symbol_to
DimensionOf, [qty.dim.concepts]
disable_complex, [qty.char.traits]
disable_scalar, [qty.char.traits]
std​::​complex, [mp.units.core.syn]
disable_vector, [qty.char.traits]

E

empty
symbol_text, [qty.sym.txt]
equivalent
explicitly_convertible
QuantitySpec, [qty.spec.conv]
expr-fractions, [qty.sym.expr.algos]
expr-multiply, [qty.sym.expr.algos]

F

force_in
quantity, [qty.conv]
quantity_point, [qty.pt.conv]
force_numerical_value_in
quantity, [qty.obs]

G

get-associated-quantity
AssociatedUnit, [assoc.qty]
get-canonical-unit
get-common-base
QuantitySpec, [qty.get.common.base]
get-kind-tree-root
QuantitySpec, [qty.get.kind]
get_common_quantity_spec
QuantitySpec, [get.common.qty.spec]
get_common_reference, [qty.ref.obs]
AssociatedUnit, [qty.ref.obs]
reference, [qty.ref.obs]
get_common_unit
get_kind
QuantitySpec, [qty.get.kind]
get_quantity_spec
AssociatedUnit, [qty.unit.obs]
reference, [qty.ref.obs]
get_unit
AssociatedUnit, [qty.unit.obs]
reference, [qty.ref.obs]

H

has-associated-quantity

I

implicitly_convertible
QuantitySpec, [qty.spec.conv]
in
quantity, [qty.conv]
quantity_point, [qty.pt.conv]
interconvertible
QuantitySpec, [qty.spec.conv]
inverse
Dimension, [qty.dim.ops]
QuantitySpec, [qty.spec.ops]
reference, [qty.ref.syn]
is-child-of
QuantitySpec, [qty.is.child.of]
is-derived-from-specialization-of, [qty.utils.non.types]
is-integral
is-positive-integral-power
UnitMagnitude, [qty.unit.mag.utils]
is-specialization-of, [qty.utils.non.types]
is_eq_zero
quantity, [qty.val.cmp]
is_gt_zero
quantity, [qty.val.cmp]
is_gteq_zero
quantity, [qty.val.cmp]
is_lt_zero
quantity, [qty.val.cmp]
is_lteq_zero
quantity, [qty.val.cmp]
is_neq_zero
quantity, [qty.val.cmp]

K

kind_of_, [kind.of.qty]

M

mag_constant, [qty.unit.mag.types]
make-reference
QuantitySpec, [qty.spec.utils]
max
quantity, [qty.static]
quantity_point, [qty.pt.static]
min
quantity, [qty.static]
quantity_point, [qty.pt.static]

N

named_unit, [qty.named.unit]
numerical_value_in
quantity, [qty.obs]
numerical_value_ref_in
quantity, [qty.obs]

O

operator%
quantity, [qty.arith.ops]
operator%=
operator()
delta_, [qty.delta]
point_, [qty.point]
QuantitySpec, [qty.spec.ops]
operator*
AssociatedUnit, [qty.ref.syn]
Dimension, [qty.dim.ops]
QuantitySpec, [qty.spec.ops]
Reference, [qty.ref.ops]
reference, [qty.ref.syn]
Representation, [qty.ref.ops]
operator*=
operator+
point-origin-interface, [qty.pt.orig.ops]
quantity_point, [qty.pt.arith.ops]
symbol_text, [qty.sym.txt]
operator++
quantity, [qty.unary.ops]
quantity_point, [qty.pt.unary.ops]
operator+=
quantity_point, [qty.pt.assign.ops]
operator-
point-origin-interface, [qty.pt.orig.ops]
PointOrigin, [qty.pt.arith.ops]
quantity_point, [qty.pt.arith.ops]
operator--
quantity, [qty.unary.ops]
quantity_point, [qty.pt.unary.ops]
operator-=
quantity_point, [qty.pt.assign.ops]
operator/
AssociatedUnit, [qty.ref.syn]
Dimension, [qty.dim.ops]
QuantitySpec, [qty.spec.ops]
Reference, [qty.ref.ops]
reference, [qty.ref.syn]
operator/=
operator<=>
quantity, [qty.cmp]
quantity_point, [qty.pt.cmp]
symbol_text, [qty.sym.txt]
operator=
quantity, [qty.cons]
operator==
AssociatedUnit, [qty.ref.cmp]
Dimension, [qty.dim.ops]
point-origin-interface, [qty.pt.orig.ops]
quantity, [qty.cmp]
quantity_point, [qty.pt.cmp]
QuantitySpec, [qty.spec.ops]
reference, [qty.ref.cmp]
symbol_text, [qty.sym.txt]
UnitMagnitude, [qty.unit.mag.ops]
operator[]
QuantitySpec, [qty.spec.ops]

P

parts_per_million, [mp.units.core.syn]
point-origin-interface
operator==, [qty.pt.orig.ops]
point_
operator(), [qty.point]
point_for
quantity_point, [qty.pt.conv]
PointOrigin
same-absolute-point-origins, [qty.same.abs.pt.origs]
PointOriginFor, [qty.pt.orig.concepts]
portable
symbol_text, [qty.sym.txt]
pow
Dimension, [qty.dim.ops]
QuantitySpec, [qty.spec.ops]
reference, [qty.ref.syn]
pow
UnitMagnitude, [qty.unit.mag.ops]
PrefixableUnit, [qty.unit.concepts]
prefixed_unit, [qty.prefixed.unit]

Q

Quantity, [qty.syn]
quantity, [qty.syn]
constructor, [qty.cons]
force_in, [qty.conv]
force_numerical_value_in, [qty.obs]
is_eq_zero, [qty.val.cmp]
is_gt_zero, [qty.val.cmp]
is_gteq_zero, [qty.val.cmp]
is_lt_zero, [qty.val.cmp]
is_lteq_zero, [qty.val.cmp]
is_neq_zero, [qty.val.cmp]
numerical_value_in, [qty.obs]
numerical_value_ref_in, [qty.obs]
operator constructible_from<Rep>, [qty.conv.ops]
operator QuantityLike, [qty.conv.ops]
operator%, [qty.arith.ops]
operator%=, [qty.assign.ops]
operator*=, [qty.assign.ops]
operator++, [qty.unary.ops]
operator--, [qty.unary.ops]
operator/=, [qty.assign.ops]
operator<=>, [qty.cmp]
operator=, [qty.cons]
operator==, [qty.cmp]
quantity_cast, [qty.non.mem.conv]
value_cast, [qty.non.mem.conv]
quantity
quantity-spec-interface, [qty.spec.ops]
quantity_cast
quantity_point, [qty.pt.non.mem.conv]
quantity_character, [mp.units.core.syn]
quantity_from
quantity_point, [qty.pt.obs]
quantity_from_zero
quantity_point, [qty.pt.obs]
quantity_like_traits
std​::​chrono​::​duration, [qty.chrono]
quantity_point, [qty.pt.syn]
constructor, [qty.pt.cons]
force_in, [qty.pt.conv]
operator QuantityPointLike, [qty.pt.conv.ops]
operator++, [qty.pt.unary.ops]
operator--, [qty.pt.unary.ops]
operator<=>, [qty.pt.cmp]
operator==, [qty.pt.cmp]
point_for, [qty.pt.conv]
quantity_cast, [qty.pt.non.mem.conv]
quantity_from, [qty.pt.obs]
quantity_from_zero, [qty.pt.obs]
quantity_ref_from, [qty.pt.obs]
quantity_point_like_traits
std​::​chrono​::​time_point, [qty.chrono]
quantity_ref_from
quantity_point, [qty.pt.obs]
quantity_spec, [named.qty]
QuantityLike, [qty.like]
QuantityOf, [qty.syn]
QuantityPoint, [qty.pt.syn]
QuantityPointLike, [qty.pt.like]
QuantityPointOf, [qty.pt.syn]
QuantitySpec
castable, [qty.spec.conv]
clone-kind-of, [qty.spec.utils]
explicitly_convertible, [qty.spec.conv]
get-common-base, [qty.get.common.base]
get-kind-tree-root, [qty.get.kind]
get_common_quantity_spec, [get.common.qty.spec]
get_kind, [qty.get.kind]
implicitly_convertible, [qty.spec.conv]
interconvertible, [qty.spec.conv]
is-child-of, [qty.is.child.of]
make-reference, [qty.spec.utils]
operator(), [qty.spec.ops]
operator*, [qty.spec.ops]
operator/, [qty.spec.ops]
operator==, [qty.spec.ops]
operator[], [qty.spec.ops]
remove-kind, [qty.spec.utils]
QuantitySpec, [qty.spec.concepts]
QuantitySpecOf, [qty.spec.concepts]

R

ratio, [qty.ratio]
common-ratio, [qty.ratio]
constructor, [qty.ratio]
is-integral, [qty.ratio]
operator*, [qty.ratio]
operator+, [qty.ratio]
operator-, [qty.ratio]
operator/, [qty.ratio]
operator<=>, [qty.ratio]
operator==, [qty.ratio]
Reference
default_point_origin, [qty.def.pt.orig]
operator*, [qty.ref.ops]
operator/, [qty.ref.ops]
reference, [qty.ref.syn]
convertible, [qty.ref.cmp]
get_common_reference, [qty.ref.obs]
get_quantity_spec, [qty.ref.obs]
get_unit, [qty.ref.obs]
inverse, [qty.ref.syn]
operator*, [qty.ref.syn]
operator/, [qty.ref.syn]
operator==, [qty.ref.cmp]
relative_point_origin, [qty.rel.pt.orig]
remove-kind
QuantitySpec, [qty.spec.utils]
Representation
operator*, [qty.ref.ops]
Representation, [qty.rep.concepts]
representation_values, [qty.val.traits]
RepresentationOf, [qty.rep.concepts]

S

same-absolute-point-origins
scaled_unit, [qty.scaled.unit]
space_before_unit_symbol, [qty.unit.traits]
sqrt
Dimension, [qty.dim.ops]
QuantitySpec, [qty.spec.ops]
reference, [qty.ref.syn]
square
std​::​common_type
sudo-cast
quantity_point, [qty.pt.non.mem.conv]
symbol_text, [qty.sym.txt]
constructor, [qty.sym.txt]
operator+, [qty.sym.txt]
operator<=>, [qty.sym.txt]
operator==, [qty.sym.txt]
portable, [qty.sym.txt]

T

treat_as_floating_point, [qty.fp.traits]
type-less-impl, [qty.sym.expr.algos]

U

Unit
convertible, [qty.unit.cmp]
equivalent, [qty.unit.cmp]
get-canonical-unit, [qty.canon.unit]
get_common_unit, [qty.unit.obs]
has-associated-quantity, [assoc.qty]
make-reference, [qty.spec.utils]
operator*, [qty.unit.ops]
operator/, [qty.unit.ops]
operator==, [qty.unit.cmp]
unit_symbol, [qty.unit.sym.fmt]
unit_symbol_to, [qty.unit.sym.fmt]
unit-interface, [qty.unit.ops]
unit-magnitude, [qty.unit.mag.types]
unit_symbol
unit_symbol_formatting, [mp.units.core.syn]
unit_symbol_separator, [mp.units.core.syn]
unit_symbol_solidus, [mp.units.core.syn]
unit_symbol_to
UnitMagnitude
common-magnitude, [qty.unit.mag.utils]
is-positive-integral-power, [qty.unit.mag.utils]
operator==, [qty.unit.mag.ops]
utf8
symbol_text, [qty.sym.txt]

V

value_cast
quantity_point, [qty.pt.non.mem.conv]

Z

zero
quantity, [qty.static]
zeroth_point_origin, [mp.units.core.syn]
zeroth_point_origin_, [qty.zeroth.pt.orig]
\ No newline at end of file diff --git a/HEAD/api_reference/gen/moduleindex.html b/HEAD/api_reference/gen/moduleindex.html deleted file mode 100644 index 8af1053a..00000000 --- a/HEAD/api_reference/gen/moduleindex.html +++ /dev/null @@ -1 +0,0 @@ -14882: Index of library modules

Index of library modules

mp_units, [mp.units.syn]
mp_units.core, [mp.units.core.syn]
mp_units.systems, [mp.units.systems.syn]
\ No newline at end of file diff --git a/HEAD/api_reference/gen/mp.units.core.syn.html b/HEAD/api_reference/gen/mp.units.core.syn.html deleted file mode 100644 index ac3b61e7..00000000 --- a/HEAD/api_reference/gen/mp.units.core.syn.html +++ /dev/null @@ -1,628 +0,0 @@ -[mp.units.core.syn]

5 Quantities and units library [quantities]

5.2 mp-units module synopses [mp.units.syns]

5.2.2 Module mp_units.core synopsis [mp.units.core.syn]

// mostly freestanding -export module mp_units.core; - -import std; - -export namespace mp_units { - -// [qty.utils], utilities - -// [qty.sym.txt], symbol text - -enum class character_set : std::int8_t { utf8, portable, default_character_set = utf8 }; - -template<std::size_t N, std::size_t M> -class symbol_text; - -// [qty.sym.expr], symbolic expressions - -// [qty.sym.expr.types], types - -template<typename T, typename... Ts> -struct per; - -template<typename F, int Num, int... Den> - requires see below -struct power; - -// [qty.ref], reference - -// [qty.dim], dimension - -// [qty.dim.concepts], concepts - -template<typename T> -concept Dimension = see below; - -template<typename T, auto D> -concept DimensionOf = see below; - -// [qty.dim.types], types - -template<symbol_text Symbol> -struct base_dimension; - -template<SymbolicConstant... Expr> -struct derived_dimension; - -struct dimension_one; -inline constexpr dimension_one dimension_one{}; - -// [qty.dim.ops], operations - -consteval Dimension auto inverse(Dimension auto d); - -template<std::intmax_t Num, std::intmax_t Den = 1, Dimension D> - requires(Den != 0) -consteval Dimension auto pow(D d); -consteval Dimension auto sqrt(Dimension auto d); -consteval Dimension auto cbrt(Dimension auto d); - -// [qty.dim.sym.fmt], symbol formatting - -struct dimension_symbol_formatting { - character_set char_set = character_set::default_character_set; -}; - -template<typename CharT = char, std::output_iterator<CharT> Out, Dimension D> -constexpr Out dimension_symbol_to(Out out, D d, const dimension_symbol_formatting& fmt = {}); - -template<dimension_symbol_formatting fmt = {}, typename CharT = char, Dimension D> -consteval std::string_view dimension_symbol(D); - -// [qty.spec], quantity specification - -// [qty.spec.concepts], concepts - -template<typename T> -concept QuantitySpec = see below; - -template<typename T, auto QS> -concept QuantitySpecOf = see below; - -// [qty.spec.types], types - -// [named.qty], named - -struct is_kind; -inline constexpr is_kind is_kind{}; - -template<auto...> -struct quantity_spec; // not defined - -template<BaseDimension auto Dim, QSProperty auto... Args> -struct quantity_spec<Dim, Args...>; - -template<DerivedQuantitySpec auto Eq, QSProperty auto... Args> -struct quantity_spec<Eq, Args...>; - -template<NamedQuantitySpec auto QS, QSProperty auto... Args> -struct quantity_spec<QS, Args...>; - -template<NamedQuantitySpec auto QS, DerivedQuantitySpec auto Eq, QSProperty auto... Args> -struct quantity_spec<QS, Eq, Args...>; - -// [derived.qty], derived - -template<SymbolicConstant... Expr> -struct derived_quantity_spec; - -// [dimless.qty], base quantity of dimension one - -struct dimensionless; -inline constexpr dimensionless dimensionless{}; - -// [kind.of.qty], kind of - -template<QuantitySpec Q> - requires see below -struct kind_of_; -template<QuantitySpec auto Q> - requires requires { typename kind_of_<decltype(Q)>; } -inline constexpr kind_of_<decltype(Q)> kind_of{}; - -// [qty.spec.ops], operations - -consteval QuantitySpec auto inverse(QuantitySpec auto q); - -template<std::intmax_t Num, std::intmax_t Den = 1, QuantitySpec Q> - requires(Den != 0) -consteval QuantitySpec auto pow(Q q); -consteval QuantitySpec auto sqrt(QuantitySpec auto q); -consteval QuantitySpec auto cbrt(QuantitySpec auto q); - -// [qty.spec.hier.algos], hierarchy algorithms - -// [qty.spec.conv], conversion - -consteval bool implicitly_convertible(QuantitySpec auto from, QuantitySpec auto to); -consteval bool explicitly_convertible(QuantitySpec auto from, QuantitySpec auto to); -consteval bool castable(QuantitySpec auto from, QuantitySpec auto to); -consteval bool interconvertible(QuantitySpec auto qs1, QuantitySpec auto qs2); - -// [qty.get.kind], get_kind - -template<QuantitySpec Q> -consteval see below get_kind(Q); - -// [get.common.qty.spec], get_common_quantity_spec - -consteval QuantitySpec auto get_common_quantity_spec(QuantitySpec auto... qs) - requires see below; - -// [qty.unit], unit - -// [qty.unit.mag], magnitude - -// [qty.unit.mag.concepts], concepts - -template<typename T> -concept MagConstant = see below; - -template<typename T> -concept UnitMagnitude = see below; - -// [qty.unit.mag.types], types - -template<symbol_text Symbol, long double Value> - requires(Value > 0) -struct mag_constant; - -// [qty.unit.mag.ops], operations - -template<MagArg auto V> -constexpr UnitMagnitude auto mag = see below; - -template<std::intmax_t N, std::intmax_t D> - requires(N > 0) -constexpr UnitMagnitude auto mag_ratio = see below; - -template<MagArg auto Base, int Num, int Den = 1> -constexpr UnitMagnitude auto mag_power = see below; - -// constants - -inline constexpr struct pi final : - mag_constant<{u8"\u03C0" /* U+03c0 GREEK SMALL LETTER PI */, "pi"}, - std::numbers::pi_v<long double>> { -} pi; - -inline constexpr auto \u03C0 /* U+03c0 GREEK SMALL LETTER PI */ = pi; - -// [qty.unit.traits], traits - -template<Unit auto U> -constexpr bool space_before_unit_symbol = true; - -template<> -inline constexpr bool space_before_unit_symbol<one> = false; - -// [qty.unit.concepts], concepts - -template<typename T> -concept Unit = see below; - -template<typename T> -concept PrefixableUnit = see below; - -template<typename T> -concept AssociatedUnit = see below; - -template<typename U, auto QS> -concept UnitOf = see below; - -// [qty.unit.types], types - -// [qty.scaled.unit], scaled - -template<UnitMagnitude auto M, Unit U> - requires see below -struct scaled_unit; - -// [qty.named.unit], named - -template<symbol_text Symbol, auto...> -struct named_unit; // not defined - -template<symbol_text Symbol, QuantityKindSpec auto QS> - requires see below -struct named_unit<Symbol, QS>; - -template<symbol_text Symbol, QuantityKindSpec auto QS, PointOrigin auto PO> - requires see below -struct named_unit<Symbol, QS, PO>; - -template<symbol_text Symbol> - requires see below -struct named_unit<Symbol>; - -template<symbol_text Symbol, Unit auto U> - requires see below -struct named_unit<Symbol, U>; - -template<symbol_text Symbol, Unit auto U, PointOrigin auto PO> - requires see below -struct named_unit<Symbol, U, PO>; - -template<symbol_text Symbol, AssociatedUnit auto U, QuantityKindSpec auto QS> - requires see below -struct named_unit<Symbol, U, QS>; - -template<symbol_text Symbol, AssociatedUnit auto U, QuantityKindSpec auto QS, - PointOrigin auto PO> - requires see below -struct named_unit<Symbol, U, QS, PO>; - -// [qty.prefixed.unit], prefixed - -template<symbol_text Symbol, UnitMagnitude auto M, PrefixableUnit auto U> - requires see below -struct prefixed_unit; - -// [qty.common.unit], common - -template<Unit U1, Unit U2, Unit... Rest> -struct common_unit; - -// [qty.derived.unit], derived - -template<SymbolicConstant... Expr> -struct derived_unit; - -// [qty.unit.one], one - -struct one; -inline constexpr one one{}; - -// named derived units of a quantity of dimension one - -inline constexpr struct percent final : named_unit<"%", mag_ratio<1, 100> * one> { -} percent; - -inline constexpr struct per_mille final : - named_unit<symbol_text{u8"\u2030" /* U+2030 PER MILLE SIGN */, "%o"}, - mag_ratio<1, 1000> * one> { -} per_mille; - -inline constexpr struct parts_per_million final : - named_unit<"ppm", mag_ratio<1, 1'000'000> * one> { -} parts_per_million; - -inline constexpr auto ppm = parts_per_million; - -// [qty.unit.ops], operations - -consteval Unit auto inverse(Unit auto u); - -template<std::intmax_t Num, std::intmax_t Den = 1, Unit U> - requires see below -consteval Unit auto pow(U u); -consteval Unit auto sqrt(Unit auto u); -consteval Unit auto cbrt(Unit auto u); -consteval Unit auto square(Unit auto u); -consteval Unit auto cubic(Unit auto u); - -// [qty.unit.cmp], comparison - -template<Unit From, Unit To> -consteval bool convertible(From from, To to); - -// [qty.unit.obs], observers - -consteval QuantitySpec auto get_quantity_spec(AssociatedUnit auto u); -consteval Unit auto get_unit(AssociatedUnit auto u); - -consteval Unit auto get_common_unit(Unit auto... us) - requires see below; - -// [qty.unit.sym.fmt], symbol formatting - -enum class unit_symbol_solidus : std::int8_t { - one_denominator, - always, - never, - default_denominator = one_denominator -}; - -enum class unit_symbol_separator : std::int8_t { - space, - half_high_dot, - default_separator = space -}; - -struct unit_symbol_formatting { - character_set char_set = character_set::default_character_set; - unit_symbol_solidus solidus = unit_symbol_solidus::default_denominator; - unit_symbol_separator separator = unit_symbol_separator::default_separator; -}; - -template<typename CharT = char, std::output_iterator<CharT> Out, Unit U> -constexpr Out unit_symbol_to(Out out, U u, const unit_symbol_formatting& fmt = {}); - -template<unit_symbol_formatting fmt = {}, typename CharT = char, Unit U> -consteval std::string_view unit_symbol(U); - -// [qty.ref.concepts], concepts - -template<typename T> -concept Reference = see below; - -template<typename T, auto QS> -concept ReferenceOf = see below; - -// [qty.ref.syn], class template reference - -template<QuantitySpec Q, Unit U> -struct reference; - -// [qty.ref.ops], operations - -template<typename FwdRep, Reference R, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> - requires(!OffsetUnit<decltype(get_unit(R{}))>) -constexpr quantity<R{}, Rep> operator*(FwdRep&& lhs, R r); - -template<typename FwdRep, Reference R, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> - requires(!OffsetUnit<decltype(get_unit(R{}))>) -constexpr Quantity auto operator/(FwdRep&& lhs, R); - -template<typename FwdQ, Reference R, Quantity Q = std::remove_cvref_t<FwdQ>> -constexpr Quantity auto operator*(FwdQ&& q, R); - -template<typename FwdQ, Reference R, Quantity Q = std::remove_cvref_t<FwdQ>> -constexpr Quantity auto operator/(FwdQ&& q, R); - -template<Reference R, typename Rep> - requires RepresentationOf<std::remove_cvref_t<Rep>, get_quantity_spec(R{})> -constexpr auto operator*(R, Rep&&) = delete; - -template<Reference R, typename Rep> - requires RepresentationOf<std::remove_cvref_t<Rep>, get_quantity_spec(R{})> -constexpr auto operator/(R, Rep&&) = delete; - -template<Reference R, typename Q> - requires Quantity<std::remove_cvref_t<Q>> -constexpr auto operator*(R, Q&&) = delete; - -template<Reference R, typename Q> - requires Quantity<std::remove_cvref_t<Q>> -constexpr auto operator/(R, Q&&) = delete; - -// [qty.ref.obs], observers - -template<typename Q, typename U> -consteval QuantitySpec auto get_quantity_spec(reference<Q, U>); - -template<typename Q, typename U> -consteval Unit auto get_unit(reference<Q, U>); - -consteval AssociatedUnit auto get_common_reference(AssociatedUnit auto u1, - AssociatedUnit auto u2, - AssociatedUnit auto... rest) - requires see below; - -template<Reference R1, Reference R2, Reference... Rest> -consteval Reference auto get_common_reference(R1 r1, R2 r2, Rest... rest) - requires see below; - -// [qty.rep], representation - -enum class quantity_character { scalar, complex, vector, tensor }; - -// [qty.rep.traits], traits - -// [qty.fp.traits], floating-point - -template<typename Rep> -constexpr bool treat_as_floating_point = see below; - -// [qty.char.traits], quantity character - -template<typename T> -constexpr bool disable_scalar = false; -template<> -inline constexpr bool disable_scalar<bool> = true; -template<typename T> -constexpr bool disable_scalar<std::complex<T>> = true; - -template<typename T> -constexpr bool disable_complex = false; - -template<typename T> -constexpr bool disable_vector = false; - -// [qty.val.traits], values - -template<typename Rep> -struct representation_values; - -// [qty.rep.cpos], customization point objects - -inline namespace unspecified { - -inline constexpr unspecified real = unspecified; -inline constexpr unspecified imag = unspecified; -inline constexpr unspecified modulus = unspecified; - -inline constexpr unspecified magnitude = unspecified; - -} - -// [qty.rep.concepts], concepts - -template<typename T> -concept Representation = see below; - -template<typename T, quantity_character Ch> -concept RepresentationOf = see below; - -// [qty], quantity - -// [qty.like], interoperability - -template<typename T> -struct quantity_like_traits; // not defined - -template<typename T> -concept QuantityLike = see below; - -// [qty.syn], class template quantity - -template<typename T> -concept Quantity = see below; - -template<typename Q, auto QS> -concept QuantityOf = see below; - -template<Reference auto R, RepresentationOf<get_quantity_spec(R)> Rep = double> -class quantity; - -// [qty.delta], construction helper delta - -template<Reference R> -struct delta_; - -template<Reference auto R> -constexpr delta_<decltype(R)> delta{}; - -// [qty.non.mem.conv], non-member conversions - -template<Unit auto ToU, see below> - requires see below -constexpr Quantity auto value_cast(see below q); - -template<Representation ToRep, see below> - requires see below -constexpr quantity<see below, ToRep> value_cast(see below q); - -template<Unit auto ToU, Representation ToRep, see below> - requires see below -constexpr Quantity auto value_cast(see below q); -template<Representation ToRep, Unit auto ToU, see below> - requires see below -constexpr Quantity auto value_cast(see below q); - -template<Quantity ToQ, see below> - requires see below -constexpr Quantity auto value_cast(see below q); - -template<QuantitySpec auto ToQS, see below> - requires see below -constexpr Quantity auto quantity_cast(see below q); - -} - -// [qty.common.type], std​::​common_type specializations - -template<mp_units::Quantity Q1, mp_units::Quantity Q2> - requires see below -struct std::common_type<Q1, Q2>; - -template<mp_units::Quantity Q, mp_units::Representation Value> - requires see below -struct std::common_type<Q, Value>; - -template<mp_units::Quantity Q, mp_units::Representation Value> - requires requires { typename std::common_type<Q, Value>; } -struct std::common_type<Value, Q> : std::common_type<Q, Value> {}; - -namespace mp_units { - -// [qty.pt], quantity point - -// [qty.pt.orig], point origin - -// [qty.pt.orig.concepts], concepts - -template<typename T> -concept PointOrigin = see below; - -template<typename T, auto QS> -concept PointOriginFor = see below; - -// [qty.pt.orig.types], types - -// [qty.abs.pt.orig], absolute - -template<QuantitySpec auto QS> -struct absolute_point_origin; - -// [qty.rel.pt.orig], relative - -template<QuantityPoint auto QP> -struct relative_point_origin; - -// [qty.zeroth.pt.orig], zeroth - -template<QuantitySpec auto QS> -struct zeroth_point_origin_; - -template<QuantitySpec auto QS> -constexpr zeroth_point_origin_<QS> zeroth_point_origin{}; - -// [qty.def.pt.orig], default - -template<Reference R> -consteval PointOriginFor<get_quantity_spec(R{})> auto default_point_origin(R); - -// [qty.pt.like], interoperability - -template<typename T> -struct quantity_point_like_traits; // not defined - -template<typename T> -concept QuantityPointLike = see below; - -// [qty.pt.syn], class template quantity_point - -template<typename T> -concept QuantityPoint = see below; - -template<typename QP, auto V> -concept QuantityPointOf = see below; - -template<Reference auto R, - PointOriginFor<get_quantity_spec(R)> auto PO = default_point_origin(R), - RepresentationOf<get_quantity_spec(R)> Rep = double> -class quantity_point; - -// [qty.point], construction helper point - -template<Reference R> -struct point_; - -template<Reference auto R> -constexpr point_<decltype(R)> point{}; - -// [qty.pt.non.mem.conv], non-member conversions - -template<Unit auto ToU, see below> - requires see below -constexpr QuantityPoint auto value_cast(see below qp); - -template<Representation ToRep, see below> - requires see below -constexpr quantity_point<see below, see below, ToRep> value_cast(see below qp); - -template<Unit auto ToU, Representation ToRep, see below> - requires see below -constexpr QuantityPoint auto value_cast(see below qp); -template<Representation ToRep, Unit auto ToU, see below> - requires see below -constexpr QuantityPoint auto value_cast(see below qp); - -template<Quantity ToQ, see below> - requires see below -constexpr QuantityPoint auto value_cast(see below qp); - -template<QuantityPoint ToQP, see below> - requires see below -constexpr QuantityPoint auto value_cast(see below qp); - -template<QuantitySpec auto ToQS, see below> - requires see below -constexpr QuantityPoint auto quantity_cast(see below qp); - -} -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/mp.units.syn.html b/HEAD/api_reference/gen/mp.units.syn.html deleted file mode 100644 index 6946d4c5..00000000 --- a/HEAD/api_reference/gen/mp.units.syn.html +++ /dev/null @@ -1,5 +0,0 @@ -[mp.units.syn]

5 Quantities and units library [quantities]

5.2 mp-units module synopses [mp.units.syns]

5.2.1 Module mp_units synopsis [mp.units.syn]

export module mp_units; - -export import mp_units.core; -export import mp_units.systems; -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/mp.units.syns.html b/HEAD/api_reference/gen/mp.units.syns.html deleted file mode 100644 index 0d5a6fd3..00000000 --- a/HEAD/api_reference/gen/mp.units.syns.html +++ /dev/null @@ -1,654 +0,0 @@ -[mp.units.syns]

5 Quantities and units library [quantities]

5.2 mp-units module synopses [mp.units.syns]

5.2.1 Module mp_units synopsis [mp.units.syn]

export module mp_units; - -export import mp_units.core; -export import mp_units.systems; -

5.2.2 Module mp_units.core synopsis [mp.units.core.syn]

// mostly freestanding -export module mp_units.core; - -import std; - -export namespace mp_units { - -// [qty.utils], utilities - -// [qty.sym.txt], symbol text - -enum class character_set : std::int8_t { utf8, portable, default_character_set = utf8 }; - -template<std::size_t N, std::size_t M> -class symbol_text; - -// [qty.sym.expr], symbolic expressions - -// [qty.sym.expr.types], types - -template<typename T, typename... Ts> -struct per; - -template<typename F, int Num, int... Den> - requires see below -struct power; - -// [qty.ref], reference - -// [qty.dim], dimension - -// [qty.dim.concepts], concepts - -template<typename T> -concept Dimension = see below; - -template<typename T, auto D> -concept DimensionOf = see below; - -// [qty.dim.types], types - -template<symbol_text Symbol> -struct base_dimension; - -template<SymbolicConstant... Expr> -struct derived_dimension; - -struct dimension_one; -inline constexpr dimension_one dimension_one{}; - -// [qty.dim.ops], operations - -consteval Dimension auto inverse(Dimension auto d); - -template<std::intmax_t Num, std::intmax_t Den = 1, Dimension D> - requires(Den != 0) -consteval Dimension auto pow(D d); -consteval Dimension auto sqrt(Dimension auto d); -consteval Dimension auto cbrt(Dimension auto d); - -// [qty.dim.sym.fmt], symbol formatting - -struct dimension_symbol_formatting { - character_set char_set = character_set::default_character_set; -}; - -template<typename CharT = char, std::output_iterator<CharT> Out, Dimension D> -constexpr Out dimension_symbol_to(Out out, D d, const dimension_symbol_formatting& fmt = {}); - -template<dimension_symbol_formatting fmt = {}, typename CharT = char, Dimension D> -consteval std::string_view dimension_symbol(D); - -// [qty.spec], quantity specification - -// [qty.spec.concepts], concepts - -template<typename T> -concept QuantitySpec = see below; - -template<typename T, auto QS> -concept QuantitySpecOf = see below; - -// [qty.spec.types], types - -// [named.qty], named - -struct is_kind; -inline constexpr is_kind is_kind{}; - -template<auto...> -struct quantity_spec; // not defined - -template<BaseDimension auto Dim, QSProperty auto... Args> -struct quantity_spec<Dim, Args...>; - -template<DerivedQuantitySpec auto Eq, QSProperty auto... Args> -struct quantity_spec<Eq, Args...>; - -template<NamedQuantitySpec auto QS, QSProperty auto... Args> -struct quantity_spec<QS, Args...>; - -template<NamedQuantitySpec auto QS, DerivedQuantitySpec auto Eq, QSProperty auto... Args> -struct quantity_spec<QS, Eq, Args...>; - -// [derived.qty], derived - -template<SymbolicConstant... Expr> -struct derived_quantity_spec; - -// [dimless.qty], base quantity of dimension one - -struct dimensionless; -inline constexpr dimensionless dimensionless{}; - -// [kind.of.qty], kind of - -template<QuantitySpec Q> - requires see below -struct kind_of_; -template<QuantitySpec auto Q> - requires requires { typename kind_of_<decltype(Q)>; } -inline constexpr kind_of_<decltype(Q)> kind_of{}; - -// [qty.spec.ops], operations - -consteval QuantitySpec auto inverse(QuantitySpec auto q); - -template<std::intmax_t Num, std::intmax_t Den = 1, QuantitySpec Q> - requires(Den != 0) -consteval QuantitySpec auto pow(Q q); -consteval QuantitySpec auto sqrt(QuantitySpec auto q); -consteval QuantitySpec auto cbrt(QuantitySpec auto q); - -// [qty.spec.hier.algos], hierarchy algorithms - -// [qty.spec.conv], conversion - -consteval bool implicitly_convertible(QuantitySpec auto from, QuantitySpec auto to); -consteval bool explicitly_convertible(QuantitySpec auto from, QuantitySpec auto to); -consteval bool castable(QuantitySpec auto from, QuantitySpec auto to); -consteval bool interconvertible(QuantitySpec auto qs1, QuantitySpec auto qs2); - -// [qty.get.kind], get_kind - -template<QuantitySpec Q> -consteval see below get_kind(Q); - -// [get.common.qty.spec], get_common_quantity_spec - -consteval QuantitySpec auto get_common_quantity_spec(QuantitySpec auto... qs) - requires see below; - -// [qty.unit], unit - -// [qty.unit.mag], magnitude - -// [qty.unit.mag.concepts], concepts - -template<typename T> -concept MagConstant = see below; - -template<typename T> -concept UnitMagnitude = see below; - -// [qty.unit.mag.types], types - -template<symbol_text Symbol, long double Value> - requires(Value > 0) -struct mag_constant; - -// [qty.unit.mag.ops], operations - -template<MagArg auto V> -constexpr UnitMagnitude auto mag = see below; - -template<std::intmax_t N, std::intmax_t D> - requires(N > 0) -constexpr UnitMagnitude auto mag_ratio = see below; - -template<MagArg auto Base, int Num, int Den = 1> -constexpr UnitMagnitude auto mag_power = see below; - -// constants - -inline constexpr struct pi final : - mag_constant<{u8"\u03C0" /* U+03c0 GREEK SMALL LETTER PI */, "pi"}, - std::numbers::pi_v<long double>> { -} pi; - -inline constexpr auto \u03C0 /* U+03c0 GREEK SMALL LETTER PI */ = pi; - -// [qty.unit.traits], traits - -template<Unit auto U> -constexpr bool space_before_unit_symbol = true; - -template<> -inline constexpr bool space_before_unit_symbol<one> = false; - -// [qty.unit.concepts], concepts - -template<typename T> -concept Unit = see below; - -template<typename T> -concept PrefixableUnit = see below; - -template<typename T> -concept AssociatedUnit = see below; - -template<typename U, auto QS> -concept UnitOf = see below; - -// [qty.unit.types], types - -// [qty.scaled.unit], scaled - -template<UnitMagnitude auto M, Unit U> - requires see below -struct scaled_unit; - -// [qty.named.unit], named - -template<symbol_text Symbol, auto...> -struct named_unit; // not defined - -template<symbol_text Symbol, QuantityKindSpec auto QS> - requires see below -struct named_unit<Symbol, QS>; - -template<symbol_text Symbol, QuantityKindSpec auto QS, PointOrigin auto PO> - requires see below -struct named_unit<Symbol, QS, PO>; - -template<symbol_text Symbol> - requires see below -struct named_unit<Symbol>; - -template<symbol_text Symbol, Unit auto U> - requires see below -struct named_unit<Symbol, U>; - -template<symbol_text Symbol, Unit auto U, PointOrigin auto PO> - requires see below -struct named_unit<Symbol, U, PO>; - -template<symbol_text Symbol, AssociatedUnit auto U, QuantityKindSpec auto QS> - requires see below -struct named_unit<Symbol, U, QS>; - -template<symbol_text Symbol, AssociatedUnit auto U, QuantityKindSpec auto QS, - PointOrigin auto PO> - requires see below -struct named_unit<Symbol, U, QS, PO>; - -// [qty.prefixed.unit], prefixed - -template<symbol_text Symbol, UnitMagnitude auto M, PrefixableUnit auto U> - requires see below -struct prefixed_unit; - -// [qty.common.unit], common - -template<Unit U1, Unit U2, Unit... Rest> -struct common_unit; - -// [qty.derived.unit], derived - -template<SymbolicConstant... Expr> -struct derived_unit; - -// [qty.unit.one], one - -struct one; -inline constexpr one one{}; - -// named derived units of a quantity of dimension one - -inline constexpr struct percent final : named_unit<"%", mag_ratio<1, 100> * one> { -} percent; - -inline constexpr struct per_mille final : - named_unit<symbol_text{u8"\u2030" /* U+2030 PER MILLE SIGN */, "%o"}, - mag_ratio<1, 1000> * one> { -} per_mille; - -inline constexpr struct parts_per_million final : - named_unit<"ppm", mag_ratio<1, 1'000'000> * one> { -} parts_per_million; - -inline constexpr auto ppm = parts_per_million; - -// [qty.unit.ops], operations - -consteval Unit auto inverse(Unit auto u); - -template<std::intmax_t Num, std::intmax_t Den = 1, Unit U> - requires see below -consteval Unit auto pow(U u); -consteval Unit auto sqrt(Unit auto u); -consteval Unit auto cbrt(Unit auto u); -consteval Unit auto square(Unit auto u); -consteval Unit auto cubic(Unit auto u); - -// [qty.unit.cmp], comparison - -template<Unit From, Unit To> -consteval bool convertible(From from, To to); - -// [qty.unit.obs], observers - -consteval QuantitySpec auto get_quantity_spec(AssociatedUnit auto u); -consteval Unit auto get_unit(AssociatedUnit auto u); - -consteval Unit auto get_common_unit(Unit auto... us) - requires see below; - -// [qty.unit.sym.fmt], symbol formatting - -enum class unit_symbol_solidus : std::int8_t { - one_denominator, - always, - never, - default_denominator = one_denominator -}; - -enum class unit_symbol_separator : std::int8_t { - space, - half_high_dot, - default_separator = space -}; - -struct unit_symbol_formatting { - character_set char_set = character_set::default_character_set; - unit_symbol_solidus solidus = unit_symbol_solidus::default_denominator; - unit_symbol_separator separator = unit_symbol_separator::default_separator; -}; - -template<typename CharT = char, std::output_iterator<CharT> Out, Unit U> -constexpr Out unit_symbol_to(Out out, U u, const unit_symbol_formatting& fmt = {}); - -template<unit_symbol_formatting fmt = {}, typename CharT = char, Unit U> -consteval std::string_view unit_symbol(U); - -// [qty.ref.concepts], concepts - -template<typename T> -concept Reference = see below; - -template<typename T, auto QS> -concept ReferenceOf = see below; - -// [qty.ref.syn], class template reference - -template<QuantitySpec Q, Unit U> -struct reference; - -// [qty.ref.ops], operations - -template<typename FwdRep, Reference R, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> - requires(!OffsetUnit<decltype(get_unit(R{}))>) -constexpr quantity<R{}, Rep> operator*(FwdRep&& lhs, R r); - -template<typename FwdRep, Reference R, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> - requires(!OffsetUnit<decltype(get_unit(R{}))>) -constexpr Quantity auto operator/(FwdRep&& lhs, R); - -template<typename FwdQ, Reference R, Quantity Q = std::remove_cvref_t<FwdQ>> -constexpr Quantity auto operator*(FwdQ&& q, R); - -template<typename FwdQ, Reference R, Quantity Q = std::remove_cvref_t<FwdQ>> -constexpr Quantity auto operator/(FwdQ&& q, R); - -template<Reference R, typename Rep> - requires RepresentationOf<std::remove_cvref_t<Rep>, get_quantity_spec(R{})> -constexpr auto operator*(R, Rep&&) = delete; - -template<Reference R, typename Rep> - requires RepresentationOf<std::remove_cvref_t<Rep>, get_quantity_spec(R{})> -constexpr auto operator/(R, Rep&&) = delete; - -template<Reference R, typename Q> - requires Quantity<std::remove_cvref_t<Q>> -constexpr auto operator*(R, Q&&) = delete; - -template<Reference R, typename Q> - requires Quantity<std::remove_cvref_t<Q>> -constexpr auto operator/(R, Q&&) = delete; - -// [qty.ref.obs], observers - -template<typename Q, typename U> -consteval QuantitySpec auto get_quantity_spec(reference<Q, U>); - -template<typename Q, typename U> -consteval Unit auto get_unit(reference<Q, U>); - -consteval AssociatedUnit auto get_common_reference(AssociatedUnit auto u1, - AssociatedUnit auto u2, - AssociatedUnit auto... rest) - requires see below; - -template<Reference R1, Reference R2, Reference... Rest> -consteval Reference auto get_common_reference(R1 r1, R2 r2, Rest... rest) - requires see below; - -// [qty.rep], representation - -enum class quantity_character { scalar, complex, vector, tensor }; - -// [qty.rep.traits], traits - -// [qty.fp.traits], floating-point - -template<typename Rep> -constexpr bool treat_as_floating_point = see below; - -// [qty.char.traits], quantity character - -template<typename T> -constexpr bool disable_scalar = false; -template<> -inline constexpr bool disable_scalar<bool> = true; -template<typename T> -constexpr bool disable_scalar<std::complex<T>> = true; - -template<typename T> -constexpr bool disable_complex = false; - -template<typename T> -constexpr bool disable_vector = false; - -// [qty.val.traits], values - -template<typename Rep> -struct representation_values; - -// [qty.rep.cpos], customization point objects - -inline namespace unspecified { - -inline constexpr unspecified real = unspecified; -inline constexpr unspecified imag = unspecified; -inline constexpr unspecified modulus = unspecified; - -inline constexpr unspecified magnitude = unspecified; - -} - -// [qty.rep.concepts], concepts - -template<typename T> -concept Representation = see below; - -template<typename T, quantity_character Ch> -concept RepresentationOf = see below; - -// [qty], quantity - -// [qty.like], interoperability - -template<typename T> -struct quantity_like_traits; // not defined - -template<typename T> -concept QuantityLike = see below; - -// [qty.syn], class template quantity - -template<typename T> -concept Quantity = see below; - -template<typename Q, auto QS> -concept QuantityOf = see below; - -template<Reference auto R, RepresentationOf<get_quantity_spec(R)> Rep = double> -class quantity; - -// [qty.delta], construction helper delta - -template<Reference R> -struct delta_; - -template<Reference auto R> -constexpr delta_<decltype(R)> delta{}; - -// [qty.non.mem.conv], non-member conversions - -template<Unit auto ToU, see below> - requires see below -constexpr Quantity auto value_cast(see below q); - -template<Representation ToRep, see below> - requires see below -constexpr quantity<see below, ToRep> value_cast(see below q); - -template<Unit auto ToU, Representation ToRep, see below> - requires see below -constexpr Quantity auto value_cast(see below q); -template<Representation ToRep, Unit auto ToU, see below> - requires see below -constexpr Quantity auto value_cast(see below q); - -template<Quantity ToQ, see below> - requires see below -constexpr Quantity auto value_cast(see below q); - -template<QuantitySpec auto ToQS, see below> - requires see below -constexpr Quantity auto quantity_cast(see below q); - -} - -// [qty.common.type], std​::​common_type specializations - -template<mp_units::Quantity Q1, mp_units::Quantity Q2> - requires see below -struct std::common_type<Q1, Q2>; - -template<mp_units::Quantity Q, mp_units::Representation Value> - requires see below -struct std::common_type<Q, Value>; - -template<mp_units::Quantity Q, mp_units::Representation Value> - requires requires { typename std::common_type<Q, Value>; } -struct std::common_type<Value, Q> : std::common_type<Q, Value> {}; - -namespace mp_units { - -// [qty.pt], quantity point - -// [qty.pt.orig], point origin - -// [qty.pt.orig.concepts], concepts - -template<typename T> -concept PointOrigin = see below; - -template<typename T, auto QS> -concept PointOriginFor = see below; - -// [qty.pt.orig.types], types - -// [qty.abs.pt.orig], absolute - -template<QuantitySpec auto QS> -struct absolute_point_origin; - -// [qty.rel.pt.orig], relative - -template<QuantityPoint auto QP> -struct relative_point_origin; - -// [qty.zeroth.pt.orig], zeroth - -template<QuantitySpec auto QS> -struct zeroth_point_origin_; - -template<QuantitySpec auto QS> -constexpr zeroth_point_origin_<QS> zeroth_point_origin{}; - -// [qty.def.pt.orig], default - -template<Reference R> -consteval PointOriginFor<get_quantity_spec(R{})> auto default_point_origin(R); - -// [qty.pt.like], interoperability - -template<typename T> -struct quantity_point_like_traits; // not defined - -template<typename T> -concept QuantityPointLike = see below; - -// [qty.pt.syn], class template quantity_point - -template<typename T> -concept QuantityPoint = see below; - -template<typename QP, auto V> -concept QuantityPointOf = see below; - -template<Reference auto R, - PointOriginFor<get_quantity_spec(R)> auto PO = default_point_origin(R), - RepresentationOf<get_quantity_spec(R)> Rep = double> -class quantity_point; - -// [qty.point], construction helper point - -template<Reference R> -struct point_; - -template<Reference auto R> -constexpr point_<decltype(R)> point{}; - -// [qty.pt.non.mem.conv], non-member conversions - -template<Unit auto ToU, see below> - requires see below -constexpr QuantityPoint auto value_cast(see below qp); - -template<Representation ToRep, see below> - requires see below -constexpr quantity_point<see below, see below, ToRep> value_cast(see below qp); - -template<Unit auto ToU, Representation ToRep, see below> - requires see below -constexpr QuantityPoint auto value_cast(see below qp); -template<Representation ToRep, Unit auto ToU, see below> - requires see below -constexpr QuantityPoint auto value_cast(see below qp); - -template<Quantity ToQ, see below> - requires see below -constexpr QuantityPoint auto value_cast(see below qp); - -template<QuantityPoint ToQP, see below> - requires see below -constexpr QuantityPoint auto value_cast(see below qp); - -template<QuantitySpec auto ToQS, see below> - requires see below -constexpr QuantityPoint auto quantity_cast(see below qp); - -} -

5.2.3 Module mp_units.systems synopsis [mp.units.systems.syn]

export module mp_units.systems; - -export import mp_units.core; -import std; - -export namespace mp_units { - -// [qty.chrono], std​::​chrono interoperability - -template<typename Rep, typename Period> -struct quantity_like_traits<std::chrono::duration<Rep, Period>>; - -template<typename Clock> -struct chrono_point_origin_; -template<typename Clock> -constexpr chrono_point_origin_<Clock> chrono_point_origin{}; - -template<typename Clock, typename Rep, typename Period> -struct quantity_point_like_traits< - std::chrono::time_point<Clock, std::chrono::duration<Rep, Period>>>; - -} -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/mp.units.systems.syn.html b/HEAD/api_reference/gen/mp.units.systems.syn.html deleted file mode 100644 index 0e9cbff4..00000000 --- a/HEAD/api_reference/gen/mp.units.systems.syn.html +++ /dev/null @@ -1,23 +0,0 @@ -[mp.units.systems.syn]

5 Quantities and units library [quantities]

5.2 mp-units module synopses [mp.units.syns]

5.2.3 Module mp_units.systems synopsis [mp.units.systems.syn]

export module mp_units.systems; - -export import mp_units.core; -import std; - -export namespace mp_units { - -// [qty.chrono], std​::​chrono interoperability - -template<typename Rep, typename Period> -struct quantity_like_traits<std::chrono::duration<Rep, Period>>; - -template<typename Clock> -struct chrono_point_origin_; -template<typename Clock> -constexpr chrono_point_origin_<Clock> chrono_point_origin{}; - -template<typename Clock, typename Rep, typename Period> -struct quantity_point_like_traits< - std::chrono::time_point<Clock, std::chrono::duration<Rep, Period>>>; - -} -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/named.qty.html b/HEAD/api_reference/gen/named.qty.html deleted file mode 100644 index daf4b092..00000000 --- a/HEAD/api_reference/gen/named.qty.html +++ /dev/null @@ -1,65 +0,0 @@ -[named.qty]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.3 Quantity specification [qty.spec]

5.4.3.3 Types [qty.spec.types]

5.4.3.3.1 Named [named.qty]

namespace mp_units { - -struct is_kind {}; - -template<BaseDimension auto Dim, QSProperty auto... Args> -struct quantity_spec<Dim, Args...> : quantity-spec-interface { - using base-type = quantity_spec; - static constexpr BaseDimension auto dimension = Dim; - static constexpr quantity_character character = see below; -}; - -template<DerivedQuantitySpec auto Eq, QSProperty auto... Args> -struct quantity_spec<Eq, Args...> : quantity-spec-interface { - using base-type = quantity_spec; - static constexpr auto equation = Eq; - static constexpr Dimension auto dimension = Eq.dimension; - static constexpr quantity_character character = see below; -}; - -template<NamedQuantitySpec auto QS, QSProperty auto... Args> -struct quantity_spec<QS, Args...> : quantity-spec-interface { - using base-type = quantity_spec; - static constexpr auto parent = QS; - static constexpr auto equation = parent.equation; // exposition only, present only - // if the qualified-id parent.equation is valid and denotes an object - static constexpr Dimension auto dimension = parent.dimension; - static constexpr quantity_character character = see below; -}; - -template<NamedQuantitySpec auto QS, DerivedQuantitySpec auto Eq, QSProperty auto... Args> - requires QuantitySpecExplicitlyConvertibleTo<Eq, QS> -struct quantity_spec<QS, Eq, Args...> : quantity-spec-interface { - using base-type = quantity_spec; - static constexpr auto parent = QS; - static constexpr auto equation = Eq; - static constexpr Dimension auto dimension = parent.dimension; - static constexpr quantity_character character = see below; -}; - -} -
A named quantity is a type that models NamedQuantitySpec.
A specialization of quantity_spec is used as a base type when defining a named quantity.
In the following descriptions, let Q be a named quantity defined with an alluded signature.
The identifier of Q represents its quantity name (IEC 60050, 112-01-02).
Let Ch be an enumerator value of quantity_character.
The possible arguments to quantity_spec are -
  • ,
  • ,
  • , and
  • .
If the first argument is a base quantity dimension, -then Q is that base quantity (IEC 60050, 112-01-08).
If an argument is a quantity calculus (IEC 60050, 112-01-30) C, -then Q is implicitly convertible from C.
If the first argument is a named quantity, -then Q is of its kind (IEC 60050, 112-01-04).
The member character represents -the set of the numerical value of Q ([qty.char.traits]) -and is equal to -
  • Ch if specified,
  • otherwise, quantity_character​::​real_scalar for the first signature, and
  • otherwise, (BC).character, -where BC is the argument preceding Ch in the signatures above.
is_kind specifies Q to start a new hierarchy tree of a kind.
Optional arguments may appear in any order.
[Example 1: // The first signature defines a base quantity. -inline constexpr struct length final : quantity_spec<dim_length> { -} length; // Length is a base quantity. - -// The second signature defines a derived quantity. -inline constexpr struct area final : quantity_spec<pow<2>(length)> { -} area; // An area equals length by length. - -// The third and fourth signatures add a leaf to a hierarchy of kinds. -inline constexpr struct width final : quantity_spec<length> { -} width; // Width is a kind of length. - -// The fourth signature also refines the calculus required for implicit conversions. -inline constexpr struct angular_measure final : - quantity_spec<dimensionless, arc_length / radius, is_kind> { -} angular_measure; // Requires an arc length per radius, not just any quantity of dimension one. - — end example]
\ No newline at end of file diff --git a/HEAD/api_reference/gen/normative-only.css b/HEAD/api_reference/gen/normative-only.css deleted file mode 100644 index 66cf1093..00000000 --- a/HEAD/api_reference/gen/normative-only.css +++ /dev/null @@ -1,9 +0,0 @@ -div.example { display: none; } -div.note { display: none; } - -a.footnotenum { display: none; } -div.footnote { display: none; } -div.footnoteSeparator { display: none; } -.footnoteref { display: none; } - -div.nonNormativeOnly { display: none; } diff --git a/HEAD/api_reference/gen/qty.abs.pt.orig.html b/HEAD/api_reference/gen/qty.abs.pt.orig.html deleted file mode 100644 index ed262ad5..00000000 --- a/HEAD/api_reference/gen/qty.abs.pt.orig.html +++ /dev/null @@ -1,10 +0,0 @@ -[qty.abs.pt.orig]

5 Quantities and units library [quantities]

5.7 Quantity point [qty.pt]

5.7.2 Point origin [qty.pt.orig]

5.7.2.3 Types [qty.pt.orig.types]

5.7.2.3.1 Absolute [qty.abs.pt.orig]

namespace mp_units { - -template<QuantitySpec auto QS> -struct absolute_point_origin : point-origin-interface { - static constexpr QuantitySpec auto quantity-spec = QS; // exposition only -}; - -} -
An absolute origin is an origin -chosen by convention and not defined in terms of another origin.
A specialization of absolute_point_origin is used as a base type when defining an absolute origin.
QS is the quantity the origin represents.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.arith.ops.html b/HEAD/api_reference/gen/qty.arith.ops.html deleted file mode 100644 index dc097506..00000000 --- a/HEAD/api_reference/gen/qty.arith.ops.html +++ /dev/null @@ -1,74 +0,0 @@ -[qty.arith.ops]

5 Quantities and units library [quantities]

5.6 Quantity [qty]

5.6.11 Arithmetic operations [qty.arith.ops]

In the following descriptions, -let @ be the operator.
template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires CommonlyInvocableQuantities<std::plus<>, quantity, quantity<R2, Rep2>> -friend constexpr Quantity auto operator+(const Q& lhs, const quantity<R2, Rep2>& rhs); -template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires CommonlyInvocableQuantities<std::minus<>, quantity, quantity<R2, Rep2>> -friend constexpr Quantity auto operator-(const Q& lhs, const quantity<R2, Rep2>& rhs); -template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires(!treat_as_floating_point<Rep>) && (!treat_as_floating_point<Rep2>) && - CommonlyInvocableQuantities<std::modulus<>, quantity, quantity<R2, Rep2>> -friend constexpr Quantity auto operator%(const Q& lhs, const quantity<R2, Rep2>& rhs); -
Let F be the first argument to CommonlyInvocableQuantities.
Preconditions: If @ is %, then is_neq_zero(rhs) is true.
Effects: Equivalent to: -using ret = common-quantity-for<F, quantity, quantity<R2, Rep2>>; -const ret ret_lhs(lhs); -const ret ret_rhs(rhs); -return ::mp_units::quantity{ - ret_lhs.numerical_value_ref_in(ret::unit) @ ret_rhs.numerical_value_ref_in(ret::unit), - ret::reference}; -
template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::plus<>, Rep, const Value&> -friend constexpr Quantity auto operator+(const Q& lhs, const Value& rhs); -template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::minus<>, Rep, const Value&> -friend constexpr Quantity auto operator-(const Q& lhs, const Value& rhs); -template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::modulus<>, Rep, const Value&> -friend constexpr Quantity auto operator%(const Q& lhs, const Value& rhs); -
Effects: Equivalent to: -return lhs @ ​::​mp_units​::​quantity{rhs};
template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::plus<>, Rep, const Value&> -friend constexpr Quantity auto operator+(const Value& lhs, const Q& rhs); -template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::minus<>, Rep, const Value&> -friend constexpr Quantity auto operator-(const Value& lhs, const Q& rhs); -template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::modulus<>, Rep, const Value&> -friend constexpr Quantity auto operator%(const Value& lhs, const Q& rhs); -
Effects: Equivalent to: -return ​::​mp_units​::​quantity{lhs} @ rhs;
template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires InvocableQuantities<std::multiplies<>, quantity, quantity<R2, Rep2>> -friend constexpr Quantity auto operator*(const Q& lhs, const quantity<R2, Rep2>& rhs); -template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires InvocableQuantities<std::divides<>, quantity, quantity<R2, Rep2>> -friend constexpr Quantity auto operator/(const Q& lhs, const quantity<R2, Rep2>& rhs); -
Preconditions: If @ is /, then is_neq_zero(rhs) is true.
Effects: Equivalent to: -return ::mp_units::quantity{ - lhs.numerical_value_ref_in(unit) @ rhs.numerical_value_ref_in(rhs.unit), R @ R2}; -
template<std::derived_from<quantity> Q, typename Value> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::multiplies<>, Rep, const Value&> -friend constexpr QuantityOf<quantity_spec> auto operator*(const Q& lhs, const Value& rhs); -template<std::derived_from<quantity> Q, typename Value> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::divides<>, Rep, const Value&> -friend constexpr QuantityOf<quantity_spec> auto operator/(const Q& lhs, const Value& rhs); -
Preconditions: If @ is /, then rhs != representation_values<Value>​::​zero() is true.
Effects: Equivalent to: -return ::mp_units::quantity{lhs.numerical_value_ref_in(unit) @ rhs, R}; -
template<typename Value, std::derived_from<quantity> Q> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::multiplies<>, const Value&, Rep> -friend constexpr QuantityOf<quantity_spec> auto operator*(const Value& lhs, const Q& rhs); -template<typename Value, std::derived_from<quantity> Q> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::divides<>, const Value&, Rep> -friend constexpr Quantity auto operator/(const Value& lhs, const Q& rhs); -
Preconditions: If @ is /, then is_neq_zero(rhs) is true.
Effects: Equivalent to: -return ::mp_units::quantity{lhs @ rhs.numerical_value_ref_in(unit), ::mp_units::one @ R}; -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.assign.ops.html b/HEAD/api_reference/gen/qty.assign.ops.html deleted file mode 100644 index 956ae3cd..00000000 --- a/HEAD/api_reference/gen/qty.assign.ops.html +++ /dev/null @@ -1,43 +0,0 @@ -[qty.assign.ops]

5 Quantities and units library [quantities]

5.6 Quantity [qty]

5.6.10 Compound assignment operations [qty.assign.ops]

In the following descriptions, -let @ be the operator.
template<Mutable<quantity> Q, auto R2, typename Rep2> - requires see below -friend constexpr decltype(auto) operator+=(Q&& lhs, const quantity<R2, Rep2>& rhs); -template<Mutable<quantity> Q, auto R2, typename Rep2> - requires see below -friend constexpr decltype(auto) operator-=(Q&& lhs, const quantity<R2, Rep2>& rhs); -template<Mutable<quantity> Q, auto R2, typename Rep2> - requires see below -friend constexpr decltype(auto) operator%=(Q&& lhs, const quantity<R2, Rep2>& rhs); -
Preconditions: If @ is %=, then is_neq_zero(rhs) is true.
Effects: Equivalent to -lhs.numerical-value @ rhs.in(lhs.unit).numerical-value.
Returns: std​::​forward<Q>(lhs).
Remarks: Let C be -
  • (!treat_as_floating_point<rep>) if @ is %=, and
  • true otherwise.
-The expression in the requires-clause is equivalent to: -QuantityConvertibleTo<quantity<R2, Rep2>, quantity> && C && -requires(rep& a, const Rep2 b) { - { a @ b } -> std::same_as<rep&>; -} -
Recommended practice: If equivalent(unit, get_unit(rhs.reference)) is true, -then the expression rhs.in(lhs.unit) is replaced with rhs.
template<Mutable<quantity> Q, ValuePreservingTo<Rep> Value> - requires see below -friend constexpr decltype(auto) operator*=(Q&& lhs, const Value& rhs); -template<Mutable<quantity> Q, ValuePreservingTo<Rep> Value> - requires see below -friend constexpr decltype(auto) operator/=(Q&& lhs, const Value& rhs); -
Preconditions: If @ is /=, then rhs != representation_values<Value>​::​zero() is true.
Effects: Equivalent to -lhs.numerical-value @ rhs.
Returns: std​::​forward<Q>(lhs).
Remarks: The expression in the requires-clause is equivalent to: -(!Quantity<Value>) && requires(rep& a, const Value b) { - { a @ b } -> std::same_as<rep&>; -} -
template<Mutable<quantity> Q, QuantityOf<dimensionless> Q2> - requires see below -friend constexpr decltype(auto) operator*=(Q&& lhs, const Q2& rhs); -template<Mutable<quantity> Q, QuantityOf<dimensionless> Q2> - requires see below -friend constexpr decltype(auto) operator/=(Q&& lhs, const Q2& rhs); -
Effects: Equivalent to: -return std​::​forward<Q>(lhs) @ rhs.numerical-value;
Remarks: The expression in the requires-clause is equivalent to: -(Q2::unit == ::mp_units::one) && ValuePreservingTo<typename Q2::rep, Rep> && -requires(rep& a, const Q2::rep b) { - { a @ b } -> std::same_as<rep&>; -} -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.canon.unit.html b/HEAD/api_reference/gen/qty.canon.unit.html deleted file mode 100644 index 579f6811..00000000 --- a/HEAD/api_reference/gen/qty.canon.unit.html +++ /dev/null @@ -1,11 +0,0 @@ -[qty.canon.unit]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.4 Unit [qty.unit]

5.4.4.5 Types [qty.unit.types]

5.4.4.5.1 Canonical [qty.canon.unit]

namespace mp_units { - -template<UnitMagnitude M, Unit U> -struct canonical-unit { // exposition only - M mag; - U reference_unit; -}; - -} -
canonical-unit represents a unit expressed in terms of base units (IEC 60050, 112-01-18).
[Note 1: 
Other types representing units are equal only if they have the same type.
canonical-unit is used to implement binary relations other than equality.
— end note]
reference_unit is simplified ([qty.sym.expr.algos]).
consteval auto get-canonical-unit(Unit auto u); // exposition only -
Returns: The instantiation of canonical-unit for u.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.char.traits.html b/HEAD/api_reference/gen/qty.char.traits.html deleted file mode 100644 index de8f1460..00000000 --- a/HEAD/api_reference/gen/qty.char.traits.html +++ /dev/null @@ -1,12 +0,0 @@ -[qty.char.traits]

5 Quantities and units library [quantities]

5.5 Representation [qty.rep]

5.5.2 Traits [qty.rep.traits]

5.5.2.2 Quantity character [qty.char.traits]

template<typename T> -constexpr bool disable_scalar = false; -template<typename T> -constexpr bool disable_complex = false; -template<typename T> -constexpr bool disable_vector = false; -
Some quantities are defined as having a numerical value (IEC 60050, 112-01-29) of a specific set (IEC 60050, 102-01-02).
The representation concepts use these traits -to help determine the sets T represents.
Remarks: Pursuant to N4971, [namespace.std] ([spec.ext]), -users may specialize these templates -for cv-unqualified program-defined types.
Such specializations shall be usable in constant expressions (N4971, [expr.const]) -and have type const bool.
[Note 1: 
These templates prevent use of representation types with the library -that satisfy but do not in fact model their corresponding concept.
— end note]
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.chrono.html b/HEAD/api_reference/gen/qty.chrono.html deleted file mode 100644 index 60abc793..00000000 --- a/HEAD/api_reference/gen/qty.chrono.html +++ /dev/null @@ -1,78 +0,0 @@ -[qty.chrono]

5 Quantities and units library [quantities]

5.9 std​::​chrono interoperability [qty.chrono]

namespace mp_units { - -template<typename Period> -consteval auto time-unit-from-chrono-period() -{ - using namespace si; - - if constexpr (is_same_v<Period, std::chrono::nanoseconds::period>) - return nano<second>; - else if constexpr (is_same_v<Period, std::chrono::microseconds::period>) - return micro<second>; - else if constexpr (is_same_v<Period, std::chrono::milliseconds::period>) - return milli<second>; - else if constexpr (is_same_v<Period, std::chrono::seconds::period>) - return second; - else if constexpr (is_same_v<Period, std::chrono::minutes::period>) - return minute; - else if constexpr (is_same_v<Period, std::chrono::hours::period>) - return hour; - else if constexpr (is_same_v<Period, std::chrono::days::period>) - return day; - else if constexpr (is_same_v<Period, std::chrono::weeks::period>) - return mag<7> * day; - else - return mag_ratio<Period::num, Period::den> * second; -} - -template<typename Rep, typename Period> -struct quantity_like_traits<std::chrono::duration<Rep, Period>> { - static constexpr auto reference = time-unit-from-chrono-period<Period>(); - static constexpr bool explicit_import = false; - static constexpr bool explicit_export = false; - using rep = Rep; - using T = std::chrono::duration<Rep, Period>; - - static constexpr rep to_numerical_value(const T& q) noexcept( - std::is_nothrow_copy_constructible_v<rep>) - { - return q.count(); - } - - static constexpr T from_numerical_value(const rep& v) noexcept( - std::is_nothrow_copy_constructible_v<rep>) - { - return T(v); - } -}; - -template<typename Clock> -struct chrono_point_origin_ final : absolute_point_origin<isq::time> { - using clock = Clock; -}; - -template<typename Clock, typename Rep, typename Period> -struct quantity_point_like_traits< - std::chrono::time_point<Clock, std::chrono::duration<Rep, Period>>> { - static constexpr auto reference = time-unit-from-chrono-period<Period>(); - static constexpr auto point_origin = chrono_point_origin<Clock>; - static constexpr bool explicit_import = false; - static constexpr bool explicit_export = false; - using rep = Rep; - using T = std::chrono::time_point<Clock, std::chrono::duration<Rep, Period>>; - - static constexpr rep to_numerical_value(const T& tp) noexcept( - std::is_nothrow_copy_constructible_v<rep>) - { - return tp.time_since_epoch().count(); - } - - static constexpr T from_numerical_value(const rep& v) noexcept( - std::is_nothrow_copy_constructible_v<rep>) - { - return T(std::chrono::duration<Rep, Period>(v)); - } -}; - -} -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.cmp.html b/HEAD/api_reference/gen/qty.cmp.html deleted file mode 100644 index d2cb9c48..00000000 --- a/HEAD/api_reference/gen/qty.cmp.html +++ /dev/null @@ -1,29 +0,0 @@ -[qty.cmp]

5 Quantities and units library [quantities]

5.6 Quantity [qty]

5.6.12 Comparison [qty.cmp]

In the following descriptions, -let @ be the operator.
template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires see below -friend constexpr bool operator==(const Q& lhs, const quantity<R2, Rep2>& rhs); -template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires see below -friend constexpr auto operator<=>(const Q& lhs, const quantity<R2, Rep2>& rhs); -
Let C be -std​::​equality_comparable if @ is ==, and -std​::​three_way_comparable if @ is <=>.
Effects: Equivalent to: -using ct = std::common_type_t<quantity, quantity<R2, Rep2>>; -const ct ct_lhs(lhs); -const ct ct_rhs(rhs); -return ct_lhs.numerical_value_ref_in(ct::unit) @ ct_rhs.numerical_value_ref_in(ct::unit); -
Remarks: The expression in the requires-clause is equivalent to: -requires { - typename std::common_type_t<quantity, quantity<R2, Rep2>>; -} && C<typename std::common_type_t<quantity, quantity<R2, Rep2>>::rep> -
template<std::derived_from<quantity> Q, Representation Value> - requires see below -friend constexpr bool operator==(const Q& lhs, const Value& rhs); -template<std::derived_from<quantity> Q, Representation Value> - requires see below -friend constexpr auto operator<=>(const Q& lhs, const Value& rhs); -
Let C be -std​::​equality_comparable_with if @ is ==, and -std​::​three_way_comparable_with if @ is <=>.
Returns: lhs.numerical_value_ref_in(unit) @ rhs.
Remarks: The expression in the requires-clause is equivalent to: -(Q::unit == ::mp_units::one) && C<Rep, Value> -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.common.type.html b/HEAD/api_reference/gen/qty.common.type.html deleted file mode 100644 index 626ea43d..00000000 --- a/HEAD/api_reference/gen/qty.common.type.html +++ /dev/null @@ -1,21 +0,0 @@ -[qty.common.type]

5 Quantities and units library [quantities]

5.6 Quantity [qty]

5.6.16 std​::​common_type specializations [qty.common.type]

template<mp_units::Quantity Q1, mp_units::Quantity Q2> - requires requires { - { mp_units::get_common_reference(Q1::reference, Q2::reference) } -> mp_units::Reference; - typename std::common_type_t<typename Q1::rep, typename Q2::rep>; - requires mp_units::RepresentationOf<std::common_type_t<typename Q1::rep, typename Q2::rep>, - mp_units::get_common_quantity_spec(Q1::quantity_spec, - Q2::quantity_spec)>; - } -struct std::common_type<Q1, Q2> { - using type = mp_units::quantity<mp_units::get_common_reference(Q1::reference, Q2::reference), - std::common_type_t<typename Q1::rep, typename Q2::rep>>; -}; - -template<mp_units::Quantity Q, mp_units::Representation Value> - requires(Q::unit == mp_units::one) && requires { - typename mp_units::quantity<Q::reference, std::common_type_t<typename Q::rep, Value>>; - } -struct std::common_type<Q, Value> { - using type = mp_units::quantity<Q::reference, std::common_type_t<typename Q::rep, Value>>; -}; -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.common.unit.html b/HEAD/api_reference/gen/qty.common.unit.html deleted file mode 100644 index 613c87bd..00000000 --- a/HEAD/api_reference/gen/qty.common.unit.html +++ /dev/null @@ -1,40 +0,0 @@ -[qty.common.unit]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.4 Unit [qty.unit]

5.4.4.5 Types [qty.unit.types]

5.4.4.5.5 Common [qty.common.unit]

namespace mp_units { - -template<Unit U1, Unit U2, Unit... Rest> -struct common_unit final : decltype(get-common-scaled-unit(U1{}, U2{}, Rest{}...))::base-type -{ - using base-type = common_unit; // exposition only - static constexpr auto common-unit = // exposition only - get-common-scaled-unit(U1{}, U2{}, Rest{}...); -}; - -} -
common_unit is used by the library -to encapsulate a conversion factor between units (IEC 60050, 112-01-33) -common to the operands of quantity addition.
[Example 1: 
The result of 1 * km + 1 * mi -has a common unit -encapsulated by common_unit<mi, km>.
— end example]
-A program that instantiates a specialization of common_unit -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
template<Unit U1, Unit U2, Unit... Rest> -consteval Unit auto get-common-scaled-unit(U1, U2, Rest... rest) // exposition only - requires see below; -
Effects: Equivalent to: -constexpr auto res = [] { - constexpr auto canonical_lhs = get-canonical-unit(U1{}); - constexpr auto canonical_rhs = get-canonical-unit(U2{}); - constexpr auto common_mag = common-magnitude(canonical_lhs.mag, canonical_rhs.mag); - if constexpr (common_mag == mag<1>) - return canonical_lhs.reference_unit; - else - return scaled_unit<common_mag, decltype(auto(canonical_lhs.reference_unit))>{}; -}(); -if constexpr (sizeof...(rest) == 0) - return res; -else - return get-common-scaled-unit(res, rest...); -
Remarks: The expression in the requires-clause is equivalent to: -(convertible(U1{}, U2{}) && (sizeof...(Rest) == 0 || requires { - get-common-scaled-unit(get-common-scaled-unit(u1, u2), rest...); - })) -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.cons.html b/HEAD/api_reference/gen/qty.cons.html deleted file mode 100644 index 38f05c3a..00000000 --- a/HEAD/api_reference/gen/qty.cons.html +++ /dev/null @@ -1,27 +0,0 @@ -[qty.cons]

5 Quantities and units library [quantities]

5.6 Quantity [qty]

5.6.5 Constructors and assignment [qty.cons]

template<typename FwdValue, Reference R2> - requires SameValueAs<R2{}, R, std::remove_cvref_t<FwdValue>, Rep> -constexpr quantity(FwdValue&& v, R2); - -template<ValuePreservingTo<Rep> FwdValue> - requires(unit == ::mp_units::one) -constexpr quantity(FwdValue&& v); -
Effects: Initializes numerical-value with std​::​forward<FwdValue>(v).
template<typename FwdValue, Reference R2, typename Value = std::remove_cvref_t<FwdValue>> - requires(!SameValueAs<R2{}, R, Value, Rep>) && - QuantityConvertibleTo<quantity<R2{}, Value>, quantity> -constexpr quantity(FwdValue&& v, R2); -
Effects: Equivalent to -quantity(quantity<R2{}, Value>{std​::​forward<FwdValue>(v), R2{}}).
template<QuantityConvertibleTo<quantity> Q> -constexpr explicit(!std::convertible_to<typename Q::rep, Rep>) quantity(const Q& q); -
Effects: Equivalent to sudo-cast<quantity>(q) ([qty.non.mem.conv]).
template<QuantityLike Q> - requires QuantityConvertibleTo<quantity-like-type<Q>, quantity> -constexpr explicit(see below) quantity(const Q& q); -
Effects: Equivalent to: -quantity(::mp_units::quantity{quantity_like_traits<Q>::to_numerical_value(q), - quantity_like_traits<Q>::reference}) -
Remarks: The expression inside explicit is equivalent to: -quantity_like_traits<Q>::explicit_import || - !std::convertible_to<typename quantity_like_traits<Q>::rep, Rep> -
template<ValuePreservingTo<Rep> FwdValue> - requires(unit == ::mp_units::one) -constexpr quantity& operator=(FwdValue&& v); -
Effects: Equivalent to numerical-value = std​::​forward<FwdValue>(v).
Returns: *this.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.conv.html b/HEAD/api_reference/gen/qty.conv.html deleted file mode 100644 index 8f001855..00000000 --- a/HEAD/api_reference/gen/qty.conv.html +++ /dev/null @@ -1,29 +0,0 @@ -[qty.conv]

5 Quantities and units library [quantities]

5.6 Quantity [qty]

5.6.6 Conversions [qty.conv]

template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires QuantityConvertibleTo<quantity, quantity<make-reference(quantity_spec, ToU{}), Rep>> -constexpr QuantityOf<quantity_spec> auto in(ToU) const; -
Effects: Equivalent to: -return quantity<make-reference(quantity_spec, ToU{}), Rep>{*this};
template<RepresentationOf<quantity_spec> ToRep> - requires QuantityConvertibleTo<quantity, quantity<reference, ToRep>> -constexpr QuantityOf<quantity_spec> auto in() const; -
Effects: Equivalent to: -return quantity<reference, ToRep>{*this};
template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires QuantityConvertibleTo<quantity, - quantity<make-reference(quantity_spec, ToU{}), ToRep>> -constexpr QuantityOf<quantity_spec> auto in(ToU) const; -
Effects: Equivalent to: -return quantity<make-reference(quantity_spec, ToU{}), ToRep>{*this}; -
template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires requires(const quantity q) { value_cast<ToU{}>(q); } -constexpr QuantityOf<quantity_spec> auto force_in(ToU) const; -
Effects: Equivalent to: -return value_cast<ToU{}>(*this);
template<RepresentationOf<quantity_spec> ToRep> - requires requires(const quantity q) { value_cast<ToRep>(q); } -constexpr QuantityOf<quantity_spec> auto force_in() const; -
Effects: Equivalent to: -return value_cast<ToRep>(*this);
template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires requires(const quantity q) { value_cast<ToU{}, ToRep>(q); } -constexpr QuantityOf<quantity_spec> auto force_in(ToU) const; -
Effects: Equivalent to: -return value_cast<ToU{}, ToRep>(*this);
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.conv.ops.html b/HEAD/api_reference/gen/qty.conv.ops.html deleted file mode 100644 index a203ce30..00000000 --- a/HEAD/api_reference/gen/qty.conv.ops.html +++ /dev/null @@ -1,17 +0,0 @@ -[qty.conv.ops]

5 Quantities and units library [quantities]

5.6 Quantity [qty]

5.6.8 Conversion operations [qty.conv.ops]

template<typename V_, std::constructible_from<Rep> Value = std::remove_cvref_t<V_>> - requires(unit == ::mp_units::one) -explicit operator V_() const & noexcept; -
Returns: numerical-value.
template<typename Q_, QuantityLike Q = std::remove_cvref_t<Q_>> - requires QuantityConvertibleTo<quantity, quantity-like-type<Q>> -constexpr explicit(see below) operator Q_() const noexcept(see below); -
Effects: Equivalent to: -return quantity_like_traits<Q>::from_numerical_value( - numerical_value_in(get_unit(quantity_like_traits<Q>::reference))); -
Remarks: The expression inside explicit is equivalent to: -quantity_like_traits<Q>::explicit_export || - !std::convertible_to<Rep, typename quantity_like_traits<Q>::rep> -
-The exception specification is equivalent to: -noexcept(quantity_like_traits<Q>::from_numerical_value(numerical-value)) && - std::is_nothrow_copy_constructible_v<rep> -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.def.pt.orig.html b/HEAD/api_reference/gen/qty.def.pt.orig.html deleted file mode 100644 index fa12d097..00000000 --- a/HEAD/api_reference/gen/qty.def.pt.orig.html +++ /dev/null @@ -1,8 +0,0 @@ -[qty.def.pt.orig]

5 Quantities and units library [quantities]

5.7 Quantity point [qty.pt]

5.7.2 Point origin [qty.pt.orig]

5.7.2.5 Utilities [qty.pt.orig.utils]

5.7.2.5.2 Default [qty.def.pt.orig]

template<Reference R> -consteval PointOriginFor<get_quantity_spec(R{})> auto default_point_origin(R); -
Effects: Equivalent to: -if constexpr (requires { get_unit(R{}).point-origin; }) - return get_unit(R{}).point-origin; -else - return zeroth_point_origin<get_quantity_spec(R{})>; -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.delta.html b/HEAD/api_reference/gen/qty.delta.html deleted file mode 100644 index 3b628b30..00000000 --- a/HEAD/api_reference/gen/qty.delta.html +++ /dev/null @@ -1,15 +0,0 @@ -[qty.delta]

5 Quantities and units library [quantities]

5.6 Quantity [qty]

5.6.14 Construction helper delta [qty.delta]

namespace mp_units { - -template<Reference R> -struct delta_ { - template<typename FwdRep, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> - constexpr quantity<R{}, Rep> operator()(FwdRep&& lhs) const; -}; - -} -
template<typename FwdRep, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> -constexpr quantity<R{}, Rep> operator()(FwdRep&& lhs) const; -
Effects: Equivalent to: -return quantity{std​::​forward<FwdRep>(lhs), R{}};
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.derived.unit.html b/HEAD/api_reference/gen/qty.derived.unit.html deleted file mode 100644 index ddb54e9d..00000000 --- a/HEAD/api_reference/gen/qty.derived.unit.html +++ /dev/null @@ -1,22 +0,0 @@ -[qty.derived.unit]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.4 Unit [qty.unit]

5.4.4.5 Types [qty.unit.types]

5.4.4.5.6 Derived [qty.derived.unit]

namespace mp_units { - -template<typename... Expr> -struct derived-unit-impl : // exposition only - unit-interface, - expr-fractions<struct one, Expr...> { - using base-type = derived-unit-impl; // exposition only -}; - -template<SymbolicConstant... Expr> -struct derived_unit final : derived-unit-impl<Expr...> {}; - -} -
derived_unit is used by the library -to represent a derived unit (IEC 60050, 112-01-19).
[Example 1: using namespace si::unit_symbols; -int x = m * m; // error: cannot construct from derived_unit<power<si​::​metre, 2>> -int y = m * s; // error: cannot construct from derived_unit<si​::​metre, si​::​second> -int z = m / s; // error: cannot construct from derived_unit<si​::​metre, per<si​::​second>> - — end example]
-A program that instantiates a specialization of derived_unit -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.dim.concepts.html b/HEAD/api_reference/gen/qty.dim.concepts.html deleted file mode 100644 index be58ec66..00000000 --- a/HEAD/api_reference/gen/qty.dim.concepts.html +++ /dev/null @@ -1,10 +0,0 @@ -[qty.dim.concepts]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.2 Dimension [qty.dim]

5.4.2.2 Concepts [qty.dim.concepts]

template<typename T> -concept Dimension = SymbolicConstant<T> && std::derived_from<T, dimension-interface>; - -template<typename T> -concept BaseDimension = // exposition only - Dimension<T> && (is-derived-from-specialization-of<T, base_dimension>()); - -template<typename T, auto D> -concept DimensionOf = Dimension<T> && Dimension<decltype(D)> && (T{} == D); -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.dim.general.html b/HEAD/api_reference/gen/qty.dim.general.html deleted file mode 100644 index 22194c08..00000000 --- a/HEAD/api_reference/gen/qty.dim.general.html +++ /dev/null @@ -1,2 +0,0 @@ -[qty.dim.general]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.2 Dimension [qty.dim]

5.4.2.1 General [qty.dim.general]

Subclause [qty.dim] specifies the components -for defining the dimension of a quantity (IEC 60050, 112-01-11).
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.dim.html b/HEAD/api_reference/gen/qty.dim.html deleted file mode 100644 index 14047ad1..00000000 --- a/HEAD/api_reference/gen/qty.dim.html +++ /dev/null @@ -1,75 +0,0 @@ -[qty.dim]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.2 Dimension [qty.dim]

5.4.2.1 General [qty.dim.general]

Subclause [qty.dim] specifies the components -for defining the dimension of a quantity (IEC 60050, 112-01-11).

5.4.2.2 Concepts [qty.dim.concepts]

template<typename T> -concept Dimension = SymbolicConstant<T> && std::derived_from<T, dimension-interface>; - -template<typename T> -concept BaseDimension = // exposition only - Dimension<T> && (is-derived-from-specialization-of<T, base_dimension>()); - -template<typename T, auto D> -concept DimensionOf = Dimension<T> && Dimension<decltype(D)> && (T{} == D); -

5.4.2.3 Types [qty.dim.types]

namespace mp_units { - -template<symbol_text Symbol> -struct base_dimension : dimension-interface { - static constexpr auto symbol = Symbol; // exposition only -}; - -} -
base_dimension is used -to define the dimension of a base quantity (IEC 60050, 112-01-08).
Symbol is its symbolic representation.
[Example 1: inline constexpr struct dim_length final : base_dimension<"L"> {} dim_length; - — end example]
namespace mp_units { - -template<typename... Expr> -struct derived-dimension-impl // exposition only - : expr-fractions<struct dimension_one, Expr...> {}; - -template<SymbolicConstant... Expr> -struct derived_dimension final : dimension-interface, derived-dimension-impl<Expr...> {}; - -} -
derived_dimension is used by the library -to represent the dimension of a derived quantity (IEC 60050, 112-01-10).
[Example 2: constexpr auto dim_acceleration = isq::speed.dimension / isq::dim_time; -int x = dim_acceleration; // error: cannot construct from - // derived_dimension<isq​::​dim_length, per<power<isq​::​dim_time, 2>>> - — end example]
-A program that instantiates a specialization of derived_dimension -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
namespace mp_units { - -struct dimension_one final : dimension-interface, derived-dimension-impl<> {}; - -} -
dimension_one represents the dimension of a quantity of dimension one (IEC 60050, 112-01-13).

5.4.2.4 Operations [qty.dim.ops]

namespace mp_units { - -struct dimension-interface { // exposition only - template<Dimension Lhs, Dimension Rhs> - friend consteval Dimension auto operator*(Lhs, Rhs); - - template<Dimension Lhs, Dimension Rhs> - friend consteval Dimension auto operator/(Lhs, Rhs); - - template<Dimension Lhs, Dimension Rhs> - friend consteval bool operator==(Lhs, Rhs); -}; - -} -
template<Dimension Lhs, Dimension Rhs> -friend consteval Dimension auto operator*(Lhs, Rhs); -
Returns: expr-multiply<derived_dimension, struct dimension_one>(Lhs{}, Rhs{}).
template<Dimension Lhs, Dimension Rhs> -friend consteval Dimension auto operator/(Lhs, Rhs); -
Returns: expr-divide<derived_dimension, struct dimension_one>(Lhs{}, Rhs{}).
template<Dimension Lhs, Dimension Rhs> -friend consteval bool operator==(Lhs, Rhs); -
Returns: std​::​is_same_v<Lhs, Rhs>.
consteval Dimension auto inverse(Dimension auto d); -
Returns: dimension_one / d.
template<std::intmax_t Num, std::intmax_t Den = 1, Dimension D> - requires(Den != 0) -consteval Dimension auto pow(D d); -
Returns: expr-pow<Num, Den, derived_dimension, struct dimension_one>(d).
consteval Dimension auto sqrt(Dimension auto d); -
Returns: pow<1, 2>(d).
consteval Dimension auto cbrt(Dimension auto d); -
Returns: pow<1, 3>(d).

5.4.2.5 Symbol formatting [qty.dim.sym.fmt]

template<typename CharT = char, std::output_iterator<CharT> Out, Dimension D> -constexpr Out dimension_symbol_to(Out out, D d, const dimension_symbol_formatting& fmt = {}); -
Effects: TBD.
Returns: TBD.
template<dimension_symbol_formatting fmt = {}, typename CharT = char, Dimension D> -consteval std::string_view dimension_symbol(D); -
Effects: Equivalent to: -TBD. -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.dim.ops.html b/HEAD/api_reference/gen/qty.dim.ops.html deleted file mode 100644 index 3136d8fb..00000000 --- a/HEAD/api_reference/gen/qty.dim.ops.html +++ /dev/null @@ -1,27 +0,0 @@ -[qty.dim.ops]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.2 Dimension [qty.dim]

5.4.2.4 Operations [qty.dim.ops]

namespace mp_units { - -struct dimension-interface { // exposition only - template<Dimension Lhs, Dimension Rhs> - friend consteval Dimension auto operator*(Lhs, Rhs); - - template<Dimension Lhs, Dimension Rhs> - friend consteval Dimension auto operator/(Lhs, Rhs); - - template<Dimension Lhs, Dimension Rhs> - friend consteval bool operator==(Lhs, Rhs); -}; - -} -
template<Dimension Lhs, Dimension Rhs> -friend consteval Dimension auto operator*(Lhs, Rhs); -
Returns: expr-multiply<derived_dimension, struct dimension_one>(Lhs{}, Rhs{}).
template<Dimension Lhs, Dimension Rhs> -friend consteval Dimension auto operator/(Lhs, Rhs); -
Returns: expr-divide<derived_dimension, struct dimension_one>(Lhs{}, Rhs{}).
template<Dimension Lhs, Dimension Rhs> -friend consteval bool operator==(Lhs, Rhs); -
Returns: std​::​is_same_v<Lhs, Rhs>.
consteval Dimension auto inverse(Dimension auto d); -
Returns: dimension_one / d.
template<std::intmax_t Num, std::intmax_t Den = 1, Dimension D> - requires(Den != 0) -consteval Dimension auto pow(D d); -
Returns: expr-pow<Num, Den, derived_dimension, struct dimension_one>(d).
consteval Dimension auto sqrt(Dimension auto d); -
Returns: pow<1, 2>(d).
consteval Dimension auto cbrt(Dimension auto d); -
Returns: pow<1, 3>(d).
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.dim.sym.fmt.html b/HEAD/api_reference/gen/qty.dim.sym.fmt.html deleted file mode 100644 index e1d5ca41..00000000 --- a/HEAD/api_reference/gen/qty.dim.sym.fmt.html +++ /dev/null @@ -1,7 +0,0 @@ -[qty.dim.sym.fmt]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.2 Dimension [qty.dim]

5.4.2.5 Symbol formatting [qty.dim.sym.fmt]

template<typename CharT = char, std::output_iterator<CharT> Out, Dimension D> -constexpr Out dimension_symbol_to(Out out, D d, const dimension_symbol_formatting& fmt = {}); -
Effects: TBD.
Returns: TBD.
template<dimension_symbol_formatting fmt = {}, typename CharT = char, Dimension D> -consteval std::string_view dimension_symbol(D); -
Effects: Equivalent to: -TBD. -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.dim.types.html b/HEAD/api_reference/gen/qty.dim.types.html deleted file mode 100644 index 6b78520a..00000000 --- a/HEAD/api_reference/gen/qty.dim.types.html +++ /dev/null @@ -1,33 +0,0 @@ -[qty.dim.types]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.2 Dimension [qty.dim]

5.4.2.3 Types [qty.dim.types]

namespace mp_units { - -template<symbol_text Symbol> -struct base_dimension : dimension-interface { - static constexpr auto symbol = Symbol; // exposition only -}; - -} -
base_dimension is used -to define the dimension of a base quantity (IEC 60050, 112-01-08).
Symbol is its symbolic representation.
[Example 1: inline constexpr struct dim_length final : base_dimension<"L"> {} dim_length; - — end example]
namespace mp_units { - -template<typename... Expr> -struct derived-dimension-impl // exposition only - : expr-fractions<struct dimension_one, Expr...> {}; - -template<SymbolicConstant... Expr> -struct derived_dimension final : dimension-interface, derived-dimension-impl<Expr...> {}; - -} -
derived_dimension is used by the library -to represent the dimension of a derived quantity (IEC 60050, 112-01-10).
[Example 2: constexpr auto dim_acceleration = isq::speed.dimension / isq::dim_time; -int x = dim_acceleration; // error: cannot construct from - // derived_dimension<isq​::​dim_length, per<power<isq​::​dim_time, 2>>> - — end example]
-A program that instantiates a specialization of derived_dimension -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
namespace mp_units { - -struct dimension_one final : dimension-interface, derived-dimension-impl<> {}; - -} -
dimension_one represents the dimension of a quantity of dimension one (IEC 60050, 112-01-13).
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.fp.traits.html b/HEAD/api_reference/gen/qty.fp.traits.html deleted file mode 100644 index d6f26eb5..00000000 --- a/HEAD/api_reference/gen/qty.fp.traits.html +++ /dev/null @@ -1,19 +0,0 @@ -[qty.fp.traits]

5 Quantities and units library [quantities]

5.5 Representation [qty.rep]

5.5.2 Traits [qty.rep.traits]

5.5.2.1 Floating-point [qty.fp.traits]

template<typename T> -struct actual-value-type : cond-value-type<T> {}; // see N4971, [readable.traits] - -template<typename T> - requires(!std::is_pointer_v<T> && !std::is_array_v<T>) && - requires { typename std::indirectly_readable_traits<T>::value_type; } -struct actual-value-type<T> : std::indirectly_readable_traits<T> {}; - -template<typename T> -using actual-value-type-t = actual-value-type<T>::value_type; - -template<typename Rep> -constexpr bool treat_as_floating_point = - std::chrono::treat_as_floating_point_v<actual-value-type-t<Rep>>; -
quantity and quantity_point use treat_as_floating_point -to help determine whether implicit conversions are allowed among them.
Remarks: Pursuant to N4971, [namespace.std] ([spec.ext]), -users may specialize treat_as_floating_point -for cv-unqualified program-defined types.
Such specializations shall be usable in constant expressions (N4971, [expr.const]) -and have type const bool.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.general.html b/HEAD/api_reference/gen/qty.general.html deleted file mode 100644 index e070287b..00000000 --- a/HEAD/api_reference/gen/qty.general.html +++ /dev/null @@ -1,3 +0,0 @@ -[qty.general]

5 Quantities and units library [quantities]

5.6 Quantity [qty]

5.6.1 General [qty.general]

Subclause [qty] describes the class template quantity -that represents the value of a quantity (IEC 60050, 112-01-28) -that is an element of a vector space (IEC 60050, 102-03-01,102-03-04).
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.get.common.base.html b/HEAD/api_reference/gen/qty.get.common.base.html deleted file mode 100644 index da1fa62a..00000000 --- a/HEAD/api_reference/gen/qty.get.common.base.html +++ /dev/null @@ -1,7 +0,0 @@ -[qty.get.common.base]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.3 Quantity specification [qty.spec]

5.4.3.6 Hierarchy algorithms [qty.spec.hier.algos]

5.4.3.6.4 Get common base [qty.get.common.base]

In this subclause and [qty.is.child.of], -let the kind of quantity (IEC 60050, 112-01-04) hierarchy of q be the tuple -, -where par is parent.
template<QuantitySpec auto A, QuantitySpec auto B> -consteval auto get-common-base(); // exposition only -
Let -
  • be the number of elements in h(A),
  • be the number of elements in h(B),
  • s be ,
  • A be a tuple of the last s elements of h(A), and
  • B be a tuple of the last s elements of h(B).
Effects: Looks for x, the first pair-wise equal element in A and B.
Returns: std​::​optional(x), if x is found, and std​::​optional<unspecified>() otherwise.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.get.kind.html b/HEAD/api_reference/gen/qty.get.kind.html deleted file mode 100644 index 80f5bf44..00000000 --- a/HEAD/api_reference/gen/qty.get.kind.html +++ /dev/null @@ -1,18 +0,0 @@ -[qty.get.kind]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.3 Quantity specification [qty.spec]

5.4.3.6 Hierarchy algorithms [qty.spec.hier.algos]

5.4.3.6.2 Get kind [qty.get.kind]

template<QuantitySpec Q> -consteval QuantitySpec auto get-kind-tree-root(Q q); // exposition only -
Returns:
  • If QuantityKindSpec<Q> is true, -returns remove-kind(q).
  • Otherwise, if -is-derived-from-specialization-of<Q, quantity_spec>() -is true, and -the specialization of Q​::​quantity_spec has a template argument equal to is_kind, -returns q.
  • Otherwise, if Q​::​parent is a valid expression, -returns get-kind-tree-root(Q​::​parent).
  • Otherwise, if DerivedQuantitySpec<Q> is true, -returns -expr-map<to-kind, derived_quantity_spec, struct dimensionless>(q) - -where to-kind is defined as follows: -template<QuantitySpec Q> -using to-kind = decltype(get-kind-tree-root(Q{})); // exposition only -
  • Otherwise, returns q.
template<QuantitySpec Q> -consteval QuantityKindSpec auto get_kind(Q); -
Returns: kind_of<get-kind-tree-root(Q{})>.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.html b/HEAD/api_reference/gen/qty.html deleted file mode 100644 index 898c31c4..00000000 --- a/HEAD/api_reference/gen/qty.html +++ /dev/null @@ -1,708 +0,0 @@ -[qty]

5 Quantities and units library [quantities]

5.6 Quantity [qty]

5.6.1 General [qty.general]

Subclause [qty] describes the class template quantity -that represents the value of a quantity (IEC 60050, 112-01-28) -that is an element of a vector space (IEC 60050, 102-03-01,102-03-04).

5.6.2 Interoperability [qty.like]

The interfaces specified in this subclause and subclause [qty.pt.like] -are used by quantity and quantity_point -to specify conversions with other types representing quantities.
[Note 1: 
[qty.chrono] implements them for std​::​chrono​::​duration and std​::​chrono​::​time_point.
— end note]
template<typename T, template<typename> typename Traits> -concept qty-like-impl = requires(const T& qty, const Traits<T>::rep& num) { // exposition only - { Traits<T>::to_numerical_value(qty) } -> std::same_as<typename Traits<T>::rep>; - { Traits<T>::from_numerical_value(num) } -> std::same_as<T>; - requires std::same_as<decltype(Traits<T>::explicit_import), const bool>; - requires std::same_as<decltype(Traits<T>::explicit_export), const bool>; - typename std::bool_constant<Traits<T>::explicit_import>; - typename std::bool_constant<Traits<T>::explicit_export>; -}; - -template<typename T> -concept QuantityLike = !Quantity<T> && qty-like-impl<T, quantity_like_traits> && requires { - typename quantity<quantity_like_traits<T>::reference, typename quantity_like_traits<T>::rep>; -}; -
In the following descriptions, let -
  • Traits be quantity_like_traits or quantity_point_like_traits,
  • Q be a type for which Traits<Q> is specialized,
  • qty be an lvalue of type const Q, and
  • num be an lvalue of type const Traits<Q>​::​rep.
Q models qty-like-impl<Traits> if and only if: -
  • Traits<Q>​::​to_numerical_value(qty) returns the numerical value (IEC 60050, 112-01-29) of qty.
  • Traits<Q>​::​from_numerical_value(num) returns a Q with numerical value num.
  • If Traits is quantity_point_like_traits, -both numerical values are offset from Traits<Q>​::​point_origin.
If the following expression is true, the specified conversion will be explicit.
  • Traits<Q>​::​explicit_import for the conversion from Q to this library's type.
  • Traits<Q>​::​explicit_export for the conversion from this library's type to Q.

5.6.3 Class template quantity [qty.syn]

namespace mp_units { - -template<typename T> -concept Quantity = (is-derived-from-specialization-of<T, quantity>()); // exposition only - -template<typename Q, auto QS> -concept QuantityOf = // exposition only - Quantity<Q> && QuantitySpecOf<decltype(auto(Q::quantity_spec)), QS>; - -template<Unit UFrom, Unit UTo> -consteval bool integral-conversion-factor(UFrom from, UTo to) // exposition only -{ - return is-integral(get-canonical-unit(from).mag / get-canonical-unit(to).mag); -} - -template<typename T> -concept IsFloatingPoint = treat_as_floating_point<T>; // exposition only - -template<typename FromRep, typename ToRep, auto FromUnit = one, auto ToUnit = one> -concept ValuePreservingTo = // exposition only - Representation<std::remove_cvref_t<FromRep>> && Representation<ToRep> && - Unit<decltype(FromUnit)> && Unit<decltype(ToUnit)> && std::assignable_from<ToRep&, FromRep> && - (IsFloatingPoint<ToRep> || (!IsFloatingPoint<std::remove_cvref_t<FromRep>> && - (integral-conversion-factor(FromUnit, ToUnit)))); - -template<typename QFrom, typename QTo> -concept QuantityConvertibleTo = // exposition only - Quantity<QFrom> && Quantity<QTo> && - QuantitySpecConvertibleTo<QFrom::quantity_spec, QTo::quantity_spec> && - UnitConvertibleTo<QFrom::unit, QTo::unit> && - ValuePreservingTo<typename QFrom::rep, typename QTo::rep, QFrom::unit, QTo::unit> && - requires(QFrom q) { sudo-cast<QTo>(q); }; // see [qty.non.mem.conv] - -template<auto QS, typename Func, typename T, typename U> -concept InvokeResultOf = // exposition only - QuantitySpec<decltype(QS)> && std::regular_invocable<Func, T, U> && - RepresentationOf<std::invoke_result_t<Func, T, U>, QS>; - -template<typename Func, typename Q1, typename Q2, - auto QS = std::invoke_result_t<Func, decltype(auto(Q1::quantity_spec)), - decltype(auto(Q2::quantity_spec))>{}> -concept InvocableQuantities = // exposition only - QuantitySpec<decltype(QS)> && Quantity<Q1> && Quantity<Q2> && - InvokeResultOf<QS, Func, typename Q1::rep, typename Q2::rep>; - -template<auto R1, auto R2> -concept HaveCommonReference = requires { get_common_reference(R1, R2); }; // exposition only - -template<typename Func, Quantity Q1, Quantity Q2> -using common-quantity-for = // exposition only - quantity<get_common_reference(Q1::reference, Q2::reference), - std::invoke_result_t<Func, typename Q1::rep, typename Q2::rep>>; - -template<typename Func, typename Q1, typename Q2> -concept CommonlyInvocableQuantities = // exposition only - Quantity<Q1> && Quantity<Q2> && HaveCommonReference<Q1::reference, Q2::reference> && - std::convertible_to<Q1, common-quantity-for<Func, Q1, Q2>> && - std::convertible_to<Q2, common-quantity-for<Func, Q1, Q2>> && - InvocableQuantities<Func, Q1, Q2, - get_common_quantity_spec(Q1::quantity_spec, Q2::quantity_spec)>; - -template<auto R1, auto R2, typename Rep1, typename Rep2> -concept SameValueAs = // exposition only - (equivalent(get_unit(R1), get_unit(R2))) && std::convertible_to<Rep1, Rep2>; - -template<typename T> -using quantity-like-type = // exposition only - quantity<quantity_like_traits<T>::reference, typename quantity_like_traits<T>::rep>; - -template<typename T, typename U, typename TT = std::remove_reference_t<T>> -concept Mutable = (!std::is_const_v<TT>) && std::derived_from<TT, U>; // exposition only - -template<Reference auto R, RepresentationOf<get_quantity_spec(R)> Rep = double> -class quantity { -public: - Rep numerical-value; // exposition only - - // member types and values - static constexpr Reference auto reference = R; - static constexpr QuantitySpec auto quantity_spec = get_quantity_spec(reference); - static constexpr Dimension auto dimension = quantity_spec.dimension; - static constexpr Unit auto unit = get_unit(reference); - using rep = Rep; - - // [qty.static], static member functions - static constexpr quantity zero() noexcept - requires see below; - static constexpr quantity one() noexcept - requires see below; - static constexpr quantity min() noexcept - requires see below; - static constexpr quantity max() noexcept - requires see below; - - // [qty.cons], constructors and assignment - - quantity() = default; - quantity(const quantity&) = default; - quantity(quantity&&) = default; - ~quantity() = default; - - template<typename FwdValue, Reference R2> - requires SameValueAs<R2{}, R, std::remove_cvref_t<FwdValue>, Rep> - constexpr quantity(FwdValue&& v, R2); - - template<typename FwdValue, Reference R2, typename Value = std::remove_cvref_t<FwdValue>> - requires(!SameValueAs<R2{}, R, Value, Rep>) && - QuantityConvertibleTo<quantity<R2{}, Value>, quantity> - constexpr quantity(FwdValue&& v, R2); - - template<ValuePreservingTo<Rep> FwdValue> - requires(unit == ::mp_units::one) - constexpr quantity(FwdValue&& v); - - template<QuantityConvertibleTo<quantity> Q> - constexpr explicit(see below) quantity(const Q& q); - - template<QuantityLike Q> - requires QuantityConvertibleTo<quantity-like-type<Q>, quantity> - constexpr explicit(see below) quantity(const Q& q); - - quantity& operator=(const quantity&) = default; - quantity& operator=(quantity&&) = default; - - template<ValuePreservingTo<Rep> FwdValue> - requires(unit == ::mp_units::one) - constexpr quantity& operator=(FwdValue&& v); - - // [qty.conv], conversions - - template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires QuantityConvertibleTo<quantity, quantity<make-reference(quantity_spec, ToU{}), Rep>> - constexpr QuantityOf<quantity_spec> auto in(ToU) const; - - template<RepresentationOf<quantity_spec> ToRep> - requires QuantityConvertibleTo<quantity, quantity<reference, ToRep>> - constexpr QuantityOf<quantity_spec> auto in() const; - - template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires QuantityConvertibleTo<quantity, - quantity<make-reference(quantity_spec, ToU{}), ToRep>> - constexpr QuantityOf<quantity_spec> auto in(ToU) const; - - template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires requires(const quantity q) { value_cast<ToU{}>(q); } - constexpr QuantityOf<quantity_spec> auto force_in(ToU) const; - - template<RepresentationOf<quantity_spec> ToRep> - requires requires(const quantity q) { value_cast<ToRep>(q); } - constexpr QuantityOf<quantity_spec> auto force_in() const; - - template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires requires(const quantity q) { value_cast<ToU{}, ToRep>(q); } - constexpr QuantityOf<quantity_spec> auto force_in(ToU) const; - - // [qty.obs], numerical value observers - - template<Unit U> - requires(equivalent(U{}, unit)) - constexpr rep& numerical_value_ref_in(U) & noexcept; - template<Unit U> - requires(equivalent(U{}, unit)) - constexpr const rep& numerical_value_ref_in(U) const & noexcept; - template<Unit U> - requires(equivalent(U{}, unit)) - void numerical_value_ref_in(U) const && = delete; - - template<UnitCompatibleWith<unit, quantity_spec> U> - requires QuantityConvertibleTo<quantity, quantity<make-reference(quantity_spec, U{}), Rep>> - constexpr rep numerical_value_in(U) const noexcept; - - template<UnitCompatibleWith<unit, quantity_spec> U> - requires requires(const quantity q) { value_cast<U{}>(q); } - constexpr rep force_numerical_value_in(U) const noexcept; - - // [qty.conv.ops], conversion operations - - template<typename V_, std::constructible_from<Rep> Value = std::remove_cvref_t<V_>> - requires(unit == ::mp_units::one) - explicit operator V_() const & noexcept; - - template<typename Q_, QuantityLike Q = std::remove_cvref_t<Q_>> - requires QuantityConvertibleTo<quantity, quantity-like-type<Q>> - constexpr explicit(see below) operator Q_() const noexcept(see below); - - // [qty.unary.ops], unary operations - - constexpr QuantityOf<quantity_spec> auto operator+() const - requires see below; - constexpr QuantityOf<quantity_spec> auto operator-() const - requires see below; - - template<Mutable<quantity> Q> - friend constexpr decltype(auto) operator++(Q&& q) - requires see below; - template<Mutable<quantity> Q> - friend constexpr decltype(auto) operator--(Q&& q) - requires see below; - - constexpr QuantityOf<quantity_spec> auto operator++(int) - requires see below; - constexpr QuantityOf<quantity_spec> auto operator--(int) - requires see below; - - // [qty.assign.ops], compound assignment operations - - template<Mutable<quantity> Q, auto R2, typename Rep2> - requires see below - friend constexpr decltype(auto) operator+=(Q&& lhs, const quantity<R2, Rep2>& rhs); - template<Mutable<quantity> Q, auto R2, typename Rep2> - requires see below - friend constexpr decltype(auto) operator-=(Q&& lhs, const quantity<R2, Rep2>& rhs); - template<Mutable<quantity> Q, auto R2, typename Rep2> - requires see below - friend constexpr decltype(auto) operator%=(Q&& lhs, const quantity<R2, Rep2>& rhs); - - template<Mutable<quantity> Q, ValuePreservingTo<Rep> Value> - requires see below - friend constexpr decltype(auto) operator*=(Q&& lhs, const Value& rhs); - template<Mutable<quantity> Q, ValuePreservingTo<Rep> Value> - requires see below - friend constexpr decltype(auto) operator/=(Q&& lhs, const Value& rhs); - - template<Mutable<quantity> Q, QuantityOf<dimensionless> Q2> - requires see below - friend constexpr decltype(auto) operator*=(Q&& lhs, const Q2& rhs); - template<Mutable<quantity> Q, QuantityOf<dimensionless> Q2> - requires see below - friend constexpr decltype(auto) operator/=(Q&& lhs, const Q2& rhs); - - // [qty.arith.ops], arithmetic operations - - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires CommonlyInvocableQuantities<std::plus<>, quantity, quantity<R2, Rep2>> - friend constexpr Quantity auto operator+(const Q& lhs, const quantity<R2, Rep2>& rhs); - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires CommonlyInvocableQuantities<std::minus<>, quantity, quantity<R2, Rep2>> - friend constexpr Quantity auto operator-(const Q& lhs, const quantity<R2, Rep2>& rhs); - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires(!treat_as_floating_point<Rep>) && (!treat_as_floating_point<Rep2>) && - CommonlyInvocableQuantities<std::modulus<>, quantity, quantity<R2, Rep2>> - friend constexpr Quantity auto operator%(const Q& lhs, const quantity<R2, Rep2>& rhs); - - template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::plus<>, Rep, const Value&> - friend constexpr Quantity auto operator+(const Q& lhs, const Value& rhs); - template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::minus<>, Rep, const Value&> - friend constexpr Quantity auto operator-(const Q& lhs, const Value& rhs); - template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::modulus<>, Rep, const Value&> - friend constexpr Quantity auto operator%(const Q& lhs, const Value& rhs); - - template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::plus<>, Rep, const Value&> - friend constexpr Quantity auto operator+(const Value& lhs, const Q& rhs); - template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::minus<>, Rep, const Value&> - friend constexpr Quantity auto operator-(const Value& lhs, const Q& rhs); - template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::modulus<>, Rep, const Value&> - friend constexpr Quantity auto operator%(const Value& lhs, const Q& rhs); - - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires InvocableQuantities<std::multiplies<>, quantity, quantity<R2, Rep2>> - friend constexpr Quantity auto operator*(const Q& lhs, const quantity<R2, Rep2>& rhs); - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires InvocableQuantities<std::divides<>, quantity, quantity<R2, Rep2>> - friend constexpr Quantity auto operator/(const Q& lhs, const quantity<R2, Rep2>& rhs); - - template<std::derived_from<quantity> Q, typename Value> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::multiplies<>, Rep, const Value&> - friend constexpr QuantityOf<quantity_spec> auto operator*(const Q& lhs, const Value& rhs); - template<std::derived_from<quantity> Q, typename Value> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::divides<>, Rep, const Value&> - friend constexpr QuantityOf<quantity_spec> auto operator/(const Q& lhs, const Value& rhs); - - template<typename Value, std::derived_from<quantity> Q> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::multiplies<>, const Value&, Rep> - friend constexpr QuantityOf<quantity_spec> auto operator*(const Value& lhs, const Q& rhs); - template<typename Value, std::derived_from<quantity> Q> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::divides<>, const Value&, Rep> - friend constexpr Quantity auto operator/(const Value&, const Q&); - - // [qty.cmp], comparison - - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires see below - friend constexpr bool operator==(const Q& lhs, const quantity<R2, Rep2>& rhs); - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires see below - friend constexpr auto operator<=>(const Q& lhs, const quantity<R2, Rep2>& rhs); - - template<std::derived_from<quantity> Q, Representation Value> - requires see below - friend constexpr bool operator==(const Q& lhs, const Value& rhs); - template<std::derived_from<quantity> Q, Representation Value> - requires see below - friend constexpr auto operator<=>(const Q& lhs, const Value& rhs); - - // [qty.val.cmp], value comparison - friend constexpr bool is_eq_zero(const quantity& q) requires see below; - friend constexpr bool is_neq_zero(const quantity& q) requires see below; - friend constexpr bool is_lt_zero(const quantity& q) requires see below; - friend constexpr bool is_gt_zero(const quantity& q) requires see below; - friend constexpr bool is_lteq_zero(const quantity& q) requires see below; - friend constexpr bool is_gteq_zero(const quantity& q) requires see below; -}; - -template<Representation Value, Reference R> -quantity(Value, R) -> quantity<R{}, Value>; - -template<Representation Value> -quantity(Value) -> quantity<one, Value>; - -template<QuantityLike Q> -explicit(quantity_like_traits<Q>::explicit_import) quantity(Q) - -> quantity<quantity_like_traits<Q>::reference, typename quantity_like_traits<Q>::rep>; - -} -
quantity<R, Rep> is a structural type (N4971, [temp.param]) -if Rep is a structural type.

5.6.4 Static member functions [qty.static]

static constexpr quantity zero() noexcept - requires see below; -static constexpr quantity one() noexcept - requires see below; -static constexpr quantity min() noexcept - requires see below; -static constexpr quantity max() noexcept - requires see below; -
Let F be one of zero, one, min, and max.
Returns: {representation_values<rep>​::​F(), R}.
Remarks: The expression in the requires-clause is equivalent to: -requires { representation_values<rep>::F(); } -

5.6.5 Constructors and assignment [qty.cons]

template<typename FwdValue, Reference R2> - requires SameValueAs<R2{}, R, std::remove_cvref_t<FwdValue>, Rep> -constexpr quantity(FwdValue&& v, R2); - -template<ValuePreservingTo<Rep> FwdValue> - requires(unit == ::mp_units::one) -constexpr quantity(FwdValue&& v); -
Effects: Initializes numerical-value with std​::​forward<FwdValue>(v).
template<typename FwdValue, Reference R2, typename Value = std::remove_cvref_t<FwdValue>> - requires(!SameValueAs<R2{}, R, Value, Rep>) && - QuantityConvertibleTo<quantity<R2{}, Value>, quantity> -constexpr quantity(FwdValue&& v, R2); -
Effects: Equivalent to -quantity(quantity<R2{}, Value>{std​::​forward<FwdValue>(v), R2{}}).
template<QuantityConvertibleTo<quantity> Q> -constexpr explicit(!std::convertible_to<typename Q::rep, Rep>) quantity(const Q& q); -
Effects: Equivalent to sudo-cast<quantity>(q) ([qty.non.mem.conv]).
template<QuantityLike Q> - requires QuantityConvertibleTo<quantity-like-type<Q>, quantity> -constexpr explicit(see below) quantity(const Q& q); -
Effects: Equivalent to: -quantity(::mp_units::quantity{quantity_like_traits<Q>::to_numerical_value(q), - quantity_like_traits<Q>::reference}) -
Remarks: The expression inside explicit is equivalent to: -quantity_like_traits<Q>::explicit_import || - !std::convertible_to<typename quantity_like_traits<Q>::rep, Rep> -
template<ValuePreservingTo<Rep> FwdValue> - requires(unit == ::mp_units::one) -constexpr quantity& operator=(FwdValue&& v); -
Effects: Equivalent to numerical-value = std​::​forward<FwdValue>(v).
Returns: *this.

5.6.6 Conversions [qty.conv]

template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires QuantityConvertibleTo<quantity, quantity<make-reference(quantity_spec, ToU{}), Rep>> -constexpr QuantityOf<quantity_spec> auto in(ToU) const; -
Effects: Equivalent to: -return quantity<make-reference(quantity_spec, ToU{}), Rep>{*this};
template<RepresentationOf<quantity_spec> ToRep> - requires QuantityConvertibleTo<quantity, quantity<reference, ToRep>> -constexpr QuantityOf<quantity_spec> auto in() const; -
Effects: Equivalent to: -return quantity<reference, ToRep>{*this};
template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires QuantityConvertibleTo<quantity, - quantity<make-reference(quantity_spec, ToU{}), ToRep>> -constexpr QuantityOf<quantity_spec> auto in(ToU) const; -
Effects: Equivalent to: -return quantity<make-reference(quantity_spec, ToU{}), ToRep>{*this}; -
template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires requires(const quantity q) { value_cast<ToU{}>(q); } -constexpr QuantityOf<quantity_spec> auto force_in(ToU) const; -
Effects: Equivalent to: -return value_cast<ToU{}>(*this);
template<RepresentationOf<quantity_spec> ToRep> - requires requires(const quantity q) { value_cast<ToRep>(q); } -constexpr QuantityOf<quantity_spec> auto force_in() const; -
Effects: Equivalent to: -return value_cast<ToRep>(*this);
template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires requires(const quantity q) { value_cast<ToU{}, ToRep>(q); } -constexpr QuantityOf<quantity_spec> auto force_in(ToU) const; -
Effects: Equivalent to: -return value_cast<ToU{}, ToRep>(*this);

5.6.7 Numerical value observers [qty.obs]

template<Unit U> - requires(equivalent(U{}, unit)) -constexpr rep& numerical_value_ref_in(U) & noexcept; -template<Unit U> - requires(equivalent(U{}, unit)) -constexpr const rep& numerical_value_ref_in(U) const & noexcept; -
Returns: numerical-value.
template<UnitCompatibleWith<unit, quantity_spec> U> - requires QuantityConvertibleTo<quantity, quantity<make-reference(quantity_spec, U{}), Rep>> -constexpr rep numerical_value_in(U) const noexcept; -
Effects: Equivalent to: -return (*this).in(U{}).numerical-value;
template<UnitCompatibleWith<unit, quantity_spec> U> - requires requires(const quantity q) { value_cast<U{}>(q); } -constexpr rep force_numerical_value_in(U) const noexcept; -
Effects: Equivalent to: -return (*this).force_in(U{}).numerical-value;

5.6.8 Conversion operations [qty.conv.ops]

template<typename V_, std::constructible_from<Rep> Value = std::remove_cvref_t<V_>> - requires(unit == ::mp_units::one) -explicit operator V_() const & noexcept; -
Returns: numerical-value.
template<typename Q_, QuantityLike Q = std::remove_cvref_t<Q_>> - requires QuantityConvertibleTo<quantity, quantity-like-type<Q>> -constexpr explicit(see below) operator Q_() const noexcept(see below); -
Effects: Equivalent to: -return quantity_like_traits<Q>::from_numerical_value( - numerical_value_in(get_unit(quantity_like_traits<Q>::reference))); -
Remarks: The expression inside explicit is equivalent to: -quantity_like_traits<Q>::explicit_export || - !std::convertible_to<Rep, typename quantity_like_traits<Q>::rep> -
-The exception specification is equivalent to: -noexcept(quantity_like_traits<Q>::from_numerical_value(numerical-value)) && - std::is_nothrow_copy_constructible_v<rep> -

5.6.9 Unary operations [qty.unary.ops]

In the following descriptions, -let @ be the operator.
constexpr QuantityOf<quantity_spec> auto operator+() const - requires see below; -constexpr QuantityOf<quantity_spec> auto operator-() const - requires see below; -
Effects: Equivalent to: -return ​::​mp_units​::​quantity{@numerical-value, reference};
Remarks: The expression in the requires-clause is equivalent to: -requires(const rep v) { - { @v } -> std::common_with<rep>; -} -
template<Mutable<quantity> Q> -friend constexpr decltype(auto) operator++(Q&& q) - requires see below; -template<Mutable<quantity> Q> -friend constexpr decltype(auto) operator--(Q&& q) - requires see below; -
Effects: Equivalent to -@q.numerical-value.
Returns: std​::​forward<Q>(q).
Remarks: The expression in the requires-clause is equivalent to: -requires(rep& v) { - { @v } -> std::same_as<rep&>; -} -
constexpr QuantityOf<quantity_spec> auto operator++(int) - requires see below; -constexpr QuantityOf<quantity_spec> auto operator--(int) - requires see below; -
Effects: Equivalent to: -return ​::​mp_units​::​quantity{numerical-value@, reference};
Remarks: The expression in the requires-clause is equivalent to: -requires(rep& v) { - { v@ } -> std::common_with<rep>; -} -

5.6.10 Compound assignment operations [qty.assign.ops]

In the following descriptions, -let @ be the operator.
template<Mutable<quantity> Q, auto R2, typename Rep2> - requires see below -friend constexpr decltype(auto) operator+=(Q&& lhs, const quantity<R2, Rep2>& rhs); -template<Mutable<quantity> Q, auto R2, typename Rep2> - requires see below -friend constexpr decltype(auto) operator-=(Q&& lhs, const quantity<R2, Rep2>& rhs); -template<Mutable<quantity> Q, auto R2, typename Rep2> - requires see below -friend constexpr decltype(auto) operator%=(Q&& lhs, const quantity<R2, Rep2>& rhs); -
Preconditions: If @ is %=, then is_neq_zero(rhs) is true.
Effects: Equivalent to -lhs.numerical-value @ rhs.in(lhs.unit).numerical-value.
Returns: std​::​forward<Q>(lhs).
Remarks: Let C be -
  • (!treat_as_floating_point<rep>) if @ is %=, and
  • true otherwise.
-The expression in the requires-clause is equivalent to: -QuantityConvertibleTo<quantity<R2, Rep2>, quantity> && C && -requires(rep& a, const Rep2 b) { - { a @ b } -> std::same_as<rep&>; -} -
Recommended practice: If equivalent(unit, get_unit(rhs.reference)) is true, -then the expression rhs.in(lhs.unit) is replaced with rhs.
template<Mutable<quantity> Q, ValuePreservingTo<Rep> Value> - requires see below -friend constexpr decltype(auto) operator*=(Q&& lhs, const Value& rhs); -template<Mutable<quantity> Q, ValuePreservingTo<Rep> Value> - requires see below -friend constexpr decltype(auto) operator/=(Q&& lhs, const Value& rhs); -
Preconditions: If @ is /=, then rhs != representation_values<Value>​::​zero() is true.
Effects: Equivalent to -lhs.numerical-value @ rhs.
Returns: std​::​forward<Q>(lhs).
Remarks: The expression in the requires-clause is equivalent to: -(!Quantity<Value>) && requires(rep& a, const Value b) { - { a @ b } -> std::same_as<rep&>; -} -
template<Mutable<quantity> Q, QuantityOf<dimensionless> Q2> - requires see below -friend constexpr decltype(auto) operator*=(Q&& lhs, const Q2& rhs); -template<Mutable<quantity> Q, QuantityOf<dimensionless> Q2> - requires see below -friend constexpr decltype(auto) operator/=(Q&& lhs, const Q2& rhs); -
Effects: Equivalent to: -return std​::​forward<Q>(lhs) @ rhs.numerical-value;
Remarks: The expression in the requires-clause is equivalent to: -(Q2::unit == ::mp_units::one) && ValuePreservingTo<typename Q2::rep, Rep> && -requires(rep& a, const Q2::rep b) { - { a @ b } -> std::same_as<rep&>; -} -

5.6.11 Arithmetic operations [qty.arith.ops]

In the following descriptions, -let @ be the operator.
template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires CommonlyInvocableQuantities<std::plus<>, quantity, quantity<R2, Rep2>> -friend constexpr Quantity auto operator+(const Q& lhs, const quantity<R2, Rep2>& rhs); -template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires CommonlyInvocableQuantities<std::minus<>, quantity, quantity<R2, Rep2>> -friend constexpr Quantity auto operator-(const Q& lhs, const quantity<R2, Rep2>& rhs); -template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires(!treat_as_floating_point<Rep>) && (!treat_as_floating_point<Rep2>) && - CommonlyInvocableQuantities<std::modulus<>, quantity, quantity<R2, Rep2>> -friend constexpr Quantity auto operator%(const Q& lhs, const quantity<R2, Rep2>& rhs); -
Let F be the first argument to CommonlyInvocableQuantities.
Preconditions: If @ is %, then is_neq_zero(rhs) is true.
Effects: Equivalent to: -using ret = common-quantity-for<F, quantity, quantity<R2, Rep2>>; -const ret ret_lhs(lhs); -const ret ret_rhs(rhs); -return ::mp_units::quantity{ - ret_lhs.numerical_value_ref_in(ret::unit) @ ret_rhs.numerical_value_ref_in(ret::unit), - ret::reference}; -
template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::plus<>, Rep, const Value&> -friend constexpr Quantity auto operator+(const Q& lhs, const Value& rhs); -template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::minus<>, Rep, const Value&> -friend constexpr Quantity auto operator-(const Q& lhs, const Value& rhs); -template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::modulus<>, Rep, const Value&> -friend constexpr Quantity auto operator%(const Q& lhs, const Value& rhs); -
Effects: Equivalent to: -return lhs @ ​::​mp_units​::​quantity{rhs};
template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::plus<>, Rep, const Value&> -friend constexpr Quantity auto operator+(const Value& lhs, const Q& rhs); -template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::minus<>, Rep, const Value&> -friend constexpr Quantity auto operator-(const Value& lhs, const Q& rhs); -template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::modulus<>, Rep, const Value&> -friend constexpr Quantity auto operator%(const Value& lhs, const Q& rhs); -
Effects: Equivalent to: -return ​::​mp_units​::​quantity{lhs} @ rhs;
template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires InvocableQuantities<std::multiplies<>, quantity, quantity<R2, Rep2>> -friend constexpr Quantity auto operator*(const Q& lhs, const quantity<R2, Rep2>& rhs); -template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires InvocableQuantities<std::divides<>, quantity, quantity<R2, Rep2>> -friend constexpr Quantity auto operator/(const Q& lhs, const quantity<R2, Rep2>& rhs); -
Preconditions: If @ is /, then is_neq_zero(rhs) is true.
Effects: Equivalent to: -return ::mp_units::quantity{ - lhs.numerical_value_ref_in(unit) @ rhs.numerical_value_ref_in(rhs.unit), R @ R2}; -
template<std::derived_from<quantity> Q, typename Value> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::multiplies<>, Rep, const Value&> -friend constexpr QuantityOf<quantity_spec> auto operator*(const Q& lhs, const Value& rhs); -template<std::derived_from<quantity> Q, typename Value> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::divides<>, Rep, const Value&> -friend constexpr QuantityOf<quantity_spec> auto operator/(const Q& lhs, const Value& rhs); -
Preconditions: If @ is /, then rhs != representation_values<Value>​::​zero() is true.
Effects: Equivalent to: -return ::mp_units::quantity{lhs.numerical_value_ref_in(unit) @ rhs, R}; -
template<typename Value, std::derived_from<quantity> Q> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::multiplies<>, const Value&, Rep> -friend constexpr QuantityOf<quantity_spec> auto operator*(const Value& lhs, const Q& rhs); -template<typename Value, std::derived_from<quantity> Q> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::divides<>, const Value&, Rep> -friend constexpr Quantity auto operator/(const Value& lhs, const Q& rhs); -
Preconditions: If @ is /, then is_neq_zero(rhs) is true.
Effects: Equivalent to: -return ::mp_units::quantity{lhs @ rhs.numerical_value_ref_in(unit), ::mp_units::one @ R}; -

5.6.12 Comparison [qty.cmp]

In the following descriptions, -let @ be the operator.
template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires see below -friend constexpr bool operator==(const Q& lhs, const quantity<R2, Rep2>& rhs); -template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires see below -friend constexpr auto operator<=>(const Q& lhs, const quantity<R2, Rep2>& rhs); -
Let C be -std​::​equality_comparable if @ is ==, and -std​::​three_way_comparable if @ is <=>.
Effects: Equivalent to: -using ct = std::common_type_t<quantity, quantity<R2, Rep2>>; -const ct ct_lhs(lhs); -const ct ct_rhs(rhs); -return ct_lhs.numerical_value_ref_in(ct::unit) @ ct_rhs.numerical_value_ref_in(ct::unit); -
Remarks: The expression in the requires-clause is equivalent to: -requires { - typename std::common_type_t<quantity, quantity<R2, Rep2>>; -} && C<typename std::common_type_t<quantity, quantity<R2, Rep2>>::rep> -
template<std::derived_from<quantity> Q, Representation Value> - requires see below -friend constexpr bool operator==(const Q& lhs, const Value& rhs); -template<std::derived_from<quantity> Q, Representation Value> - requires see below -friend constexpr auto operator<=>(const Q& lhs, const Value& rhs); -
Let C be -std​::​equality_comparable_with if @ is ==, and -std​::​three_way_comparable_with if @ is <=>.
Returns: lhs.numerical_value_ref_in(unit) @ rhs.
Remarks: The expression in the requires-clause is equivalent to: -(Q::unit == ::mp_units::one) && C<Rep, Value> -

5.6.13 Value comparison [qty.val.cmp]

friend constexpr bool is_eq_zero(const quantity& q) requires see below; -friend constexpr bool is_neq_zero(const quantity& q) requires see below; -friend constexpr bool is_lt_zero(const quantity& q) requires see below; -friend constexpr bool is_gt_zero(const quantity& q) requires see below; -friend constexpr bool is_lteq_zero(const quantity& q) requires see below; -friend constexpr bool is_gteq_zero(const quantity& q) requires see below; -
Let is_F_zero be the function name.
Returns:
Remarks: Let C be -std​::​equality_comparable_with if F is eq or neq, and -std​::​three_way_comparable_with otherwise.
The expression in the requires-clause is equivalent to: -requires { - { T::zero() } -> C<quantity>; -} -

5.6.14 Construction helper delta [qty.delta]

namespace mp_units { - -template<Reference R> -struct delta_ { - template<typename FwdRep, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> - constexpr quantity<R{}, Rep> operator()(FwdRep&& lhs) const; -}; - -} -
template<typename FwdRep, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> -constexpr quantity<R{}, Rep> operator()(FwdRep&& lhs) const; -
Effects: Equivalent to: -return quantity{std​::​forward<FwdRep>(lhs), R{}};

5.6.15 Non-member conversions [qty.non.mem.conv]

template<Quantity To, typename FwdFrom, Quantity From = std::remove_cvref_t<FwdFrom>> - requires see below -constexpr To sudo-cast(FwdFrom&& q); // exposition only -
Returns: TBD.
value_cast is an explicit cast that allows truncation.
template<Unit auto ToU, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>> - requires(convertible(Q::reference, ToU)) -constexpr Quantity auto value_cast(FwdQ&& q); -
Effects: Equivalent to: -return sudo-cast<quantity<make-reference(Q::quantity_spec, ToU), typename Q::rep>>( - std::forward<FwdQ>(q)); -
template<Representation ToRep, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>> - requires RepresentationOf<ToRep, Q::quantity_spec> && - std::constructible_from<ToRep, typename Q::rep> -constexpr quantity<Q::reference, ToRep> value_cast(FwdQ&& q); -
Effects: Equivalent to: -return sudo-cast<quantity<Q::reference, ToRep>>(std::forward<FwdQ>(q)); -
template<Unit auto ToU, Representation ToRep, typename FwdQ, - Quantity Q = std::remove_cvref_t<FwdQ>> - requires see below -constexpr Quantity auto value_cast(FwdQ&& q); -template<Representation ToRep, Unit auto ToU, typename FwdQ, - Quantity Q = std::remove_cvref_t<FwdQ>> - requires see below -constexpr Quantity auto value_cast(FwdQ&& q); -
Effects: Equivalent to: -return sudo-cast<quantity<make-reference(Q::quantity_spec, ToU), ToRep>>( - std::forward<FwdQ>(q)); -
Remarks: The expression in the requires-clause is equivalent to: -(convertible(Q::reference, ToU)) && RepresentationOf<ToRep, Q::quantity_spec> && -std::constructible_from<ToRep, typename Q::rep> -
template<Quantity ToQ, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>> - requires(convertible(Q::reference, ToQ::unit)) && (ToQ::quantity_spec == Q::quantity_spec) && - std::constructible_from<typename ToQ::rep, typename Q::rep> -constexpr Quantity auto value_cast(FwdQ&& q); -
Effects: Equivalent to: return sudo-cast<ToQ>(std​::​forward<FwdQ>(q));
quantity_cast is an explicit cast that allows converting to more specific quantities.
[Example 1: auto length = isq::length(42 * m); -auto distance = quantity_cast<isq::distance>(length); - — end example]
template<QuantitySpec auto ToQS, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>> - requires QuantitySpecCastableTo<Q::quantity_spec, ToQS> -constexpr Quantity auto quantity_cast(FwdQ&& q); -
Effects: Equivalent to: -return quantity{std::forward<FwdQ>(q).numerical-value, make-reference(ToQS, Q::unit)}; -

5.6.16 std​::​common_type specializations [qty.common.type]

template<mp_units::Quantity Q1, mp_units::Quantity Q2> - requires requires { - { mp_units::get_common_reference(Q1::reference, Q2::reference) } -> mp_units::Reference; - typename std::common_type_t<typename Q1::rep, typename Q2::rep>; - requires mp_units::RepresentationOf<std::common_type_t<typename Q1::rep, typename Q2::rep>, - mp_units::get_common_quantity_spec(Q1::quantity_spec, - Q2::quantity_spec)>; - } -struct std::common_type<Q1, Q2> { - using type = mp_units::quantity<mp_units::get_common_reference(Q1::reference, Q2::reference), - std::common_type_t<typename Q1::rep, typename Q2::rep>>; -}; - -template<mp_units::Quantity Q, mp_units::Representation Value> - requires(Q::unit == mp_units::one) && requires { - typename mp_units::quantity<Q::reference, std::common_type_t<typename Q::rep, Value>>; - } -struct std::common_type<Q, Value> { - using type = mp_units::quantity<Q::reference, std::common_type_t<typename Q::rep, Value>>; -}; -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.imag.cpo.html b/HEAD/api_reference/gen/qty.imag.cpo.html deleted file mode 100644 index c4986182..00000000 --- a/HEAD/api_reference/gen/qty.imag.cpo.html +++ /dev/null @@ -1,8 +0,0 @@ -[qty.imag.cpo]

5 Quantities and units library [quantities]

5.5 Representation [qty.rep]

5.5.3 Customization point objects [qty.rep.cpos]

5.5.3.3 mp_units​::​imag [qty.imag.cpo]

The name mp_units​::​imag denotes a customization point object (N4971, [customization.point.object]).
Given a subexpression E with type T, -let t be an lvalue that denotes the reified object for E.
Then: -
  • If T does not model WeaklyRegular, -mp_units​::​imag(E) is ill-formed.
  • If auto(t.imag()) is a valid expression whose type models Scalar, -mp_units​::​imag(E) is expression-equivalent to auto(t.imag()).
  • Otherwise, if T is a class or enumeration type and -auto(imag(t)) is a valid expression whose type models Scalar -where the meaning of imag is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​imag(E) is expression-equivalent to that expression.
  • Otherwise, mp_units​::​imag(E) is ill-formed.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.is.child.of.html b/HEAD/api_reference/gen/qty.is.child.of.html deleted file mode 100644 index 464a6c1c..00000000 --- a/HEAD/api_reference/gen/qty.is.child.of.html +++ /dev/null @@ -1,4 +0,0 @@ -[qty.is.child.of]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.3 Quantity specification [qty.spec]

5.4.3.6 Hierarchy algorithms [qty.spec.hier.algos]

5.4.3.6.5 Is child of [qty.is.child.of]

template<QuantitySpec Child, QuantitySpec Parent> -consteval bool is-child-of(Child ch, Parent p); // exposition only -
Returns: If h(p) has more elements than h(ch), returns false.
Otherwise, let C be a tuple of the last s elements of h(ch), -where s is the number of elements in h(p).
Returns == p.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.like.html b/HEAD/api_reference/gen/qty.like.html deleted file mode 100644 index ff382725..00000000 --- a/HEAD/api_reference/gen/qty.like.html +++ /dev/null @@ -1,20 +0,0 @@ -[qty.like]

5 Quantities and units library [quantities]

5.6 Quantity [qty]

5.6.2 Interoperability [qty.like]

The interfaces specified in this subclause and subclause [qty.pt.like] -are used by quantity and quantity_point -to specify conversions with other types representing quantities.
[Note 1: 
[qty.chrono] implements them for std​::​chrono​::​duration and std​::​chrono​::​time_point.
— end note]
template<typename T, template<typename> typename Traits> -concept qty-like-impl = requires(const T& qty, const Traits<T>::rep& num) { // exposition only - { Traits<T>::to_numerical_value(qty) } -> std::same_as<typename Traits<T>::rep>; - { Traits<T>::from_numerical_value(num) } -> std::same_as<T>; - requires std::same_as<decltype(Traits<T>::explicit_import), const bool>; - requires std::same_as<decltype(Traits<T>::explicit_export), const bool>; - typename std::bool_constant<Traits<T>::explicit_import>; - typename std::bool_constant<Traits<T>::explicit_export>; -}; - -template<typename T> -concept QuantityLike = !Quantity<T> && qty-like-impl<T, quantity_like_traits> && requires { - typename quantity<quantity_like_traits<T>::reference, typename quantity_like_traits<T>::rep>; -}; -
In the following descriptions, let -
  • Traits be quantity_like_traits or quantity_point_like_traits,
  • Q be a type for which Traits<Q> is specialized,
  • qty be an lvalue of type const Q, and
  • num be an lvalue of type const Traits<Q>​::​rep.
Q models qty-like-impl<Traits> if and only if: -
  • Traits<Q>​::​to_numerical_value(qty) returns the numerical value (IEC 60050, 112-01-29) of qty.
  • Traits<Q>​::​from_numerical_value(num) returns a Q with numerical value num.
  • If Traits is quantity_point_like_traits, -both numerical values are offset from Traits<Q>​::​point_origin.
If the following expression is true, the specified conversion will be explicit.
  • Traits<Q>​::​explicit_import for the conversion from Q to this library's type.
  • Traits<Q>​::​explicit_export for the conversion from this library's type to Q.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.mag.cpo.html b/HEAD/api_reference/gen/qty.mag.cpo.html deleted file mode 100644 index ec51a94f..00000000 --- a/HEAD/api_reference/gen/qty.mag.cpo.html +++ /dev/null @@ -1,12 +0,0 @@ -[qty.mag.cpo]

5 Quantities and units library [quantities]

5.5 Representation [qty.rep]

5.5.3 Customization point objects [qty.rep.cpos]

5.5.3.5 mp_units​::​magnitude [qty.mag.cpo]

The name mp_units​::​magnitude denotes a customization point object (N4971, [customization.point.object]).
Given a subexpression E with type T, -let t be an lvalue that denotes the reified object for E.
Then: -
  • If T does not model WeaklyRegular, -mp_units​::​magnitude(E) is ill-formed.
  • If auto(t.magnitude()) is a valid expression whose type models Scalar, -mp_units​::​magnitude(E) is expression-equivalent to auto(t.magnitude()).
  • Otherwise, if T is a class or enumeration type and -auto(magnitude(t)) is a valid expression whose type models Scalar -where the meaning of magnitude is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​magnitude(E) is expression-equivalent to that expression.
  • Otherwise, if auto(t.abs()) is a valid expression whose type models Scalar, -mp_units​::​magnitude(​E) is expression-equivalent to auto(t.abs()).
  • Otherwise, if T is a class or enumeration type and -auto(abs(t)) is a valid expression whose type models Scalar -where the meaning of magnitude is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​magnitude(E) is expression-equivalent to that expression.
  • Otherwise, mp_units​::​magnitude(E) is ill-formed.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.modulus.cpo.html b/HEAD/api_reference/gen/qty.modulus.cpo.html deleted file mode 100644 index dc166ceb..00000000 --- a/HEAD/api_reference/gen/qty.modulus.cpo.html +++ /dev/null @@ -1,12 +0,0 @@ -[qty.modulus.cpo]

5 Quantities and units library [quantities]

5.5 Representation [qty.rep]

5.5.3 Customization point objects [qty.rep.cpos]

5.5.3.4 mp_units​::​modulus [qty.modulus.cpo]

The name mp_units​::​modulus denotes a customization point object (N4971, [customization.point.object]).
Given a subexpression E with type T, -let t be an lvalue that denotes the reified object for E.
Then: -
  • If T does not model WeaklyRegular, -mp_units​::​modulus(E) is ill-formed.
  • If auto(t.modulus()) is a valid expression whose type models Scalar, -mp_units​::​modulus(E) is expression-equivalent to auto(t.modulus()).
  • Otherwise, if T is a class or enumeration type and -auto(modulus(t)) is a valid expression whose type models Scalar -where the meaning of modulus is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​modulus(E) is expression-equivalent to that expression.
  • If auto(t.abs()) is a valid expression whose type models Scalar, -mp_units​::​modulus(E) is expression-equivalent to auto(t.abs()).
  • Otherwise, if T is a class or enumeration type and -auto(abs(t)) is a valid expression whose type models Scalar -where the meaning of abs is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​modulus(E) is expression-equivalent to that expression.
  • Otherwise, mp_units​::​modulus(E) is ill-formed.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.named.unit.html b/HEAD/api_reference/gen/qty.named.unit.html deleted file mode 100644 index 4a5e82bf..00000000 --- a/HEAD/api_reference/gen/qty.named.unit.html +++ /dev/null @@ -1,81 +0,0 @@ -[qty.named.unit]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.4 Unit [qty.unit]

5.4.4.5 Types [qty.unit.types]

5.4.4.5.3 Named [qty.named.unit]

namespace mp_units { - -template<symbol_text Symbol, QuantityKindSpec auto QS> - requires(!Symbol.empty()) && BaseDimension<decltype(auto(QS.dimension))> -struct named_unit<Symbol, QS> : unit-interface { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto quantity-spec = QS; // exposition only -}; - -template<symbol_text Symbol, QuantityKindSpec auto QS, PointOrigin auto PO> - requires(!Symbol.empty()) && BaseDimension<decltype(auto(QS.dimension))> -struct named_unit<Symbol, QS, PO> : unit-interface { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto quantity-spec = QS; // exposition only - static constexpr auto point-origin = PO; // exposition only -}; - -template<symbol_text Symbol> - requires(!Symbol.empty()) -struct named_unit<Symbol> : unit-interface { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only -}; - -template<symbol_text Symbol, Unit auto U> - requires(!Symbol.empty()) -struct named_unit<Symbol, U> : decltype(U)::base-type { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only -}; - -template<symbol_text Symbol, Unit auto U, PointOrigin auto PO> - requires(!Symbol.empty()) -struct named_unit<Symbol, U, PO> : decltype(U)::base-type { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto point-origin = PO; // exposition only -}; - -template<symbol_text Symbol, AssociatedUnit auto U, QuantityKindSpec auto QS> - requires(!Symbol.empty()) && (QS.dimension == get-associated-quantity(U).dimension) -struct named_unit<Symbol, U, QS> : decltype(U)::base-type { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto quantity-spec = QS; // exposition only -}; - -template<symbol_text Symbol, AssociatedUnit auto U, QuantityKindSpec auto QS, - PointOrigin auto PO> - requires(!Symbol.empty()) && (QS.dimension == get-associated-quantity(U).dimension) -struct named_unit<Symbol, U, QS, PO> : decltype(U)::base-type { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto quantity-spec = QS; // exposition only - static constexpr auto point-origin = PO; // exposition only -}; - -} -
A named unit is a type that models PrefixableUnit.
A specialization of named_unit is used as a base type when defining a named unit.
In the following descriptions, let U be a named unit defined with an alluded signature.
The identifier of U represents -its unit name (IEC 60050, 112-01-15) -or special unit name (IEC 60050, 112-01-16).
Symbol is its unit symbol (IEC 60050, 112-01-17).
The possible arguments to named_unit are -
  • ,
  • ,
  • , and
  • .
The first signature defines the unit of a base quantity -without a unit prefix (IEC 60050, 112-01-26).
The second signature defines a unit -that can be reused by several base quantities.
The third and fourth signatures with a unit expression argument E -define U as implicitly convertible from E.
The first and fourth signatures with a kind of quantity (IEC 60050, 112-01-04) Q -also restrict U to Q.
A point origin argument specifies the default point origin of U ([qty.pt.syn]).
[Example 1: // The first signature defines a base unit restricted to a kind of base quantity. -inline constexpr struct second final : named_unit<"s", kind_of<time>> { -} second; - -// The third and fourth signatures give a name to the unit argument. -inline constexpr struct minute final : named_unit<"min", mag<60> * second> { -} minute; // . - -// The fourth signature also further restricts the kind of quantity. -inline constexpr struct hertz final : named_unit<"Hz", inverse(second), kind_of<frequency>> { -} hertz; // Hz can't measure becquerel, activity, - // or any other quantity with dimension - // that isn't a kind of frequency. - — end example]
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.non.mem.conv.html b/HEAD/api_reference/gen/qty.non.mem.conv.html deleted file mode 100644 index e7e5403a..00000000 --- a/HEAD/api_reference/gen/qty.non.mem.conv.html +++ /dev/null @@ -1,41 +0,0 @@ -[qty.non.mem.conv]

5 Quantities and units library [quantities]

5.6 Quantity [qty]

5.6.15 Non-member conversions [qty.non.mem.conv]

template<Quantity To, typename FwdFrom, Quantity From = std::remove_cvref_t<FwdFrom>> - requires see below -constexpr To sudo-cast(FwdFrom&& q); // exposition only -
Returns: TBD.
value_cast is an explicit cast that allows truncation.
template<Unit auto ToU, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>> - requires(convertible(Q::reference, ToU)) -constexpr Quantity auto value_cast(FwdQ&& q); -
Effects: Equivalent to: -return sudo-cast<quantity<make-reference(Q::quantity_spec, ToU), typename Q::rep>>( - std::forward<FwdQ>(q)); -
template<Representation ToRep, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>> - requires RepresentationOf<ToRep, Q::quantity_spec> && - std::constructible_from<ToRep, typename Q::rep> -constexpr quantity<Q::reference, ToRep> value_cast(FwdQ&& q); -
Effects: Equivalent to: -return sudo-cast<quantity<Q::reference, ToRep>>(std::forward<FwdQ>(q)); -
template<Unit auto ToU, Representation ToRep, typename FwdQ, - Quantity Q = std::remove_cvref_t<FwdQ>> - requires see below -constexpr Quantity auto value_cast(FwdQ&& q); -template<Representation ToRep, Unit auto ToU, typename FwdQ, - Quantity Q = std::remove_cvref_t<FwdQ>> - requires see below -constexpr Quantity auto value_cast(FwdQ&& q); -
Effects: Equivalent to: -return sudo-cast<quantity<make-reference(Q::quantity_spec, ToU), ToRep>>( - std::forward<FwdQ>(q)); -
Remarks: The expression in the requires-clause is equivalent to: -(convertible(Q::reference, ToU)) && RepresentationOf<ToRep, Q::quantity_spec> && -std::constructible_from<ToRep, typename Q::rep> -
template<Quantity ToQ, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>> - requires(convertible(Q::reference, ToQ::unit)) && (ToQ::quantity_spec == Q::quantity_spec) && - std::constructible_from<typename ToQ::rep, typename Q::rep> -constexpr Quantity auto value_cast(FwdQ&& q); -
Effects: Equivalent to: return sudo-cast<ToQ>(std​::​forward<FwdQ>(q));
quantity_cast is an explicit cast that allows converting to more specific quantities.
[Example 1: auto length = isq::length(42 * m); -auto distance = quantity_cast<isq::distance>(length); - — end example]
template<QuantitySpec auto ToQS, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>> - requires QuantitySpecCastableTo<Q::quantity_spec, ToQS> -constexpr Quantity auto quantity_cast(FwdQ&& q); -
Effects: Equivalent to: -return quantity{std::forward<FwdQ>(q).numerical-value, make-reference(ToQS, Q::unit)}; -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.obs.html b/HEAD/api_reference/gen/qty.obs.html deleted file mode 100644 index 03b26ccc..00000000 --- a/HEAD/api_reference/gen/qty.obs.html +++ /dev/null @@ -1,15 +0,0 @@ -[qty.obs]

5 Quantities and units library [quantities]

5.6 Quantity [qty]

5.6.7 Numerical value observers [qty.obs]

template<Unit U> - requires(equivalent(U{}, unit)) -constexpr rep& numerical_value_ref_in(U) & noexcept; -template<Unit U> - requires(equivalent(U{}, unit)) -constexpr const rep& numerical_value_ref_in(U) const & noexcept; -
Returns: numerical-value.
template<UnitCompatibleWith<unit, quantity_spec> U> - requires QuantityConvertibleTo<quantity, quantity<make-reference(quantity_spec, U{}), Rep>> -constexpr rep numerical_value_in(U) const noexcept; -
Effects: Equivalent to: -return (*this).in(U{}).numerical-value;
template<UnitCompatibleWith<unit, quantity_spec> U> - requires requires(const quantity q) { value_cast<U{}>(q); } -constexpr rep force_numerical_value_in(U) const noexcept; -
Effects: Equivalent to: -return (*this).force_in(U{}).numerical-value;
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.point.html b/HEAD/api_reference/gen/qty.point.html deleted file mode 100644 index 847828fc..00000000 --- a/HEAD/api_reference/gen/qty.point.html +++ /dev/null @@ -1,15 +0,0 @@ -[qty.point]

5 Quantities and units library [quantities]

5.7 Quantity point [qty.pt]

5.7.14 Construction helper point [qty.point]

namespace mp_units { - -template<Reference R> -struct point_ { - template<typename FwdRep, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> - constexpr quantity_point<R{}, default_point_origin(R{}), Rep> operator()(FwdRep&& lhs) const; -}; - -} -
template<typename FwdRep, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> -constexpr quantity_point<R{}, default_point_origin(R{}), Rep> operator()(FwdRep&& lhs) const; -
Effects: Equivalent to: -return quantity_point{quantity{std​::​forward<FwdRep>(lhs), R{}}};
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.prefixed.unit.html b/HEAD/api_reference/gen/qty.prefixed.unit.html deleted file mode 100644 index dc2e114e..00000000 --- a/HEAD/api_reference/gen/qty.prefixed.unit.html +++ /dev/null @@ -1,18 +0,0 @@ -[qty.prefixed.unit]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.4 Unit [qty.unit]

5.4.4.5 Types [qty.unit.types]

5.4.4.5.4 Prefixed [qty.prefixed.unit]

namespace mp_units { - -template<symbol_text Symbol, UnitMagnitude auto M, PrefixableUnit auto U> - requires(!Symbol.empty()) -struct prefixed_unit : decltype(M * U)::base-type { - using base-type = prefixed_unit; // exposition only - static constexpr auto symbol = Symbol + U.symbol; // exposition only -}; - -} -
prefixed_unit<Symbol, M, U> represents the unit U with a unit prefix (IEC 60050, 112-01-26).
Symbol is the symbol of the unit prefix.
M is the factor of the unit prefix.
A specialization of prefixed_unit is used as a base type when defining a unit prefix.
[Example 1: template<PrefixableUnit auto U> -struct kilo_ : prefixed_unit<"k", mag_power<10, 3>, U> {}; - -template<PrefixableUnit auto U> -constexpr kilo_<U> kilo; - -inline constexpr auto kilogram = kilo<si::gram>; - — end example]
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.pt.arith.ops.html b/HEAD/api_reference/gen/qty.pt.arith.ops.html deleted file mode 100644 index 77f4e5e7..00000000 --- a/HEAD/api_reference/gen/qty.pt.arith.ops.html +++ /dev/null @@ -1,51 +0,0 @@ -[qty.pt.arith.ops]

5 Quantities and units library [quantities]

5.7 Quantity point [qty.pt]

5.7.12 Arithmetic operations [qty.pt.arith.ops]

In the following descriptions, -let @ be the operator.
template<std::derived_from<quantity_point> QP, auto R2, typename Rep2> -friend constexpr QuantityPoint auto operator+(const QP& qp, const quantity<R2, Rep2>& q) - requires see below; -template<std::derived_from<quantity_point> QP, auto R2, typename Rep2> -friend constexpr QuantityPoint auto operator+(const quantity<R2, Rep2>& q, const QP& qp) - requires see below; -template<std::derived_from<quantity_point> QP, auto R2, typename Rep2> -friend constexpr QuantityPoint auto operator-(const QP& qp, const quantity<R2, Rep2>& q) - requires see below; -
Effects: Equivalent to: -if constexpr (is-specialization-of<PO, zeroth_point_origin>()) - return ::mp_units::quantity_point{qp.quantity_ref_from(PO) @ q}; -else - return ::mp_units::quantity_point{qp.quantity_ref_from(PO) @ q, PO}; -
Remarks: The expression in the requires-clause is equivalent to: -ReferenceOf<decltype(R2), PO.quantity-spec> && requires { - qp.quantity_ref_from(PO) @ q; -} -
template<std::derived_from<quantity_point> QP, QuantityPointOf<absolute_point_origin> QP2> -friend constexpr Quantity auto operator-(const QP& lhs, const QP2& rhs) - requires see below; -
Effects: Equivalent to: -return lhs.quantity_ref_from(point_origin) - rhs.quantity_ref_from(QP2::point_origin) + - (lhs.point_origin - rhs.point_origin); -
Remarks: The expression in the requires-clause is equivalent to: -requires { lhs.quantity_ref_from(point_origin) - rhs.quantity_ref_from(QP2::point_origin); } -
Recommended practice: The subtraction of two equal origins is not evaluated.
template<std::derived_from<quantity_point> QP, PointOrigin PO2> - requires see below -friend constexpr Quantity auto operator-(const QP& qp, PO2 po); -template<std::derived_from<quantity_point> QP, PointOrigin PO2> - requires see below -friend constexpr Quantity auto operator-(PO2 po, const QP& qp); -
Effects: For the first signature, -equivalent to: -if constexpr (point_origin == po) - return qp.quantity_ref_from(point_origin); -else if constexpr (is-derived-from-specialization-of<PO2, - ::mp_units::absolute_point_origin>()) { - return qp.quantity_ref_from(point_origin) + (qp.point_origin - qp.absolute_point_origin); -} else { - return qp.quantity_ref_from(point_origin) - - po.quantity-point.quantity_ref_from(po.quantity-point.point_origin) + - (qp.point_origin - po.quantity-point.point_origin); -} -
-For the second signature, -equivalent to: return -(qp - po);
Remarks: The expression in the requires-clause is equivalent to: -QuantityPointOf<quantity_point, PO2{}> && - ReferenceOf<decltype(auto(reference)), PO2::quantity-spec> -
Recommended practice: The subtraction of two equal origins is not evaluated.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.pt.assign.ops.html b/HEAD/api_reference/gen/qty.pt.assign.ops.html deleted file mode 100644 index bd3286b2..00000000 --- a/HEAD/api_reference/gen/qty.pt.assign.ops.html +++ /dev/null @@ -1,11 +0,0 @@ -[qty.pt.assign.ops]

5 Quantities and units library [quantities]

5.7 Quantity point [qty.pt]

5.7.11 Compound assignment operations [qty.pt.assign.ops]

template<Mutable<quantity_point> QP, auto R2, typename Rep2> - requires see below -friend constexpr decltype(auto) operator+=(QP&& qp, const quantity<R2, Rep2>& q); -template<Mutable<quantity_point> QP, auto R2, typename Rep2> - requires see below -friend constexpr decltype(auto) operator-=(QP&& qp, const quantity<R2, Rep2>& q); -
Let @ be the operator.
Effects: Equivalent to -qp.quantity-from-origin @ q.
Returns: std​::​forward<QP>(qp).
Remarks: The expression in the requires-clause is equivalent to: -QuantityConvertibleTo<quantity<R2, Rep2>, quantity_type> && - requires { qp.quantity-from-origin @ q; } -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.pt.cmp.html b/HEAD/api_reference/gen/qty.pt.cmp.html deleted file mode 100644 index 215296a1..00000000 --- a/HEAD/api_reference/gen/qty.pt.cmp.html +++ /dev/null @@ -1,16 +0,0 @@ -[qty.pt.cmp]

5 Quantities and units library [quantities]

5.7 Quantity point [qty.pt]

5.7.13 Comparison [qty.pt.cmp]

template<std::derived_from<quantity_point> QP, QuantityPointOf<absolute_point_origin> QP2> - requires see below -friend constexpr bool operator==(const QP& lhs, const QP2& rhs); -template<std::derived_from<quantity_point> QP, QuantityPointOf<absolute_point_origin> QP2> - requires see below -friend constexpr auto operator<=>(const QP& lhs, const QP2& rhs); -
Let @ be the operator, and -let C be -std​::​equality_comparable_with if @ is ==, and -std​::​three_way_comparable_with if @ is <=>.
Effects: Equivalent to: -return lhs - lhs.absolute_point_origin @ rhs - rhs.absolute_point_origin; -
Remarks: The expression in the requires-clause is equivalent to: -C<quantity_type, typename QP2::quantity_type> -
Recommended practice: If the origins are equal, instead evaluate -lhs.quantity_ref_from(point_origin) @ rhs.quantity_ref_from(QP2::point_origin) -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.pt.cons.html b/HEAD/api_reference/gen/qty.pt.cons.html deleted file mode 100644 index b517f5e4..00000000 --- a/HEAD/api_reference/gen/qty.pt.cons.html +++ /dev/null @@ -1,34 +0,0 @@ -[qty.pt.cons]

5 Quantities and units library [quantities]

5.7 Quantity point [qty.pt]

5.7.6 Constructors [qty.pt.cons]

template<typename FwdQ, QuantityOf<quantity_spec> Q = std::remove_cvref_t<FwdQ>> - requires std::constructible_from<quantity_type, FwdQ> && - (point_origin == default_point_origin(R)) && - (implicitly_convertible(Q::quantity_spec, quantity_spec)) -constexpr explicit quantity_point(FwdQ&& q); - -template<typename FwdQ, QuantityOf<quantity_spec> Q = std::remove_cvref_t<FwdQ>> - requires std::constructible_from<quantity_type, FwdQ> -constexpr quantity_point(FwdQ&& q, decltype(PO)); -
Effects: Initializes quantity-from-origin with std​::​forward<FwdQ>(q).
template<typename FwdQ, PointOrigin PO2, - QuantityOf<PO2::quantity-spec> Q = std::remove_cvref_t<FwdQ>> - requires std::constructible_from<quantity_type, FwdQ> && SameAbsolutePointOriginAs<PO2, PO> -constexpr quantity_point(FwdQ&& q, PO2); -
Effects: Equivalent to: -quantity_point(quantity_point<Q::reference, PO2{}, typename Q::rep>{std::forward<FwdQ>(q), - PO2{}}) -
template<QuantityPointOf<absolute_point_origin> QP> - requires std::constructible_from<quantity_type, typename QP::quantity_type> -constexpr explicit(!std::convertible_to<typename QP::quantity_type, quantity_type>) - quantity_point(const QP& qp); -
Effects: If point_origin == QP​::​point_origin is true, -initializes quantity-from-origin with qp.quantity_ref_from(point_origin).
Otherwise, initializes quantity-from-origin with qp - point_origin.
template<QuantityPointLike QP> - requires see below -constexpr explicit(see below) quantity_point(const QP& qp); -
Let Traits be quantity_point_like_traits<QP>.
Effects: Initializes quantity-from-origin with -Traits::to_numerical_value(qp), get_unit(Traits::reference) -
Remarks: The expression in the requires-clause is equivalent to: -(Traits::point_origin == point_origin) && - std::convertible_to<quantity<Traits::reference, typename Traits::rep>, quantity_type> -
-The expression inside explicit is equivalent to: -Traits::explicit_import || - !std::convertible_to<quantity<Traits::reference, typename Traits::rep>, quantity_type> -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.pt.conv.html b/HEAD/api_reference/gen/qty.pt.conv.html deleted file mode 100644 index 0b11024f..00000000 --- a/HEAD/api_reference/gen/qty.pt.conv.html +++ /dev/null @@ -1,38 +0,0 @@ -[qty.pt.conv]

5 Quantities and units library [quantities]

5.7 Quantity point [qty.pt]

5.7.7 Conversions [qty.pt.conv]

template<SameAbsolutePointOriginAs<absolute_point_origin> NewPO> -constexpr QuantityPointOf<(NewPO{})> auto point_for(NewPO new_origin) const; -
Effects: Equivalent to: -if constexpr (std::is_same_v<NewPO, decltype(point_origin)>) - return *this; -else - return ::mp_units::quantity_point{*this - new_origin, new_origin}; -
template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below -constexpr QuantityPointOf<quantity_spec> auto in(ToU) const; - -template<RepresentationOf<quantity_spec> ToRep> - requires see below -constexpr QuantityPointOf<quantity_spec> auto in() const; - -template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below -constexpr QuantityPointOf<quantity_spec> auto in(ToU) const; - -template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below -constexpr QuantityPointOf<quantity_spec> auto force_in(ToU) const; - -template<RepresentationOf<quantity_spec> ToRep> - requires see below -constexpr QuantityPointOf<quantity_spec> auto force_in() const; - -template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below -constexpr QuantityPointOf<quantity_spec> auto force_in(ToU) const; -
Let converted-quantity-expr be an expression denoting -the function call to the corresponding member of quantity_ref_from(point_origin).
Effects: Equivalent to: -return ::mp_units::quantity_point{converted-quantity-expr, point_origin}; -
Remarks: The expression in the requires-clause is equivalent to: -requires { converted-quantity-expr; } -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.pt.conv.ops.html b/HEAD/api_reference/gen/qty.pt.conv.ops.html deleted file mode 100644 index 3f813ccf..00000000 --- a/HEAD/api_reference/gen/qty.pt.conv.ops.html +++ /dev/null @@ -1,21 +0,0 @@ -[qty.pt.conv.ops]

5 Quantities and units library [quantities]

5.7 Quantity point [qty.pt]

5.7.9 Conversion operations [qty.pt.conv.ops]

template<typename QP_, QuantityPointLike QP = std::remove_cvref_t<QP_>> - requires see below -constexpr explicit(see below) operator QP_() const & noexcept(see below); -template<typename QP_, QuantityPointLike QP = std::remove_cvref_t<QP_>> - requires see below -constexpr explicit(see below) operator QP_() && noexcept(see below); -
Let Traits be quantity_point_like_traits<QP>.
Let result-expr be -Traits::from_numerical_value(std::move(quantity-from-origin).numerical-value) -
Returns: result-expr.
Remarks: The expression in the requires-clause is equivalent to: -(point_origin == Traits::point_origin) && - std::convertible_to<quantity_type, quantity<Traits::reference, typename Traits::rep>> -
-The expression inside explicit is equivalent to: -Traits::explicit_export || - !std::convertible_to<quantity_type, quantity<Traits::reference, typename Traits::rep>> -
-Let T be -std​::​is_nothrow_copy_constructible_v for the first signature, and -std​::​is_nothrow_move_constructible_v for the second signature.
The exception specification is equivalent to: -noexcept(result-expr) && T<rep> -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.pt.general.html b/HEAD/api_reference/gen/qty.pt.general.html deleted file mode 100644 index 16b8cf40..00000000 --- a/HEAD/api_reference/gen/qty.pt.general.html +++ /dev/null @@ -1,3 +0,0 @@ -[qty.pt.general]

5 Quantities and units library [quantities]

5.7 Quantity point [qty.pt]

5.7.1 General [qty.pt.general]

Subclause [qty.pt] describes the class template quantity_point -that represents the value of a quantity (IEC 60050, 112-01-28) -that is an element of an affine space (IEC 60050, 102-03-02,102-04-01).
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.pt.html b/HEAD/api_reference/gen/qty.pt.html deleted file mode 100644 index 1da13109..00000000 --- a/HEAD/api_reference/gen/qty.pt.html +++ /dev/null @@ -1,621 +0,0 @@ -[qty.pt]

5 Quantities and units library [quantities]

5.7 Quantity point [qty.pt]

5.7.1 General [qty.pt.general]

Subclause [qty.pt] describes the class template quantity_point -that represents the value of a quantity (IEC 60050, 112-01-28) -that is an element of an affine space (IEC 60050, 102-03-02,102-04-01).

5.7.2 Point origin [qty.pt.orig]

5.7.2.1 General [qty.pt.orig.general]

This subclause specifies the components -for defining the origin of an affine space.
An origin is a point from which measurements (IEC 60050, 112-04-01) take place.

5.7.2.2 Concepts [qty.pt.orig.concepts]

template<typename T> -concept PointOrigin = SymbolicConstant<T> && std::derived_from<T, point-origin-interface>; - -template<typename T, auto QS> -concept PointOriginFor = PointOrigin<T> && QuantitySpecOf<decltype(QS), T::quantity-spec>; - -template<typename T, auto V> -concept SameAbsolutePointOriginAs = // exposition only - PointOrigin<T> && PointOrigin<decltype(V)> && same-absolute-point-origins(T{}, V); -

5.7.2.3 Types [qty.pt.orig.types]

5.7.2.3.1 Absolute [qty.abs.pt.orig]

namespace mp_units { - -template<QuantitySpec auto QS> -struct absolute_point_origin : point-origin-interface { - static constexpr QuantitySpec auto quantity-spec = QS; // exposition only -}; - -} -
An absolute origin is an origin -chosen by convention and not defined in terms of another origin.
A specialization of absolute_point_origin is used as a base type when defining an absolute origin.
QS is the quantity the origin represents.

5.7.2.3.2 Relative [qty.rel.pt.orig]

namespace mp_units { - -template<QuantityPoint auto QP> -struct relative_point_origin : point-origin-interface { - static constexpr QuantityPoint auto quantity-point = QP; // exposition only - static constexpr QuantitySpec auto quantity-spec = see below; // exposition only - static constexpr PointOrigin auto absolute-point-origin = // exposition only - QP.absolute_point_origin; -}; - -} -
A relative origin is an origin -of a subspace (IEC 60050, 102-03-03).
A specialization of relative_point_origin is used as a base type when defining a relative origin O.
O is offset from QP.absolute_point_origin by QP.quantity_from_zero().
The member quantity-spec is equal to -QP.point_origin.quantity-spec if -QuantityKindSpec<decltype(auto(QP.quantity-spec))> - -is satisfied, and -to QP.quantity-spec otherwise.

5.7.2.3.3 Zeroth [qty.zeroth.pt.orig]

namespace mp_units { - -template<QuantitySpec auto QS> -struct zeroth_point_origin_ final : absolute_point_origin<QS> {}; - -} -
zeroth_point_origin_<QS> represents an origin -chosen by convention as the value 0 of the quantity QS.

5.7.2.4 Operations [qty.pt.orig.ops]

namespace mp_units { - -struct point-origin-interface { - template<PointOrigin PO, typename FwdQ, - QuantityOf<PO::quantity-spec> Q = std::remove_cvref_t<FwdQ>> - friend constexpr quantity_point<Q::reference, PO{}, typename Q::rep> operator+(PO, FwdQ&& q); - template<Quantity FwdQ, PointOrigin PO, - QuantityOf<PO::quantity-spec> Q = std::remove_cvref_t<FwdQ>> - friend constexpr quantity_point<Q::reference, PO{}, typename Q::rep> operator+(FwdQ&& q, PO); - - template<PointOrigin PO, Quantity Q> - requires ReferenceOf<decltype(auto(Q::reference)), PO::quantity-spec> - friend constexpr QuantityPoint auto operator-(PO po, const Q& q) - requires requires { -q; }; - - template<PointOrigin PO1, SameAbsolutePointOriginAs<PO1{}> PO2> - requires see below - friend constexpr Quantity auto operator-(PO1 po1, PO2 po2); - - template<PointOrigin PO1, PointOrigin PO2> - friend consteval bool operator==(PO1 po1, PO2 po2); -}; - -} -
template<PointOrigin PO, typename FwdQ, - QuantityOf<PO::quantity-spec> Q = std::remove_cvref_t<FwdQ>> -friend constexpr quantity_point<Q::reference, PO{}, typename Q::rep> operator+(PO, FwdQ&& q); -template<Quantity FwdQ, PointOrigin PO, - QuantityOf<PO::quantity-spec> Q = std::remove_cvref_t<FwdQ>> -friend constexpr quantity_point<Q::reference, PO{}, typename Q::rep> operator+(FwdQ&& q, PO); -
Effects: Equivalent to: -return quantity_point{std​::​forward<FwdQ>(q), PO{}};
template<PointOrigin PO, Quantity Q> - requires ReferenceOf<decltype(auto(Q::reference)), PO::quantity-spec> -friend constexpr QuantityPoint auto operator-(PO po, const Q& q) - requires requires { -q; }; -
Effects: Equivalent to: -return po + -q;
template<PointOrigin PO1, SameAbsolutePointOriginAs<PO1{}> PO2> - requires see below -friend constexpr Quantity auto operator-(PO1 po1, PO2 po2); -
Effects: Equivalent to: -if constexpr (is-derived-from-specialization-of<PO1, absolute_point_origin>()) { - return po1 - po2.quantity-point; -} else if constexpr (is-derived-from-specialization-of<PO2, absolute_point_origin>()) { - return po1.quantity-point - po2; -} else { - return po1.quantity-point - po2.quantity-point; -} -
Remarks: The expression in the requires-clause is equivalent to: -QuantitySpecOf<decltype(auto(PO1::quantity-spec)), PO2::quantity-spec> && - (is-derived-from-specialization-of<PO1, relative_point_origin>() || - is-derived-from-specialization-of<PO2, relative_point_origin>()) -
template<PointOrigin PO1, PointOrigin PO2> -friend consteval bool operator==(PO1 po1, PO2 po2); -
Effects: Equivalent to: -if constexpr (is-derived-from-specialization-of<PO1, absolute_point_origin>() && - is-derived-from-specialization-of<PO2, absolute_point_origin>()) - return std::is_same_v<PO1, PO2> || - (is-specialization-of<PO1, zeroth_point_origin>() && - is-specialization-of<PO2, zeroth_point_origin>() && - interconvertible(po1.quantity-spec, po2.quantity-spec)); -else if constexpr (is-derived-from-specialization-of<PO1, relative_point_origin>() && - is-derived-from-specialization-of<PO2, relative_point_origin>()) - return PO1::quantity-point == PO2::quantity-point; -else if constexpr (is-derived-from-specialization-of<PO1, relative_point_origin>()) - return same-absolute-point-origins(po1, po2) && - is_eq_zero(PO1::quantity-point.quantity_from_zero()); -else if constexpr (is-derived-from-specialization-of<PO2, relative_point_origin>()) - return same-absolute-point-origins(po1, po2) && - is_eq_zero(PO2::quantity-point.quantity_from_zero()); -

5.7.2.5 Utilities [qty.pt.orig.utils]

5.7.2.5.1 Same absolute [qty.same.abs.pt.origs]

template<PointOrigin PO1, PointOrigin PO2> -consteval bool same-absolute-point-origins(PO1 po1, PO2 po2); // exposition only -
Effects: Equivalent to: -if constexpr (is-derived-from-specialization-of<PO1, absolute_point_origin>() && - is-derived-from-specialization-of<PO2, absolute_point_origin>()) - return po1 == po2; -else if constexpr (is-derived-from-specialization-of<PO1, relative_point_origin>() && - is-derived-from-specialization-of<PO2, relative_point_origin>()) - return po1.absolute-point-origin == po2.absolute-point-origin; -else if constexpr (is-derived-from-specialization-of<PO1, relative_point_origin>()) - return po1.absolute-point-origin == po2; -else if constexpr (is-derived-from-specialization-of<PO2, relative_point_origin>()) - return po1 == po2.absolute-point-origin; -else - return false; -

5.7.2.5.2 Default [qty.def.pt.orig]

template<Reference R> -consteval PointOriginFor<get_quantity_spec(R{})> auto default_point_origin(R); -
Effects: Equivalent to: -if constexpr (requires { get_unit(R{}).point-origin; }) - return get_unit(R{}).point-origin; -else - return zeroth_point_origin<get_quantity_spec(R{})>; -

5.7.3 Interoperability [qty.pt.like]

template<typename T> -concept QuantityPointLike = - !QuantityPoint<T> && - qty-like-impl<T, quantity_point_like_traits> && // see [qty.like] - requires { - typename quantity_point<quantity_point_like_traits<T>::reference, - quantity_point_like_traits<T>::point_origin, - typename quantity_point_like_traits<T>::rep>; - }; -

5.7.4 Class template quantity_point [qty.pt.syn]

namespace mp_units { - -template<typename T> -concept QuantityPoint = (is-derived-from-specialization-of<T, quantity_point>()); - -template<typename QP, auto V> -concept QuantityPointOf = - QuantityPoint<QP> && (QuantitySpecOf<decltype(auto(QP::quantity_spec)), V> || - SameAbsolutePointOriginAs<decltype(auto(QP::absolute_point_origin)), V>); - -template<Reference auto R, - PointOriginFor<get_quantity_spec(R)> auto PO = default_point_origin(R), - RepresentationOf<get_quantity_spec(R)> Rep = double> -class quantity_point { -public: - // member types and values - static constexpr Reference auto reference = R; - static constexpr QuantitySpec auto quantity_spec = get_quantity_spec(reference); - static constexpr Dimension auto dimension = quantity_spec.dimension; - static constexpr Unit auto unit = get_unit(reference); - static constexpr PointOrigin auto absolute_point_origin = see below; - static constexpr PointOrigin auto point_origin = PO; - using rep = Rep; - using quantity_type = quantity<reference, Rep>; - - quantity_type quantity-from-origin; // exposition only - - // [qty.pt.static], static member functions - static constexpr quantity_point min() noexcept - requires see below; - static constexpr quantity_point max() noexcept - requires see below; - - // [qty.pt.cons], constructors and assignment - - quantity_point() = default; - quantity_point(const quantity_point&) = default; - quantity_point(quantity_point&&) = default; - ~quantity_point() = default; - - template<typename FwdQ, QuantityOf<quantity_spec> Q = std::remove_cvref_t<FwdQ>> - requires std::constructible_from<quantity_type, FwdQ> && - (point_origin == default_point_origin(R)) && - (implicitly_convertible(Q::quantity_spec, quantity_spec)) - constexpr explicit quantity_point(FwdQ&& q); - - template<typename FwdQ, QuantityOf<quantity_spec> Q = std::remove_cvref_t<FwdQ>> - requires std::constructible_from<quantity_type, FwdQ> - constexpr quantity_point(FwdQ&& q, decltype(PO)); - - template<typename FwdQ, PointOrigin PO2, - QuantityOf<PO2::quantity-spec> Q = std::remove_cvref_t<FwdQ>> - requires std::constructible_from<quantity_type, FwdQ> && SameAbsolutePointOriginAs<PO2, PO> - constexpr quantity_point(FwdQ&& q, PO2); - - template<QuantityPointOf<absolute_point_origin> QP> - requires std::constructible_from<quantity_type, typename QP::quantity_type> - constexpr explicit(!std::convertible_to<typename QP::quantity_type, quantity_type>) - quantity_point(const QP& qp); - - template<QuantityPointLike QP> - requires see below - constexpr explicit(see below) quantity_point(const QP& qp); - - quantity_point& operator=(const quantity_point&) = default; - quantity_point& operator=(quantity_point&&) = default; - - // [qty.pt.conv], conversions - - template<SameAbsolutePointOriginAs<absolute_point_origin> NewPO> - constexpr QuantityPointOf<(NewPO{})> auto point_for(NewPO new_origin) const; - - template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below - constexpr QuantityPointOf<quantity_spec> auto in(ToU) const; - - template<RepresentationOf<quantity_spec> ToRep> - requires see below - constexpr QuantityPointOf<quantity_spec> auto in() const; - - template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below - constexpr QuantityPointOf<quantity_spec> auto in(ToU) const; - - template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below - constexpr QuantityPointOf<quantity_spec> auto force_in(ToU) const; - - template<RepresentationOf<quantity_spec> ToRep> - requires see below - constexpr QuantityPointOf<quantity_spec> auto force_in() const; - - template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below - constexpr QuantityPointOf<quantity_spec> auto force_in(ToU) const; - - // [qty.pt.obs], quantity value observers - - template<PointOrigin PO2> - requires(PO2{} == point_origin) - constexpr quantity_type& quantity_ref_from(PO2) & noexcept; - template<PointOrigin PO2> - requires(PO2{} == point_origin) - constexpr const quantity_type& quantity_ref_from(PO2) const & noexcept; - template<PointOrigin PO2> - requires(PO2{} == point_origin) - void quantity_ref_from(PO2) const && = delete; - - template<PointOrigin PO2> - requires requires(const quantity_point qp) { qp - PO2{}; } - constexpr Quantity auto quantity_from(PO2) const; - - template<QuantityPointOf<absolute_point_origin> QP> - constexpr Quantity auto quantity_from(const QP&) const; - - constexpr Quantity auto quantity_from_zero() const; - - // [qty.pt.conv.ops], conversion operations - template<typename QP_, QuantityPointLike QP = std::remove_cvref_t<QP_>> - requires see below - constexpr explicit(see below) operator QP_() const & noexcept(see below); - template<typename QP_, QuantityPointLike QP = std::remove_cvref_t<QP_>> - requires see below - constexpr explicit(see below) operator QP_() && noexcept(see below); - - // [qty.pt.unary.ops], unary operations - - template<Mutable<quantity_point> QP> - friend constexpr decltype(auto) operator++(QP&& qp) - requires see below; - template<Mutable<quantity_point> QP> - friend constexpr decltype(auto) operator--(QP&& qp) - requires see below; - - constexpr quantity_point operator++(int) - requires see below; - constexpr quantity_point operator--(int) - requires see below; - - // [qty.pt.assign.ops], compound assignment operations - template<Mutable<quantity_point> QP, auto R2, typename Rep2> - requires see below - friend constexpr decltype(auto) operator+=(QP&& qp, const quantity<R2, Rep2>& q); - template<Mutable<quantity_point> QP, auto R2, typename Rep2> - requires see below - friend constexpr decltype(auto) operator-=(QP&& qp, const quantity<R2, Rep2>& q); - - // [qty.pt.arith.ops], arithmetic operations - - template<std::derived_from<quantity_point> QP, auto R2, typename Rep2> - friend constexpr QuantityPoint auto operator+(const QP& qp, const quantity<R2, Rep2>& q) - requires see below; - template<std::derived_from<quantity_point> QP, auto R2, typename Rep2> - friend constexpr QuantityPoint auto operator+(const quantity<R2, Rep2>& q, const QP& qp) - requires see below; - template<std::derived_from<quantity_point> QP, auto R2, typename Rep2> - friend constexpr QuantityPoint auto operator-(const QP& qp, const quantity<R2, Rep2>& q) - requires see below; - - template<std::derived_from<quantity_point> QP, QuantityPointOf<absolute_point_origin> QP2> - friend constexpr Quantity auto operator-(const QP& lhs, const QP2& rhs) - requires see below; - - template<std::derived_from<quantity_point> QP, PointOrigin PO2> - requires see below - friend constexpr Quantity auto operator-(const QP& qp, PO2 po); - template<std::derived_from<quantity_point> QP, PointOrigin PO2> - requires see below - friend constexpr Quantity auto operator-(PO2 po, const QP& qp); - - // [qty.pt.cmp], comparison - template<std::derived_from<quantity_point> QP, QuantityPointOf<absolute_point_origin> QP2> - requires see below - friend constexpr bool operator==(const QP& lhs, const QP2& rhs); - template<std::derived_from<quantity_point> QP, QuantityPointOf<absolute_point_origin> QP2> - requires see below - friend constexpr auto operator<=>(const QP& lhs, const QP2& rhs); -}; - -template<Quantity Q> -explicit quantity_point(Q q) - -> quantity_point<Q::reference, default_point_origin(Q::reference), typename Q::rep>; - -template<Quantity Q, PointOriginFor<Q::quantity_spec> PO> -quantity_point(Q, PO) -> quantity_point<Q::reference, PO{}, typename Q::rep>; - -template<QuantityPointLike QP, typename Traits = quantity_point_like_traits<QP>> -explicit(quantity_point_like_traits<QP>::explicit_import) quantity_point(QP) - -> quantity_point<Traits::reference, Traits::point_origin, typename Traits::rep>; - -} -
quantity_point<R, PO, Rep> is a structural type (N4971, [temp.param]) -if Rep is a structural type.
The member absolute_point_origin is equal to PO if -is-derived-from-specialization-of<decltype(PO), absolute_point_origin>() - -is true, and -to PO.quantity-point.absolute_point_origin otherwise.

5.7.5 Static member functions [qty.pt.static]

static constexpr quantity_point min() noexcept - requires see below; -static constexpr quantity_point max() noexcept - requires see below; -
Let F be one of min and max.
Returns: {quantity_type​::​F(), PO}.
Remarks: The expression in the requires-clause is equivalent to: -requires { quantity_type::F(); } -

5.7.6 Constructors [qty.pt.cons]

template<typename FwdQ, QuantityOf<quantity_spec> Q = std::remove_cvref_t<FwdQ>> - requires std::constructible_from<quantity_type, FwdQ> && - (point_origin == default_point_origin(R)) && - (implicitly_convertible(Q::quantity_spec, quantity_spec)) -constexpr explicit quantity_point(FwdQ&& q); - -template<typename FwdQ, QuantityOf<quantity_spec> Q = std::remove_cvref_t<FwdQ>> - requires std::constructible_from<quantity_type, FwdQ> -constexpr quantity_point(FwdQ&& q, decltype(PO)); -
Effects: Initializes quantity-from-origin with std​::​forward<FwdQ>(q).
template<typename FwdQ, PointOrigin PO2, - QuantityOf<PO2::quantity-spec> Q = std::remove_cvref_t<FwdQ>> - requires std::constructible_from<quantity_type, FwdQ> && SameAbsolutePointOriginAs<PO2, PO> -constexpr quantity_point(FwdQ&& q, PO2); -
Effects: Equivalent to: -quantity_point(quantity_point<Q::reference, PO2{}, typename Q::rep>{std::forward<FwdQ>(q), - PO2{}}) -
template<QuantityPointOf<absolute_point_origin> QP> - requires std::constructible_from<quantity_type, typename QP::quantity_type> -constexpr explicit(!std::convertible_to<typename QP::quantity_type, quantity_type>) - quantity_point(const QP& qp); -
Effects: If point_origin == QP​::​point_origin is true, -initializes quantity-from-origin with qp.quantity_ref_from(point_origin).
Otherwise, initializes quantity-from-origin with qp - point_origin.
template<QuantityPointLike QP> - requires see below -constexpr explicit(see below) quantity_point(const QP& qp); -
Let Traits be quantity_point_like_traits<QP>.
Effects: Initializes quantity-from-origin with -Traits::to_numerical_value(qp), get_unit(Traits::reference) -
Remarks: The expression in the requires-clause is equivalent to: -(Traits::point_origin == point_origin) && - std::convertible_to<quantity<Traits::reference, typename Traits::rep>, quantity_type> -
-The expression inside explicit is equivalent to: -Traits::explicit_import || - !std::convertible_to<quantity<Traits::reference, typename Traits::rep>, quantity_type> -

5.7.7 Conversions [qty.pt.conv]

template<SameAbsolutePointOriginAs<absolute_point_origin> NewPO> -constexpr QuantityPointOf<(NewPO{})> auto point_for(NewPO new_origin) const; -
Effects: Equivalent to: -if constexpr (std::is_same_v<NewPO, decltype(point_origin)>) - return *this; -else - return ::mp_units::quantity_point{*this - new_origin, new_origin}; -
template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below -constexpr QuantityPointOf<quantity_spec> auto in(ToU) const; - -template<RepresentationOf<quantity_spec> ToRep> - requires see below -constexpr QuantityPointOf<quantity_spec> auto in() const; - -template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below -constexpr QuantityPointOf<quantity_spec> auto in(ToU) const; - -template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below -constexpr QuantityPointOf<quantity_spec> auto force_in(ToU) const; - -template<RepresentationOf<quantity_spec> ToRep> - requires see below -constexpr QuantityPointOf<quantity_spec> auto force_in() const; - -template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below -constexpr QuantityPointOf<quantity_spec> auto force_in(ToU) const; -
Let converted-quantity-expr be an expression denoting -the function call to the corresponding member of quantity_ref_from(point_origin).
Effects: Equivalent to: -return ::mp_units::quantity_point{converted-quantity-expr, point_origin}; -
Remarks: The expression in the requires-clause is equivalent to: -requires { converted-quantity-expr; } -

5.7.8 Quantity value observers [qty.pt.obs]

template<PointOrigin PO2> - requires(PO2{} == point_origin) -constexpr quantity_type& quantity_ref_from(PO2) & noexcept; -template<PointOrigin PO2> - requires(PO2{} == point_origin) -constexpr const quantity_type& quantity_ref_from(PO2) const & noexcept; -
Returns: quantity-from-origin.
template<PointOrigin PO2> - requires requires(const quantity_point qp) { qp - PO2{}; } -constexpr Quantity auto quantity_from(PO2 rhs) const; - -template<QuantityPointOf<absolute_point_origin> QP> -constexpr Quantity auto quantity_from(const QP& rhs) const; -
Effects: Equivalent to: -return *this - rhs;
constexpr Quantity auto quantity_from_zero() const; -
Effects: Equivalent to: -if constexpr (requires { unit.point-origin; }) { - // can lose the input unit - const auto q = quantity_from(unit.point-origin); - if constexpr (requires { q.in(unit); }) - // restore the unit - return q.in(unit); - else - return q; -} else - return quantity_from(absolute_point_origin); -

5.7.9 Conversion operations [qty.pt.conv.ops]

template<typename QP_, QuantityPointLike QP = std::remove_cvref_t<QP_>> - requires see below -constexpr explicit(see below) operator QP_() const & noexcept(see below); -template<typename QP_, QuantityPointLike QP = std::remove_cvref_t<QP_>> - requires see below -constexpr explicit(see below) operator QP_() && noexcept(see below); -
Let Traits be quantity_point_like_traits<QP>.
Let result-expr be -Traits::from_numerical_value(std::move(quantity-from-origin).numerical-value) -
Returns: result-expr.
Remarks: The expression in the requires-clause is equivalent to: -(point_origin == Traits::point_origin) && - std::convertible_to<quantity_type, quantity<Traits::reference, typename Traits::rep>> -
-The expression inside explicit is equivalent to: -Traits::explicit_export || - !std::convertible_to<quantity_type, quantity<Traits::reference, typename Traits::rep>> -
-Let T be -std​::​is_nothrow_copy_constructible_v for the first signature, and -std​::​is_nothrow_move_constructible_v for the second signature.
The exception specification is equivalent to: -noexcept(result-expr) && T<rep> -

5.7.10 Unary operations [qty.pt.unary.ops]

In the following descriptions, -let @ be the operator.
template<Mutable<quantity_point> QP> -friend constexpr decltype(auto) operator++(QP&& qp) - requires see below; -template<Mutable<quantity_point> QP> -friend constexpr decltype(auto) operator--(QP&& qp) - requires see below; -
Effects: Equivalent to -@qp.quantity-from-origin.
Returns: std​::​forward<QP>(qp).
Remarks: The expression in the requires-clause is equivalent to: -requires { @qp.quantity-from-origin; } -
constexpr quantity_point operator++(int) - requires see below; -constexpr quantity_point operator--(int) - requires see below; -
Effects: Equivalent to: -return {quantity-from-origin@, PO};
Remarks: The expression in the requires-clause is equivalent to: -requires { quantity-from-origin@; } -

5.7.11 Compound assignment operations [qty.pt.assign.ops]

template<Mutable<quantity_point> QP, auto R2, typename Rep2> - requires see below -friend constexpr decltype(auto) operator+=(QP&& qp, const quantity<R2, Rep2>& q); -template<Mutable<quantity_point> QP, auto R2, typename Rep2> - requires see below -friend constexpr decltype(auto) operator-=(QP&& qp, const quantity<R2, Rep2>& q); -
Let @ be the operator.
Effects: Equivalent to -qp.quantity-from-origin @ q.
Returns: std​::​forward<QP>(qp).
Remarks: The expression in the requires-clause is equivalent to: -QuantityConvertibleTo<quantity<R2, Rep2>, quantity_type> && - requires { qp.quantity-from-origin @ q; } -

5.7.12 Arithmetic operations [qty.pt.arith.ops]

In the following descriptions, -let @ be the operator.
template<std::derived_from<quantity_point> QP, auto R2, typename Rep2> -friend constexpr QuantityPoint auto operator+(const QP& qp, const quantity<R2, Rep2>& q) - requires see below; -template<std::derived_from<quantity_point> QP, auto R2, typename Rep2> -friend constexpr QuantityPoint auto operator+(const quantity<R2, Rep2>& q, const QP& qp) - requires see below; -template<std::derived_from<quantity_point> QP, auto R2, typename Rep2> -friend constexpr QuantityPoint auto operator-(const QP& qp, const quantity<R2, Rep2>& q) - requires see below; -
Effects: Equivalent to: -if constexpr (is-specialization-of<PO, zeroth_point_origin>()) - return ::mp_units::quantity_point{qp.quantity_ref_from(PO) @ q}; -else - return ::mp_units::quantity_point{qp.quantity_ref_from(PO) @ q, PO}; -
Remarks: The expression in the requires-clause is equivalent to: -ReferenceOf<decltype(R2), PO.quantity-spec> && requires { - qp.quantity_ref_from(PO) @ q; -} -
template<std::derived_from<quantity_point> QP, QuantityPointOf<absolute_point_origin> QP2> -friend constexpr Quantity auto operator-(const QP& lhs, const QP2& rhs) - requires see below; -
Effects: Equivalent to: -return lhs.quantity_ref_from(point_origin) - rhs.quantity_ref_from(QP2::point_origin) + - (lhs.point_origin - rhs.point_origin); -
Remarks: The expression in the requires-clause is equivalent to: -requires { lhs.quantity_ref_from(point_origin) - rhs.quantity_ref_from(QP2::point_origin); } -
Recommended practice: The subtraction of two equal origins is not evaluated.
template<std::derived_from<quantity_point> QP, PointOrigin PO2> - requires see below -friend constexpr Quantity auto operator-(const QP& qp, PO2 po); -template<std::derived_from<quantity_point> QP, PointOrigin PO2> - requires see below -friend constexpr Quantity auto operator-(PO2 po, const QP& qp); -
Effects: For the first signature, -equivalent to: -if constexpr (point_origin == po) - return qp.quantity_ref_from(point_origin); -else if constexpr (is-derived-from-specialization-of<PO2, - ::mp_units::absolute_point_origin>()) { - return qp.quantity_ref_from(point_origin) + (qp.point_origin - qp.absolute_point_origin); -} else { - return qp.quantity_ref_from(point_origin) - - po.quantity-point.quantity_ref_from(po.quantity-point.point_origin) + - (qp.point_origin - po.quantity-point.point_origin); -} -
-For the second signature, -equivalent to: return -(qp - po);
Remarks: The expression in the requires-clause is equivalent to: -QuantityPointOf<quantity_point, PO2{}> && - ReferenceOf<decltype(auto(reference)), PO2::quantity-spec> -
Recommended practice: The subtraction of two equal origins is not evaluated.

5.7.13 Comparison [qty.pt.cmp]

template<std::derived_from<quantity_point> QP, QuantityPointOf<absolute_point_origin> QP2> - requires see below -friend constexpr bool operator==(const QP& lhs, const QP2& rhs); -template<std::derived_from<quantity_point> QP, QuantityPointOf<absolute_point_origin> QP2> - requires see below -friend constexpr auto operator<=>(const QP& lhs, const QP2& rhs); -
Let @ be the operator, and -let C be -std​::​equality_comparable_with if @ is ==, and -std​::​three_way_comparable_with if @ is <=>.
Effects: Equivalent to: -return lhs - lhs.absolute_point_origin @ rhs - rhs.absolute_point_origin; -
Remarks: The expression in the requires-clause is equivalent to: -C<quantity_type, typename QP2::quantity_type> -
Recommended practice: If the origins are equal, instead evaluate -lhs.quantity_ref_from(point_origin) @ rhs.quantity_ref_from(QP2::point_origin) -

5.7.14 Construction helper point [qty.point]

namespace mp_units { - -template<Reference R> -struct point_ { - template<typename FwdRep, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> - constexpr quantity_point<R{}, default_point_origin(R{}), Rep> operator()(FwdRep&& lhs) const; -}; - -} -
template<typename FwdRep, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> -constexpr quantity_point<R{}, default_point_origin(R{}), Rep> operator()(FwdRep&& lhs) const; -
Effects: Equivalent to: -return quantity_point{quantity{std​::​forward<FwdRep>(lhs), R{}}};

5.7.15 Non-member conversions [qty.pt.non.mem.conv]

template<QuantityPoint ToQP, typename FwdFromQP, - QuantityPoint FromQP = std::remove_cvref_t<FwdFromQP>> - requires see below -constexpr QuantityPoint auto sudo-cast(FwdFromQP&& qp); -
Returns: TBD.
value_cast is an explicit cast that allows truncation.
template<Unit auto ToU, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires(convertible(QP::reference, ToU)) -constexpr QuantityPoint auto value_cast(FwdQP&& qp); -
Effects: Equivalent to: -return quantity_point{value_cast<ToU>(std::forward<FwdQP>(qp).quantity-from-origin), - QP::point_origin}; -
template<Representation ToRep, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires RepresentationOf<ToRep, QP::quantity_spec> && - std::constructible_from<ToRep, typename QP::rep> -constexpr quantity_point<QP::reference, QP::point_origin, ToRep> value_cast(FwdQP&& qp); -
Effects: Equivalent to: -return {value_cast<ToRep>(std::forward<FwdQP>(qp).quantity-from-origin), QP::point_origin}; -
template<Unit auto ToU, Representation ToRep, typename FwdQP, - QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires see below -constexpr QuantityPoint auto value_cast(FwdQP&& qp); -template<Representation ToRep, Unit auto ToU, typename FwdQP, - QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires see below -constexpr QuantityPoint auto value_cast(FwdQP&& qp); -
Effects: Equivalent to: -return quantity_point{value_cast<ToU, ToRep>(std::forward<FwdQP>(qp).quantity-from-origin), - QP::point_origin}; -
Remarks: The expression in the requires-clause is equivalent to: -(convertible(QP::reference, ToU)) && RepresentationOf<ToRep, QP::quantity_spec> && -std::constructible_from<ToRep, typename QP::rep> -
template<Quantity ToQ, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires(convertible(QP::reference, ToQ::unit)) && (ToQ::quantity_spec == QP::quantity_spec) && - std::constructible_from<typename ToQ::rep, typename QP::rep> -constexpr QuantityPoint auto value_cast(FwdQP&& qp); -
Effects: Equivalent to: -return quantity_point{value_cast<ToQ>(std::forward<FwdQP>(qp).quantity-from-origin), - QP::point_origin}; -
template<QuantityPoint ToQP, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires(convertible(QP::reference, ToQP::unit)) && - (ToQP::quantity_spec == QP::quantity_spec) && - (same-absolute-point-origins(ToQP::point_origin, QP::point_origin)) && - std::constructible_from<typename ToQP::rep, typename QP::rep> -constexpr QuantityPoint auto value_cast(FwdQP&& qp); -
Effects: Equivalent to: -return sudo-cast<ToQP>(std​::​forward<FwdQP>(qp));
quantity_cast is an explicit cast that allows converting to more specific quantities.
template<QuantitySpec auto ToQS, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires QuantitySpecCastableTo<QP::quantity_spec, ToQS> -constexpr QuantityPoint auto quantity_cast(FwdQP&& qp); -
Effects: Equivalent to: -return QP{quantity_cast<ToQS>(std::forward<FwdQP>(qp).quantity_from_origin), - QP::point_origin}; -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.pt.like.html b/HEAD/api_reference/gen/qty.pt.like.html deleted file mode 100644 index 416f4c10..00000000 --- a/HEAD/api_reference/gen/qty.pt.like.html +++ /dev/null @@ -1,10 +0,0 @@ -[qty.pt.like]

5 Quantities and units library [quantities]

5.7 Quantity point [qty.pt]

5.7.3 Interoperability [qty.pt.like]

template<typename T> -concept QuantityPointLike = - !QuantityPoint<T> && - qty-like-impl<T, quantity_point_like_traits> && // see [qty.like] - requires { - typename quantity_point<quantity_point_like_traits<T>::reference, - quantity_point_like_traits<T>::point_origin, - typename quantity_point_like_traits<T>::rep>; - }; -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.pt.non.mem.conv.html b/HEAD/api_reference/gen/qty.pt.non.mem.conv.html deleted file mode 100644 index 951d73e6..00000000 --- a/HEAD/api_reference/gen/qty.pt.non.mem.conv.html +++ /dev/null @@ -1,51 +0,0 @@ -[qty.pt.non.mem.conv]

5 Quantities and units library [quantities]

5.7 Quantity point [qty.pt]

5.7.15 Non-member conversions [qty.pt.non.mem.conv]

template<QuantityPoint ToQP, typename FwdFromQP, - QuantityPoint FromQP = std::remove_cvref_t<FwdFromQP>> - requires see below -constexpr QuantityPoint auto sudo-cast(FwdFromQP&& qp); -
Returns: TBD.
value_cast is an explicit cast that allows truncation.
template<Unit auto ToU, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires(convertible(QP::reference, ToU)) -constexpr QuantityPoint auto value_cast(FwdQP&& qp); -
Effects: Equivalent to: -return quantity_point{value_cast<ToU>(std::forward<FwdQP>(qp).quantity-from-origin), - QP::point_origin}; -
template<Representation ToRep, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires RepresentationOf<ToRep, QP::quantity_spec> && - std::constructible_from<ToRep, typename QP::rep> -constexpr quantity_point<QP::reference, QP::point_origin, ToRep> value_cast(FwdQP&& qp); -
Effects: Equivalent to: -return {value_cast<ToRep>(std::forward<FwdQP>(qp).quantity-from-origin), QP::point_origin}; -
template<Unit auto ToU, Representation ToRep, typename FwdQP, - QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires see below -constexpr QuantityPoint auto value_cast(FwdQP&& qp); -template<Representation ToRep, Unit auto ToU, typename FwdQP, - QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires see below -constexpr QuantityPoint auto value_cast(FwdQP&& qp); -
Effects: Equivalent to: -return quantity_point{value_cast<ToU, ToRep>(std::forward<FwdQP>(qp).quantity-from-origin), - QP::point_origin}; -
Remarks: The expression in the requires-clause is equivalent to: -(convertible(QP::reference, ToU)) && RepresentationOf<ToRep, QP::quantity_spec> && -std::constructible_from<ToRep, typename QP::rep> -
template<Quantity ToQ, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires(convertible(QP::reference, ToQ::unit)) && (ToQ::quantity_spec == QP::quantity_spec) && - std::constructible_from<typename ToQ::rep, typename QP::rep> -constexpr QuantityPoint auto value_cast(FwdQP&& qp); -
Effects: Equivalent to: -return quantity_point{value_cast<ToQ>(std::forward<FwdQP>(qp).quantity-from-origin), - QP::point_origin}; -
template<QuantityPoint ToQP, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires(convertible(QP::reference, ToQP::unit)) && - (ToQP::quantity_spec == QP::quantity_spec) && - (same-absolute-point-origins(ToQP::point_origin, QP::point_origin)) && - std::constructible_from<typename ToQP::rep, typename QP::rep> -constexpr QuantityPoint auto value_cast(FwdQP&& qp); -
Effects: Equivalent to: -return sudo-cast<ToQP>(std​::​forward<FwdQP>(qp));
quantity_cast is an explicit cast that allows converting to more specific quantities.
template<QuantitySpec auto ToQS, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires QuantitySpecCastableTo<QP::quantity_spec, ToQS> -constexpr QuantityPoint auto quantity_cast(FwdQP&& qp); -
Effects: Equivalent to: -return QP{quantity_cast<ToQS>(std::forward<FwdQP>(qp).quantity_from_origin), - QP::point_origin}; -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.pt.obs.html b/HEAD/api_reference/gen/qty.pt.obs.html deleted file mode 100644 index 1e51a18f..00000000 --- a/HEAD/api_reference/gen/qty.pt.obs.html +++ /dev/null @@ -1,26 +0,0 @@ -[qty.pt.obs]

5 Quantities and units library [quantities]

5.7 Quantity point [qty.pt]

5.7.8 Quantity value observers [qty.pt.obs]

template<PointOrigin PO2> - requires(PO2{} == point_origin) -constexpr quantity_type& quantity_ref_from(PO2) & noexcept; -template<PointOrigin PO2> - requires(PO2{} == point_origin) -constexpr const quantity_type& quantity_ref_from(PO2) const & noexcept; -
Returns: quantity-from-origin.
template<PointOrigin PO2> - requires requires(const quantity_point qp) { qp - PO2{}; } -constexpr Quantity auto quantity_from(PO2 rhs) const; - -template<QuantityPointOf<absolute_point_origin> QP> -constexpr Quantity auto quantity_from(const QP& rhs) const; -
Effects: Equivalent to: -return *this - rhs;
constexpr Quantity auto quantity_from_zero() const; -
Effects: Equivalent to: -if constexpr (requires { unit.point-origin; }) { - // can lose the input unit - const auto q = quantity_from(unit.point-origin); - if constexpr (requires { q.in(unit); }) - // restore the unit - return q.in(unit); - else - return q; -} else - return quantity_from(absolute_point_origin); -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.pt.orig.concepts.html b/HEAD/api_reference/gen/qty.pt.orig.concepts.html deleted file mode 100644 index 9f07135c..00000000 --- a/HEAD/api_reference/gen/qty.pt.orig.concepts.html +++ /dev/null @@ -1,10 +0,0 @@ -[qty.pt.orig.concepts]

5 Quantities and units library [quantities]

5.7 Quantity point [qty.pt]

5.7.2 Point origin [qty.pt.orig]

5.7.2.2 Concepts [qty.pt.orig.concepts]

template<typename T> -concept PointOrigin = SymbolicConstant<T> && std::derived_from<T, point-origin-interface>; - -template<typename T, auto QS> -concept PointOriginFor = PointOrigin<T> && QuantitySpecOf<decltype(QS), T::quantity-spec>; - -template<typename T, auto V> -concept SameAbsolutePointOriginAs = // exposition only - PointOrigin<T> && PointOrigin<decltype(V)> && same-absolute-point-origins(T{}, V); -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.pt.orig.general.html b/HEAD/api_reference/gen/qty.pt.orig.general.html deleted file mode 100644 index dcd6b295..00000000 --- a/HEAD/api_reference/gen/qty.pt.orig.general.html +++ /dev/null @@ -1,2 +0,0 @@ -[qty.pt.orig.general]

5 Quantities and units library [quantities]

5.7 Quantity point [qty.pt]

5.7.2 Point origin [qty.pt.orig]

5.7.2.1 General [qty.pt.orig.general]

This subclause specifies the components -for defining the origin of an affine space.
An origin is a point from which measurements (IEC 60050, 112-04-01) take place.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.pt.orig.html b/HEAD/api_reference/gen/qty.pt.orig.html deleted file mode 100644 index 99046f0b..00000000 --- a/HEAD/api_reference/gen/qty.pt.orig.html +++ /dev/null @@ -1,135 +0,0 @@ -[qty.pt.orig]

5 Quantities and units library [quantities]

5.7 Quantity point [qty.pt]

5.7.2 Point origin [qty.pt.orig]

5.7.2.1 General [qty.pt.orig.general]

This subclause specifies the components -for defining the origin of an affine space.
An origin is a point from which measurements (IEC 60050, 112-04-01) take place.

5.7.2.2 Concepts [qty.pt.orig.concepts]

template<typename T> -concept PointOrigin = SymbolicConstant<T> && std::derived_from<T, point-origin-interface>; - -template<typename T, auto QS> -concept PointOriginFor = PointOrigin<T> && QuantitySpecOf<decltype(QS), T::quantity-spec>; - -template<typename T, auto V> -concept SameAbsolutePointOriginAs = // exposition only - PointOrigin<T> && PointOrigin<decltype(V)> && same-absolute-point-origins(T{}, V); -

5.7.2.3 Types [qty.pt.orig.types]

5.7.2.3.1 Absolute [qty.abs.pt.orig]

namespace mp_units { - -template<QuantitySpec auto QS> -struct absolute_point_origin : point-origin-interface { - static constexpr QuantitySpec auto quantity-spec = QS; // exposition only -}; - -} -
An absolute origin is an origin -chosen by convention and not defined in terms of another origin.
A specialization of absolute_point_origin is used as a base type when defining an absolute origin.
QS is the quantity the origin represents.

5.7.2.3.2 Relative [qty.rel.pt.orig]

namespace mp_units { - -template<QuantityPoint auto QP> -struct relative_point_origin : point-origin-interface { - static constexpr QuantityPoint auto quantity-point = QP; // exposition only - static constexpr QuantitySpec auto quantity-spec = see below; // exposition only - static constexpr PointOrigin auto absolute-point-origin = // exposition only - QP.absolute_point_origin; -}; - -} -
A relative origin is an origin -of a subspace (IEC 60050, 102-03-03).
A specialization of relative_point_origin is used as a base type when defining a relative origin O.
O is offset from QP.absolute_point_origin by QP.quantity_from_zero().
The member quantity-spec is equal to -QP.point_origin.quantity-spec if -QuantityKindSpec<decltype(auto(QP.quantity-spec))> - -is satisfied, and -to QP.quantity-spec otherwise.

5.7.2.3.3 Zeroth [qty.zeroth.pt.orig]

namespace mp_units { - -template<QuantitySpec auto QS> -struct zeroth_point_origin_ final : absolute_point_origin<QS> {}; - -} -
zeroth_point_origin_<QS> represents an origin -chosen by convention as the value 0 of the quantity QS.

5.7.2.4 Operations [qty.pt.orig.ops]

namespace mp_units { - -struct point-origin-interface { - template<PointOrigin PO, typename FwdQ, - QuantityOf<PO::quantity-spec> Q = std::remove_cvref_t<FwdQ>> - friend constexpr quantity_point<Q::reference, PO{}, typename Q::rep> operator+(PO, FwdQ&& q); - template<Quantity FwdQ, PointOrigin PO, - QuantityOf<PO::quantity-spec> Q = std::remove_cvref_t<FwdQ>> - friend constexpr quantity_point<Q::reference, PO{}, typename Q::rep> operator+(FwdQ&& q, PO); - - template<PointOrigin PO, Quantity Q> - requires ReferenceOf<decltype(auto(Q::reference)), PO::quantity-spec> - friend constexpr QuantityPoint auto operator-(PO po, const Q& q) - requires requires { -q; }; - - template<PointOrigin PO1, SameAbsolutePointOriginAs<PO1{}> PO2> - requires see below - friend constexpr Quantity auto operator-(PO1 po1, PO2 po2); - - template<PointOrigin PO1, PointOrigin PO2> - friend consteval bool operator==(PO1 po1, PO2 po2); -}; - -} -
template<PointOrigin PO, typename FwdQ, - QuantityOf<PO::quantity-spec> Q = std::remove_cvref_t<FwdQ>> -friend constexpr quantity_point<Q::reference, PO{}, typename Q::rep> operator+(PO, FwdQ&& q); -template<Quantity FwdQ, PointOrigin PO, - QuantityOf<PO::quantity-spec> Q = std::remove_cvref_t<FwdQ>> -friend constexpr quantity_point<Q::reference, PO{}, typename Q::rep> operator+(FwdQ&& q, PO); -
Effects: Equivalent to: -return quantity_point{std​::​forward<FwdQ>(q), PO{}};
template<PointOrigin PO, Quantity Q> - requires ReferenceOf<decltype(auto(Q::reference)), PO::quantity-spec> -friend constexpr QuantityPoint auto operator-(PO po, const Q& q) - requires requires { -q; }; -
Effects: Equivalent to: -return po + -q;
template<PointOrigin PO1, SameAbsolutePointOriginAs<PO1{}> PO2> - requires see below -friend constexpr Quantity auto operator-(PO1 po1, PO2 po2); -
Effects: Equivalent to: -if constexpr (is-derived-from-specialization-of<PO1, absolute_point_origin>()) { - return po1 - po2.quantity-point; -} else if constexpr (is-derived-from-specialization-of<PO2, absolute_point_origin>()) { - return po1.quantity-point - po2; -} else { - return po1.quantity-point - po2.quantity-point; -} -
Remarks: The expression in the requires-clause is equivalent to: -QuantitySpecOf<decltype(auto(PO1::quantity-spec)), PO2::quantity-spec> && - (is-derived-from-specialization-of<PO1, relative_point_origin>() || - is-derived-from-specialization-of<PO2, relative_point_origin>()) -
template<PointOrigin PO1, PointOrigin PO2> -friend consteval bool operator==(PO1 po1, PO2 po2); -
Effects: Equivalent to: -if constexpr (is-derived-from-specialization-of<PO1, absolute_point_origin>() && - is-derived-from-specialization-of<PO2, absolute_point_origin>()) - return std::is_same_v<PO1, PO2> || - (is-specialization-of<PO1, zeroth_point_origin>() && - is-specialization-of<PO2, zeroth_point_origin>() && - interconvertible(po1.quantity-spec, po2.quantity-spec)); -else if constexpr (is-derived-from-specialization-of<PO1, relative_point_origin>() && - is-derived-from-specialization-of<PO2, relative_point_origin>()) - return PO1::quantity-point == PO2::quantity-point; -else if constexpr (is-derived-from-specialization-of<PO1, relative_point_origin>()) - return same-absolute-point-origins(po1, po2) && - is_eq_zero(PO1::quantity-point.quantity_from_zero()); -else if constexpr (is-derived-from-specialization-of<PO2, relative_point_origin>()) - return same-absolute-point-origins(po1, po2) && - is_eq_zero(PO2::quantity-point.quantity_from_zero()); -

5.7.2.5 Utilities [qty.pt.orig.utils]

5.7.2.5.1 Same absolute [qty.same.abs.pt.origs]

template<PointOrigin PO1, PointOrigin PO2> -consteval bool same-absolute-point-origins(PO1 po1, PO2 po2); // exposition only -
Effects: Equivalent to: -if constexpr (is-derived-from-specialization-of<PO1, absolute_point_origin>() && - is-derived-from-specialization-of<PO2, absolute_point_origin>()) - return po1 == po2; -else if constexpr (is-derived-from-specialization-of<PO1, relative_point_origin>() && - is-derived-from-specialization-of<PO2, relative_point_origin>()) - return po1.absolute-point-origin == po2.absolute-point-origin; -else if constexpr (is-derived-from-specialization-of<PO1, relative_point_origin>()) - return po1.absolute-point-origin == po2; -else if constexpr (is-derived-from-specialization-of<PO2, relative_point_origin>()) - return po1 == po2.absolute-point-origin; -else - return false; -

5.7.2.5.2 Default [qty.def.pt.orig]

template<Reference R> -consteval PointOriginFor<get_quantity_spec(R{})> auto default_point_origin(R); -
Effects: Equivalent to: -if constexpr (requires { get_unit(R{}).point-origin; }) - return get_unit(R{}).point-origin; -else - return zeroth_point_origin<get_quantity_spec(R{})>; -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.pt.orig.ops.html b/HEAD/api_reference/gen/qty.pt.orig.ops.html deleted file mode 100644 index 0a5943e7..00000000 --- a/HEAD/api_reference/gen/qty.pt.orig.ops.html +++ /dev/null @@ -1,70 +0,0 @@ -[qty.pt.orig.ops]

5 Quantities and units library [quantities]

5.7 Quantity point [qty.pt]

5.7.2 Point origin [qty.pt.orig]

5.7.2.4 Operations [qty.pt.orig.ops]

namespace mp_units { - -struct point-origin-interface { - template<PointOrigin PO, typename FwdQ, - QuantityOf<PO::quantity-spec> Q = std::remove_cvref_t<FwdQ>> - friend constexpr quantity_point<Q::reference, PO{}, typename Q::rep> operator+(PO, FwdQ&& q); - template<Quantity FwdQ, PointOrigin PO, - QuantityOf<PO::quantity-spec> Q = std::remove_cvref_t<FwdQ>> - friend constexpr quantity_point<Q::reference, PO{}, typename Q::rep> operator+(FwdQ&& q, PO); - - template<PointOrigin PO, Quantity Q> - requires ReferenceOf<decltype(auto(Q::reference)), PO::quantity-spec> - friend constexpr QuantityPoint auto operator-(PO po, const Q& q) - requires requires { -q; }; - - template<PointOrigin PO1, SameAbsolutePointOriginAs<PO1{}> PO2> - requires see below - friend constexpr Quantity auto operator-(PO1 po1, PO2 po2); - - template<PointOrigin PO1, PointOrigin PO2> - friend consteval bool operator==(PO1 po1, PO2 po2); -}; - -} -
template<PointOrigin PO, typename FwdQ, - QuantityOf<PO::quantity-spec> Q = std::remove_cvref_t<FwdQ>> -friend constexpr quantity_point<Q::reference, PO{}, typename Q::rep> operator+(PO, FwdQ&& q); -template<Quantity FwdQ, PointOrigin PO, - QuantityOf<PO::quantity-spec> Q = std::remove_cvref_t<FwdQ>> -friend constexpr quantity_point<Q::reference, PO{}, typename Q::rep> operator+(FwdQ&& q, PO); -
Effects: Equivalent to: -return quantity_point{std​::​forward<FwdQ>(q), PO{}};
template<PointOrigin PO, Quantity Q> - requires ReferenceOf<decltype(auto(Q::reference)), PO::quantity-spec> -friend constexpr QuantityPoint auto operator-(PO po, const Q& q) - requires requires { -q; }; -
Effects: Equivalent to: -return po + -q;
template<PointOrigin PO1, SameAbsolutePointOriginAs<PO1{}> PO2> - requires see below -friend constexpr Quantity auto operator-(PO1 po1, PO2 po2); -
Effects: Equivalent to: -if constexpr (is-derived-from-specialization-of<PO1, absolute_point_origin>()) { - return po1 - po2.quantity-point; -} else if constexpr (is-derived-from-specialization-of<PO2, absolute_point_origin>()) { - return po1.quantity-point - po2; -} else { - return po1.quantity-point - po2.quantity-point; -} -
Remarks: The expression in the requires-clause is equivalent to: -QuantitySpecOf<decltype(auto(PO1::quantity-spec)), PO2::quantity-spec> && - (is-derived-from-specialization-of<PO1, relative_point_origin>() || - is-derived-from-specialization-of<PO2, relative_point_origin>()) -
template<PointOrigin PO1, PointOrigin PO2> -friend consteval bool operator==(PO1 po1, PO2 po2); -
Effects: Equivalent to: -if constexpr (is-derived-from-specialization-of<PO1, absolute_point_origin>() && - is-derived-from-specialization-of<PO2, absolute_point_origin>()) - return std::is_same_v<PO1, PO2> || - (is-specialization-of<PO1, zeroth_point_origin>() && - is-specialization-of<PO2, zeroth_point_origin>() && - interconvertible(po1.quantity-spec, po2.quantity-spec)); -else if constexpr (is-derived-from-specialization-of<PO1, relative_point_origin>() && - is-derived-from-specialization-of<PO2, relative_point_origin>()) - return PO1::quantity-point == PO2::quantity-point; -else if constexpr (is-derived-from-specialization-of<PO1, relative_point_origin>()) - return same-absolute-point-origins(po1, po2) && - is_eq_zero(PO1::quantity-point.quantity_from_zero()); -else if constexpr (is-derived-from-specialization-of<PO2, relative_point_origin>()) - return same-absolute-point-origins(po1, po2) && - is_eq_zero(PO2::quantity-point.quantity_from_zero()); -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.pt.orig.types.html b/HEAD/api_reference/gen/qty.pt.orig.types.html deleted file mode 100644 index b8f452ad..00000000 --- a/HEAD/api_reference/gen/qty.pt.orig.types.html +++ /dev/null @@ -1,34 +0,0 @@ -[qty.pt.orig.types]

5 Quantities and units library [quantities]

5.7 Quantity point [qty.pt]

5.7.2 Point origin [qty.pt.orig]

5.7.2.3 Types [qty.pt.orig.types]

5.7.2.3.1 Absolute [qty.abs.pt.orig]

namespace mp_units { - -template<QuantitySpec auto QS> -struct absolute_point_origin : point-origin-interface { - static constexpr QuantitySpec auto quantity-spec = QS; // exposition only -}; - -} -
An absolute origin is an origin -chosen by convention and not defined in terms of another origin.
A specialization of absolute_point_origin is used as a base type when defining an absolute origin.
QS is the quantity the origin represents.

5.7.2.3.2 Relative [qty.rel.pt.orig]

namespace mp_units { - -template<QuantityPoint auto QP> -struct relative_point_origin : point-origin-interface { - static constexpr QuantityPoint auto quantity-point = QP; // exposition only - static constexpr QuantitySpec auto quantity-spec = see below; // exposition only - static constexpr PointOrigin auto absolute-point-origin = // exposition only - QP.absolute_point_origin; -}; - -} -
A relative origin is an origin -of a subspace (IEC 60050, 102-03-03).
A specialization of relative_point_origin is used as a base type when defining a relative origin O.
O is offset from QP.absolute_point_origin by QP.quantity_from_zero().
The member quantity-spec is equal to -QP.point_origin.quantity-spec if -QuantityKindSpec<decltype(auto(QP.quantity-spec))> - -is satisfied, and -to QP.quantity-spec otherwise.

5.7.2.3.3 Zeroth [qty.zeroth.pt.orig]

namespace mp_units { - -template<QuantitySpec auto QS> -struct zeroth_point_origin_ final : absolute_point_origin<QS> {}; - -} -
zeroth_point_origin_<QS> represents an origin -chosen by convention as the value 0 of the quantity QS.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.pt.orig.utils.html b/HEAD/api_reference/gen/qty.pt.orig.utils.html deleted file mode 100644 index 13424ad1..00000000 --- a/HEAD/api_reference/gen/qty.pt.orig.utils.html +++ /dev/null @@ -1,23 +0,0 @@ -[qty.pt.orig.utils]

5 Quantities and units library [quantities]

5.7 Quantity point [qty.pt]

5.7.2 Point origin [qty.pt.orig]

5.7.2.5 Utilities [qty.pt.orig.utils]

5.7.2.5.1 Same absolute [qty.same.abs.pt.origs]

template<PointOrigin PO1, PointOrigin PO2> -consteval bool same-absolute-point-origins(PO1 po1, PO2 po2); // exposition only -
Effects: Equivalent to: -if constexpr (is-derived-from-specialization-of<PO1, absolute_point_origin>() && - is-derived-from-specialization-of<PO2, absolute_point_origin>()) - return po1 == po2; -else if constexpr (is-derived-from-specialization-of<PO1, relative_point_origin>() && - is-derived-from-specialization-of<PO2, relative_point_origin>()) - return po1.absolute-point-origin == po2.absolute-point-origin; -else if constexpr (is-derived-from-specialization-of<PO1, relative_point_origin>()) - return po1.absolute-point-origin == po2; -else if constexpr (is-derived-from-specialization-of<PO2, relative_point_origin>()) - return po1 == po2.absolute-point-origin; -else - return false; -

5.7.2.5.2 Default [qty.def.pt.orig]

template<Reference R> -consteval PointOriginFor<get_quantity_spec(R{})> auto default_point_origin(R); -
Effects: Equivalent to: -if constexpr (requires { get_unit(R{}).point-origin; }) - return get_unit(R{}).point-origin; -else - return zeroth_point_origin<get_quantity_spec(R{})>; -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.pt.static.html b/HEAD/api_reference/gen/qty.pt.static.html deleted file mode 100644 index d53b6ce5..00000000 --- a/HEAD/api_reference/gen/qty.pt.static.html +++ /dev/null @@ -1,7 +0,0 @@ -[qty.pt.static]

5 Quantities and units library [quantities]

5.7 Quantity point [qty.pt]

5.7.5 Static member functions [qty.pt.static]

static constexpr quantity_point min() noexcept - requires see below; -static constexpr quantity_point max() noexcept - requires see below; -
Let F be one of min and max.
Returns: {quantity_type​::​F(), PO}.
Remarks: The expression in the requires-clause is equivalent to: -requires { quantity_type::F(); } -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.pt.syn.html b/HEAD/api_reference/gen/qty.pt.syn.html deleted file mode 100644 index 9d7845cb..00000000 --- a/HEAD/api_reference/gen/qty.pt.syn.html +++ /dev/null @@ -1,199 +0,0 @@ -[qty.pt.syn]

5 Quantities and units library [quantities]

5.7 Quantity point [qty.pt]

5.7.4 Class template quantity_point [qty.pt.syn]

namespace mp_units { - -template<typename T> -concept QuantityPoint = (is-derived-from-specialization-of<T, quantity_point>()); - -template<typename QP, auto V> -concept QuantityPointOf = - QuantityPoint<QP> && (QuantitySpecOf<decltype(auto(QP::quantity_spec)), V> || - SameAbsolutePointOriginAs<decltype(auto(QP::absolute_point_origin)), V>); - -template<Reference auto R, - PointOriginFor<get_quantity_spec(R)> auto PO = default_point_origin(R), - RepresentationOf<get_quantity_spec(R)> Rep = double> -class quantity_point { -public: - // member types and values - static constexpr Reference auto reference = R; - static constexpr QuantitySpec auto quantity_spec = get_quantity_spec(reference); - static constexpr Dimension auto dimension = quantity_spec.dimension; - static constexpr Unit auto unit = get_unit(reference); - static constexpr PointOrigin auto absolute_point_origin = see below; - static constexpr PointOrigin auto point_origin = PO; - using rep = Rep; - using quantity_type = quantity<reference, Rep>; - - quantity_type quantity-from-origin; // exposition only - - // [qty.pt.static], static member functions - static constexpr quantity_point min() noexcept - requires see below; - static constexpr quantity_point max() noexcept - requires see below; - - // [qty.pt.cons], constructors and assignment - - quantity_point() = default; - quantity_point(const quantity_point&) = default; - quantity_point(quantity_point&&) = default; - ~quantity_point() = default; - - template<typename FwdQ, QuantityOf<quantity_spec> Q = std::remove_cvref_t<FwdQ>> - requires std::constructible_from<quantity_type, FwdQ> && - (point_origin == default_point_origin(R)) && - (implicitly_convertible(Q::quantity_spec, quantity_spec)) - constexpr explicit quantity_point(FwdQ&& q); - - template<typename FwdQ, QuantityOf<quantity_spec> Q = std::remove_cvref_t<FwdQ>> - requires std::constructible_from<quantity_type, FwdQ> - constexpr quantity_point(FwdQ&& q, decltype(PO)); - - template<typename FwdQ, PointOrigin PO2, - QuantityOf<PO2::quantity-spec> Q = std::remove_cvref_t<FwdQ>> - requires std::constructible_from<quantity_type, FwdQ> && SameAbsolutePointOriginAs<PO2, PO> - constexpr quantity_point(FwdQ&& q, PO2); - - template<QuantityPointOf<absolute_point_origin> QP> - requires std::constructible_from<quantity_type, typename QP::quantity_type> - constexpr explicit(!std::convertible_to<typename QP::quantity_type, quantity_type>) - quantity_point(const QP& qp); - - template<QuantityPointLike QP> - requires see below - constexpr explicit(see below) quantity_point(const QP& qp); - - quantity_point& operator=(const quantity_point&) = default; - quantity_point& operator=(quantity_point&&) = default; - - // [qty.pt.conv], conversions - - template<SameAbsolutePointOriginAs<absolute_point_origin> NewPO> - constexpr QuantityPointOf<(NewPO{})> auto point_for(NewPO new_origin) const; - - template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below - constexpr QuantityPointOf<quantity_spec> auto in(ToU) const; - - template<RepresentationOf<quantity_spec> ToRep> - requires see below - constexpr QuantityPointOf<quantity_spec> auto in() const; - - template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below - constexpr QuantityPointOf<quantity_spec> auto in(ToU) const; - - template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below - constexpr QuantityPointOf<quantity_spec> auto force_in(ToU) const; - - template<RepresentationOf<quantity_spec> ToRep> - requires see below - constexpr QuantityPointOf<quantity_spec> auto force_in() const; - - template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below - constexpr QuantityPointOf<quantity_spec> auto force_in(ToU) const; - - // [qty.pt.obs], quantity value observers - - template<PointOrigin PO2> - requires(PO2{} == point_origin) - constexpr quantity_type& quantity_ref_from(PO2) & noexcept; - template<PointOrigin PO2> - requires(PO2{} == point_origin) - constexpr const quantity_type& quantity_ref_from(PO2) const & noexcept; - template<PointOrigin PO2> - requires(PO2{} == point_origin) - void quantity_ref_from(PO2) const && = delete; - - template<PointOrigin PO2> - requires requires(const quantity_point qp) { qp - PO2{}; } - constexpr Quantity auto quantity_from(PO2) const; - - template<QuantityPointOf<absolute_point_origin> QP> - constexpr Quantity auto quantity_from(const QP&) const; - - constexpr Quantity auto quantity_from_zero() const; - - // [qty.pt.conv.ops], conversion operations - template<typename QP_, QuantityPointLike QP = std::remove_cvref_t<QP_>> - requires see below - constexpr explicit(see below) operator QP_() const & noexcept(see below); - template<typename QP_, QuantityPointLike QP = std::remove_cvref_t<QP_>> - requires see below - constexpr explicit(see below) operator QP_() && noexcept(see below); - - // [qty.pt.unary.ops], unary operations - - template<Mutable<quantity_point> QP> - friend constexpr decltype(auto) operator++(QP&& qp) - requires see below; - template<Mutable<quantity_point> QP> - friend constexpr decltype(auto) operator--(QP&& qp) - requires see below; - - constexpr quantity_point operator++(int) - requires see below; - constexpr quantity_point operator--(int) - requires see below; - - // [qty.pt.assign.ops], compound assignment operations - template<Mutable<quantity_point> QP, auto R2, typename Rep2> - requires see below - friend constexpr decltype(auto) operator+=(QP&& qp, const quantity<R2, Rep2>& q); - template<Mutable<quantity_point> QP, auto R2, typename Rep2> - requires see below - friend constexpr decltype(auto) operator-=(QP&& qp, const quantity<R2, Rep2>& q); - - // [qty.pt.arith.ops], arithmetic operations - - template<std::derived_from<quantity_point> QP, auto R2, typename Rep2> - friend constexpr QuantityPoint auto operator+(const QP& qp, const quantity<R2, Rep2>& q) - requires see below; - template<std::derived_from<quantity_point> QP, auto R2, typename Rep2> - friend constexpr QuantityPoint auto operator+(const quantity<R2, Rep2>& q, const QP& qp) - requires see below; - template<std::derived_from<quantity_point> QP, auto R2, typename Rep2> - friend constexpr QuantityPoint auto operator-(const QP& qp, const quantity<R2, Rep2>& q) - requires see below; - - template<std::derived_from<quantity_point> QP, QuantityPointOf<absolute_point_origin> QP2> - friend constexpr Quantity auto operator-(const QP& lhs, const QP2& rhs) - requires see below; - - template<std::derived_from<quantity_point> QP, PointOrigin PO2> - requires see below - friend constexpr Quantity auto operator-(const QP& qp, PO2 po); - template<std::derived_from<quantity_point> QP, PointOrigin PO2> - requires see below - friend constexpr Quantity auto operator-(PO2 po, const QP& qp); - - // [qty.pt.cmp], comparison - template<std::derived_from<quantity_point> QP, QuantityPointOf<absolute_point_origin> QP2> - requires see below - friend constexpr bool operator==(const QP& lhs, const QP2& rhs); - template<std::derived_from<quantity_point> QP, QuantityPointOf<absolute_point_origin> QP2> - requires see below - friend constexpr auto operator<=>(const QP& lhs, const QP2& rhs); -}; - -template<Quantity Q> -explicit quantity_point(Q q) - -> quantity_point<Q::reference, default_point_origin(Q::reference), typename Q::rep>; - -template<Quantity Q, PointOriginFor<Q::quantity_spec> PO> -quantity_point(Q, PO) -> quantity_point<Q::reference, PO{}, typename Q::rep>; - -template<QuantityPointLike QP, typename Traits = quantity_point_like_traits<QP>> -explicit(quantity_point_like_traits<QP>::explicit_import) quantity_point(QP) - -> quantity_point<Traits::reference, Traits::point_origin, typename Traits::rep>; - -} -
quantity_point<R, PO, Rep> is a structural type (N4971, [temp.param]) -if Rep is a structural type.
The member absolute_point_origin is equal to PO if -is-derived-from-specialization-of<decltype(PO), absolute_point_origin>() - -is true, and -to PO.quantity-point.absolute_point_origin otherwise.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.pt.unary.ops.html b/HEAD/api_reference/gen/qty.pt.unary.ops.html deleted file mode 100644 index 8122cec6..00000000 --- a/HEAD/api_reference/gen/qty.pt.unary.ops.html +++ /dev/null @@ -1,18 +0,0 @@ -[qty.pt.unary.ops]

5 Quantities and units library [quantities]

5.7 Quantity point [qty.pt]

5.7.10 Unary operations [qty.pt.unary.ops]

In the following descriptions, -let @ be the operator.
template<Mutable<quantity_point> QP> -friend constexpr decltype(auto) operator++(QP&& qp) - requires see below; -template<Mutable<quantity_point> QP> -friend constexpr decltype(auto) operator--(QP&& qp) - requires see below; -
Effects: Equivalent to -@qp.quantity-from-origin.
Returns: std​::​forward<QP>(qp).
Remarks: The expression in the requires-clause is equivalent to: -requires { @qp.quantity-from-origin; } -
constexpr quantity_point operator++(int) - requires see below; -constexpr quantity_point operator--(int) - requires see below; -
Effects: Equivalent to: -return {quantity-from-origin@, PO};
Remarks: The expression in the requires-clause is equivalent to: -requires { quantity-from-origin@; } -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.ratio.html b/HEAD/api_reference/gen/qty.ratio.html deleted file mode 100644 index ef286a71..00000000 --- a/HEAD/api_reference/gen/qty.ratio.html +++ /dev/null @@ -1,46 +0,0 @@ -[qty.ratio]

5 Quantities and units library [quantities]

5.3 Utilities [qty.utils]

5.3.2 Ratio [qty.ratio]

namespace mp_units { - -struct ratio { // exposition only - std::intmax_t num; - std::intmax_t den; - - consteval ratio(std::intmax_t n, std::intmax_t d = 1); - - friend consteval bool operator==(ratio, ratio) = default; - friend consteval auto operator<=>(ratio lhs, ratio rhs) { return (lhs - rhs).num <=> 0; } - - friend consteval ratio operator-(ratio r) { return {-r.num, r.den}; } - - friend consteval ratio operator+(ratio lhs, ratio rhs) - { - return {lhs.num * rhs.den + lhs.den * rhs.num, lhs.den * rhs.den}; - } - - friend consteval ratio operator-(ratio lhs, ratio rhs) { return lhs + (-rhs); } - - friend consteval ratio operator*(ratio lhs, ratio rhs); - - friend consteval ratio operator/(ratio lhs, ratio rhs) - { - return lhs * ratio{rhs.den, rhs.num}; - } -}; - -consteval bool is-integral(ratio r) { return r.num % r.den == 0; } - -consteval ratio common-ratio(ratio r1, ratio r2); - -} -
ratio represents the rational number .
Unless otherwise specified, -in the following descriptions, -let R(r) be std​::​ratio<N, D>, -where N and D are the values of r.num and r.den.
consteval ratio(std::intmax_t n, std::intmax_t d = 1); -
Let N and D be the values of n and d.
Let R be std​::​ratio<N, D>.
Effects: Equivalent to -R.
Postconditions: num == R​::​num && den == R​::​den is true.
friend consteval ratio operator*(ratio lhs, ratio rhs); -
Let Res be std​::​ratio_multiply<R(lhs), R(rhs)>.
Effects: Equivalent to: -return {Res​::​num, Res​::​den};
consteval ratio common-ratio(ratio r1, ratio r2); -
Let Res be equal to -std::common_type<std::chrono::duration<int, R(r1)>, - std::chrono::duration<int, R(r2)>>::type::period -
Effects: Equivalent to: -return {Res​::​num, Res​::​den};
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.real.cpo.html b/HEAD/api_reference/gen/qty.real.cpo.html deleted file mode 100644 index 75d480e8..00000000 --- a/HEAD/api_reference/gen/qty.real.cpo.html +++ /dev/null @@ -1,8 +0,0 @@ -[qty.real.cpo]

5 Quantities and units library [quantities]

5.5 Representation [qty.rep]

5.5.3 Customization point objects [qty.rep.cpos]

5.5.3.2 mp_units​::​real [qty.real.cpo]

The name mp_units​::​real denotes a customization point object (N4971, [customization.point.object]).
Given a subexpression E with type T, -let t be an lvalue that denotes the reified object for E.
Then: -
  • If T does not model WeaklyRegular, -mp_units​::​real(E) is ill-formed.
  • If auto(t.real()) is a valid expression whose type models Scalar, -mp_units​::​real(E) is expression-equivalent to auto(t.real()).
  • Otherwise, if T is a class or enumeration type and -auto(real(t)) is a valid expression whose type models Scalar -where the meaning of real is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​real(E) is expression-equivalent to that expression.
  • Otherwise, mp_units​::​real(E) is ill-formed.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.ref.cmp.html b/HEAD/api_reference/gen/qty.ref.cmp.html deleted file mode 100644 index 7ae5e6f9..00000000 --- a/HEAD/api_reference/gen/qty.ref.cmp.html +++ /dev/null @@ -1,11 +0,0 @@ -[qty.ref.cmp]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.8 Comparison [qty.ref.cmp]

template<typename Q2, typename U2> -friend consteval bool operator==(reference, reference<Q2, U2>); -
Returns: Q{} == Q2{} && U{} == U2{}.
template<AssociatedUnit U2> -friend consteval bool operator==(reference, U2 u2); -
Returns: Q{} == get_quantity_spec(u2) && U{} == u2.
template<typename Q2, typename U2> -friend consteval bool convertible(reference, reference<Q2, U2>); -
Returns: implicitly_convertible(Q{}, Q2{}) && convertible(U{}, U2{}).
template<AssociatedUnit U2> -friend consteval bool convertible(reference, U2 u2); -
Returns: implicitly_convertible(Q{}, get_quantity_spec(u2)) && convertible(U{}, u2).
template<AssociatedUnit U1> -friend consteval bool convertible(U1 u1, reference); -
Returns: implicitly_convertible(get_quantity_spec(u1), Q{}) && convertible(u1, U{}).
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.ref.concepts.html b/HEAD/api_reference/gen/qty.ref.concepts.html deleted file mode 100644 index f55c9644..00000000 --- a/HEAD/api_reference/gen/qty.ref.concepts.html +++ /dev/null @@ -1,6 +0,0 @@ -[qty.ref.concepts]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.5 Concepts [qty.ref.concepts]

template<typename T> -concept Reference = AssociatedUnit<T> || (is-specialization-of<T, reference>()); -
A type T that satisfies Reference -represents the reference of a quantity (IEC 60050, 112-01-01).
template<typename T, auto QS> -concept ReferenceOf = Reference<T> && QuantitySpecOf<decltype(get_quantity_spec(T{})), QS>; -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.ref.general.html b/HEAD/api_reference/gen/qty.ref.general.html deleted file mode 100644 index 21cc6821..00000000 --- a/HEAD/api_reference/gen/qty.ref.general.html +++ /dev/null @@ -1,2 +0,0 @@ -[qty.ref.general]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.1 General [qty.ref.general]

Subclause [qty.ref] specifies the components -for describing the reference of a quantity (IEC 60050, 112-01-01).
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.ref.html b/HEAD/api_reference/gen/qty.ref.html deleted file mode 100644 index d53139c5..00000000 --- a/HEAD/api_reference/gen/qty.ref.html +++ /dev/null @@ -1,986 +0,0 @@ -[qty.ref]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.1 General [qty.ref.general]

Subclause [qty.ref] specifies the components -for describing the reference of a quantity (IEC 60050, 112-01-01).

5.4.2 Dimension [qty.dim]

5.4.2.1 General [qty.dim.general]

Subclause [qty.dim] specifies the components -for defining the dimension of a quantity (IEC 60050, 112-01-11).

5.4.2.2 Concepts [qty.dim.concepts]

template<typename T> -concept Dimension = SymbolicConstant<T> && std::derived_from<T, dimension-interface>; - -template<typename T> -concept BaseDimension = // exposition only - Dimension<T> && (is-derived-from-specialization-of<T, base_dimension>()); - -template<typename T, auto D> -concept DimensionOf = Dimension<T> && Dimension<decltype(D)> && (T{} == D); -

5.4.2.3 Types [qty.dim.types]

namespace mp_units { - -template<symbol_text Symbol> -struct base_dimension : dimension-interface { - static constexpr auto symbol = Symbol; // exposition only -}; - -} -
base_dimension is used -to define the dimension of a base quantity (IEC 60050, 112-01-08).
Symbol is its symbolic representation.
[Example 1: inline constexpr struct dim_length final : base_dimension<"L"> {} dim_length; - — end example]
namespace mp_units { - -template<typename... Expr> -struct derived-dimension-impl // exposition only - : expr-fractions<struct dimension_one, Expr...> {}; - -template<SymbolicConstant... Expr> -struct derived_dimension final : dimension-interface, derived-dimension-impl<Expr...> {}; - -} -
derived_dimension is used by the library -to represent the dimension of a derived quantity (IEC 60050, 112-01-10).
[Example 2: constexpr auto dim_acceleration = isq::speed.dimension / isq::dim_time; -int x = dim_acceleration; // error: cannot construct from - // derived_dimension<isq​::​dim_length, per<power<isq​::​dim_time, 2>>> - — end example]
-A program that instantiates a specialization of derived_dimension -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
namespace mp_units { - -struct dimension_one final : dimension-interface, derived-dimension-impl<> {}; - -} -
dimension_one represents the dimension of a quantity of dimension one (IEC 60050, 112-01-13).

5.4.2.4 Operations [qty.dim.ops]

namespace mp_units { - -struct dimension-interface { // exposition only - template<Dimension Lhs, Dimension Rhs> - friend consteval Dimension auto operator*(Lhs, Rhs); - - template<Dimension Lhs, Dimension Rhs> - friend consteval Dimension auto operator/(Lhs, Rhs); - - template<Dimension Lhs, Dimension Rhs> - friend consteval bool operator==(Lhs, Rhs); -}; - -} -
template<Dimension Lhs, Dimension Rhs> -friend consteval Dimension auto operator*(Lhs, Rhs); -
Returns: expr-multiply<derived_dimension, struct dimension_one>(Lhs{}, Rhs{}).
template<Dimension Lhs, Dimension Rhs> -friend consteval Dimension auto operator/(Lhs, Rhs); -
Returns: expr-divide<derived_dimension, struct dimension_one>(Lhs{}, Rhs{}).
template<Dimension Lhs, Dimension Rhs> -friend consteval bool operator==(Lhs, Rhs); -
Returns: std​::​is_same_v<Lhs, Rhs>.
consteval Dimension auto inverse(Dimension auto d); -
Returns: dimension_one / d.
template<std::intmax_t Num, std::intmax_t Den = 1, Dimension D> - requires(Den != 0) -consteval Dimension auto pow(D d); -
Returns: expr-pow<Num, Den, derived_dimension, struct dimension_one>(d).
consteval Dimension auto sqrt(Dimension auto d); -
Returns: pow<1, 2>(d).
consteval Dimension auto cbrt(Dimension auto d); -
Returns: pow<1, 3>(d).

5.4.2.5 Symbol formatting [qty.dim.sym.fmt]

template<typename CharT = char, std::output_iterator<CharT> Out, Dimension D> -constexpr Out dimension_symbol_to(Out out, D d, const dimension_symbol_formatting& fmt = {}); -
Effects: TBD.
Returns: TBD.
template<dimension_symbol_formatting fmt = {}, typename CharT = char, Dimension D> -consteval std::string_view dimension_symbol(D); -
Effects: Equivalent to: -TBD. -

5.4.3 Quantity specification [qty.spec]

5.4.3.1 General [qty.spec.general]

Subclause [qty.spec] specifies the components -for defining a quantity (IEC 60050, 112-01-01).

5.4.3.2 Concepts [qty.spec.concepts]

template<typename T> -concept QuantitySpec = SymbolicConstant<T> && std::derived_from<T, quantity-spec-interface>; - -template<typename T> -concept QuantityKindSpec = // exposition only - QuantitySpec<T> && is-specialization-of<T, kind_of_>(); - -template<typename T> -concept NamedQuantitySpec = // exposition only - QuantitySpec<T> && is-derived-from-specialization-of<T, quantity_spec>() && - (!QuantityKindSpec<T>); - -template<typename T> -concept DerivedQuantitySpec = // exposition only - QuantitySpec<T> && - (is-specialization-of<T, derived_quantity_spec>() || - (QuantityKindSpec<T> && - is-specialization-of<decltype(auto(T::quantity-spec)), derived_quantity_spec>())); - -template<auto Child, auto Parent> -concept ChildQuantitySpecOf = (is-child-of(Child, Parent)); // exposition only - -template<auto To, auto From> -concept NestedQuantityKindSpecOf = // exposition only - QuantitySpec<decltype(From)> && QuantitySpec<decltype(To)> && - (get_kind(From) != get_kind(To)) && ChildQuantitySpecOf<To, get_kind(From).quantity-spec>; - -template<auto From, auto To> -concept QuantitySpecConvertibleTo = // exposition only - QuantitySpec<decltype(From)> && QuantitySpec<decltype(To)> && implicitly_convertible(From, To); - -template<auto From, auto To> -concept QuantitySpecExplicitlyConvertibleTo = // exposition only - QuantitySpec<decltype(From)> && QuantitySpec<decltype(To)> && explicitly_convertible(From, To); - -template<auto From, auto To> -concept QuantitySpecCastableTo = // exposition only - QuantitySpec<decltype(From)> && QuantitySpec<decltype(To)> && castable(From, To); - -template<typename T, auto QS> -concept QuantitySpecOf = - QuantitySpec<T> && QuantitySpec<decltype(QS)> && QuantitySpecConvertibleTo<T{}, QS> && - !NestedQuantityKindSpecOf<T{}, QS> && - (QuantityKindSpec<T> || !NestedQuantityKindSpecOf<QS, T{}>); - -template<typename T> -concept QSProperty = (!QuantitySpec<T>); // exposition only -

5.4.3.3 Types [qty.spec.types]

5.4.3.3.1 Named [named.qty]

namespace mp_units { - -struct is_kind {}; - -template<BaseDimension auto Dim, QSProperty auto... Args> -struct quantity_spec<Dim, Args...> : quantity-spec-interface { - using base-type = quantity_spec; - static constexpr BaseDimension auto dimension = Dim; - static constexpr quantity_character character = see below; -}; - -template<DerivedQuantitySpec auto Eq, QSProperty auto... Args> -struct quantity_spec<Eq, Args...> : quantity-spec-interface { - using base-type = quantity_spec; - static constexpr auto equation = Eq; - static constexpr Dimension auto dimension = Eq.dimension; - static constexpr quantity_character character = see below; -}; - -template<NamedQuantitySpec auto QS, QSProperty auto... Args> -struct quantity_spec<QS, Args...> : quantity-spec-interface { - using base-type = quantity_spec; - static constexpr auto parent = QS; - static constexpr auto equation = parent.equation; // exposition only, present only - // if the qualified-id parent.equation is valid and denotes an object - static constexpr Dimension auto dimension = parent.dimension; - static constexpr quantity_character character = see below; -}; - -template<NamedQuantitySpec auto QS, DerivedQuantitySpec auto Eq, QSProperty auto... Args> - requires QuantitySpecExplicitlyConvertibleTo<Eq, QS> -struct quantity_spec<QS, Eq, Args...> : quantity-spec-interface { - using base-type = quantity_spec; - static constexpr auto parent = QS; - static constexpr auto equation = Eq; - static constexpr Dimension auto dimension = parent.dimension; - static constexpr quantity_character character = see below; -}; - -} -
A named quantity is a type that models NamedQuantitySpec.
A specialization of quantity_spec is used as a base type when defining a named quantity.
In the following descriptions, let Q be a named quantity defined with an alluded signature.
The identifier of Q represents its quantity name (IEC 60050, 112-01-02).
Let Ch be an enumerator value of quantity_character.
The possible arguments to quantity_spec are -
  • ,
  • ,
  • , and
  • .
If the first argument is a base quantity dimension, -then Q is that base quantity (IEC 60050, 112-01-08).
If an argument is a quantity calculus (IEC 60050, 112-01-30) C, -then Q is implicitly convertible from C.
If the first argument is a named quantity, -then Q is of its kind (IEC 60050, 112-01-04).
The member character represents -the set of the numerical value of Q ([qty.char.traits]) -and is equal to -
  • Ch if specified,
  • otherwise, quantity_character​::​real_scalar for the first signature, and
  • otherwise, (BC).character, -where BC is the argument preceding Ch in the signatures above.
is_kind specifies Q to start a new hierarchy tree of a kind.
Optional arguments may appear in any order.
[Example 1: // The first signature defines a base quantity. -inline constexpr struct length final : quantity_spec<dim_length> { -} length; // Length is a base quantity. - -// The second signature defines a derived quantity. -inline constexpr struct area final : quantity_spec<pow<2>(length)> { -} area; // An area equals length by length. - -// The third and fourth signatures add a leaf to a hierarchy of kinds. -inline constexpr struct width final : quantity_spec<length> { -} width; // Width is a kind of length. - -// The fourth signature also refines the calculus required for implicit conversions. -inline constexpr struct angular_measure final : - quantity_spec<dimensionless, arc_length / radius, is_kind> { -} angular_measure; // Requires an arc length per radius, not just any quantity of dimension one. - — end example]

5.4.3.3.2 Derived [derived.qty]

namespace mp_units { - -template<NamedQuantitySpec Q> -using to-dimension = decltype(auto(Q::dimension)); // exposition only - -template<typename... Expr> -struct derived-quantity-spec-impl : // exposition only - quantity-spec-interface, - expr-fractions<struct dimensionless, Expr...> { - using base-type = derived-quantity-spec-impl; - using base = expr-fractions<struct dimensionless, Expr...>; - - static constexpr Dimension auto dimension = - expr-map<to-dimension, derived_dimension, struct dimension_one>(base{}); - static constexpr quantity_character character = see below; -}; - -template<SymbolicConstant... Expr> -struct derived_quantity_spec final : derived-quantity-spec-impl<Expr...> {}; - -} -
derived_quantity_spec is used by the library -to represent the result of a quantity calculus not equal to a named quantity.
[Example 1: constexpr auto area = pow<2>(isq::length); -int x = area; // error: cannot construct from derived_quantity_spec<power<isq​::​length, 2>> - — end example]
-A program that instantiates a specialization of derived_quantity_spec -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
Let -
  • Nums and Dens -be packs denoting the template arguments of -base​::​nums and base​::​dens, respectively,
  • QUANTITY-CHARACTER-OF(Pack) be -std::max({quantity_character::real_scalar, expr-type<Pack>::character...}) - -and
  • num_char be QUANTITY-CHARACTER-OF(Nums) and -den_char be QUANTITY-CHARACTER-OF(Dens).
-The member character is equal to -quantity_character​::​real_scalar if num_char == den_char is true, and -std​::​max(num_char, den_char) otherwise.

5.4.3.3.3 Base quantity of dimension one [dimless.qty]

namespace mp_units { - -struct dimensionless final : quantity_spec<derived_quantity_spec<>> {}; - -} -
dimensionless represents the base quantity of dimension one (IEC 60050, 112-01-13).

5.4.3.3.4 Kind of [kind.of.qty]

namespace mp_units { - -template<QuantitySpec Q> - requires(!QuantityKindSpec<Q>) && (get-kind-tree-root(Q{}) == Q{}) -struct kind_of_ final : Q::base-type { - using base-type = kind_of_; // exposition only - static constexpr auto quantity-spec = Q{}; // exposition only -}; - -} -
kind_of<Q> represents a kind of quantity (IEC 60050, 112-01-04) Q.

5.4.3.4 Utilities [qty.spec.utils]

template<QuantitySpec auto... From, QuantitySpec Q> -consteval QuantitySpec auto clone-kind-of(Q q); // exposition only -
Effects: Equivalent to: -if constexpr ((... && QuantityKindSpec<decltype(From)>)) - return kind_of<Q{}>; -else - return q; -
template<QuantitySpec Q> -consteval auto remove-kind(Q q); // exposition only -
Effects: Equivalent to: -if constexpr (QuantityKindSpec<Q>) - return Q::quantity-spec; -else - return q; -
template<QuantitySpec QS, Unit U> - requires(!AssociatedUnit<U>) || UnitOf<U, QS{}> -consteval Reference auto make-reference(QS, U u); // exposition only -
Effects: Equivalent to: -if constexpr (requires { requires get_quantity_spec(U{}) == QS{}; }) - return u; -else - return reference<QS, U>{}; -

5.4.3.5 Operations [qty.spec.ops]

namespace mp_units { - -struct quantity-spec-interface { // exposition only - template<QuantitySpec Lhs, QuantitySpec Rhs> - friend consteval QuantitySpec auto operator*(Lhs lhs, Rhs rhs); - - template<QuantitySpec Lhs, QuantitySpec Rhs> - friend consteval QuantitySpec auto operator/(Lhs lhs, Rhs rhs); - - template<typename Self, UnitOf<Self{}> U> - consteval Reference auto operator[](this Self self, U u); - - template<typename Self, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>> - requires QuantitySpecExplicitlyConvertibleTo<Q::quantity_spec, Self{}> - constexpr Quantity auto operator()(this Self self, FwdQ&& q); - - template<QuantitySpec Lhs, QuantitySpec Rhs> - friend consteval bool operator==(Lhs, Rhs); -}; - -} -
template<QuantitySpec Lhs, QuantitySpec Rhs> -friend consteval QuantitySpec auto operator*(Lhs lhs, Rhs rhs); -
Returns: clone-kind-of<Lhs{}, Rhs{}>(expr-multiply<derived_quantity_spec, struct dimensionless>( - remove-kind(lhs), remove-kind(rhs))) -
template<QuantitySpec Lhs, QuantitySpec Rhs> -friend consteval QuantitySpec auto operator/(Lhs lhs, Rhs rhs); -
Returns: clone-kind-of<Lhs{}, Rhs{}>(expr-divide<derived_quantity_spec, struct dimensionless>( - remove-kind(lhs), remove-kind(rhs))) -
template<typename Self, UnitOf<Self{}> U> -consteval Reference auto operator[](this Self self, U u); -
Returns: make-reference(self, u).
template<typename Self, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>> - requires QuantitySpecExplicitlyConvertibleTo<Q::quantity_spec, Self{}> -constexpr Quantity auto operator()(this Self self, FwdQ&& q); -
Returns: quantity{std::forward<FwdQ>(q).numerical-value, make-reference(self, Q::unit)} -
template<QuantitySpec Lhs, QuantitySpec Rhs> -friend consteval bool operator==(Lhs, Rhs); -
Returns: std​::​is_same_v<Lhs, Rhs>.
consteval QuantitySpec auto inverse(QuantitySpec auto q); -
Returns: dimensionless / q.
template<std::intmax_t Num, std::intmax_t Den = 1, QuantitySpec Q> - requires(Den != 0) -consteval QuantitySpec auto pow(Q q); -
Returns: clone-kind-of<Q{}>( - expr-pow<Num, Den, derived_quantity_spec, struct dimensionless>(remove-kind(q))); -
consteval QuantitySpec auto sqrt(QuantitySpec auto q); -
Returns: pow<1, 2>(q).
consteval QuantitySpec auto cbrt(QuantitySpec auto q); -
Returns: pow<1, 3>(q).

5.4.3.6 Hierarchy algorithms [qty.spec.hier.algos]

5.4.3.6.1 Conversion [qty.spec.conv]

consteval bool implicitly_convertible(QuantitySpec auto from, QuantitySpec auto to); -
Returns: TBD.
consteval bool explicitly_convertible(QuantitySpec auto from, QuantitySpec auto to); -
Returns: TBD.
consteval bool castable(QuantitySpec auto from, QuantitySpec auto to); -
Returns: TBD.
consteval bool interconvertible(QuantitySpec auto qs1, QuantitySpec auto qs2); -
Returns: implicitly_convertible(qs1, qs2) && implicitly_convertible(qs2, qs1).

5.4.3.6.2 Get kind [qty.get.kind]

template<QuantitySpec Q> -consteval QuantitySpec auto get-kind-tree-root(Q q); // exposition only -
Returns:
  • If QuantityKindSpec<Q> is true, -returns remove-kind(q).
  • Otherwise, if -is-derived-from-specialization-of<Q, quantity_spec>() -is true, and -the specialization of Q​::​quantity_spec has a template argument equal to is_kind, -returns q.
  • Otherwise, if Q​::​parent is a valid expression, -returns get-kind-tree-root(Q​::​parent).
  • Otherwise, if DerivedQuantitySpec<Q> is true, -returns -expr-map<to-kind, derived_quantity_spec, struct dimensionless>(q) - -where to-kind is defined as follows: -template<QuantitySpec Q> -using to-kind = decltype(get-kind-tree-root(Q{})); // exposition only -
  • Otherwise, returns q.
template<QuantitySpec Q> -consteval QuantityKindSpec auto get_kind(Q); -
Returns: kind_of<get-kind-tree-root(Q{})>.

5.4.3.6.3 Get common quantity specification [get.common.qty.spec]

consteval QuantitySpec auto get_common_quantity_spec(QuantitySpec auto... qs) - requires see below; -
Let -
  • q1 be qs...[0],
  • q2 be qs...[1],
  • Q1 be decltype(q1),
  • Q2 be decltype(q2), and
  • rest be a pack denoting the elements of qs without q1 and q2.
Effects: Equivalent to: -if constexpr (sizeof...(qs) == 1) - return q1; -else if constexpr (sizeof...(qs) == 2) { - using QQ1 = decltype(remove-kind(q1)); - using QQ2 = decltype(remove-kind(q2)); - - if constexpr (std::is_same_v<Q1, Q2>) - return q1; - else if constexpr (NestedQuantityKindSpecOf<Q1{}, Q2{}>) - return QQ1{}; - else if constexpr (NestedQuantityKindSpecOf<Q2{}, Q1{}>) - return QQ2{}; - else if constexpr ((QuantityKindSpec<Q1> && !QuantityKindSpec<Q2>) || - (DerivedQuantitySpec<QQ1> && NamedQuantitySpec<QQ2> && - implicitly_convertible(Q1{}, Q2{}))) - return q2; - else if constexpr ((!QuantityKindSpec<Q1> && QuantityKindSpec<Q2>) || - (NamedQuantitySpec<QQ1> && DerivedQuantitySpec<QQ2> && - implicitly_convertible(Q2{}, Q1{}))) - return q1; - else if constexpr (constexpr auto common_base = get-common-base<Q1{}, Q2{}>()) - return *common_base; - else if constexpr (implicitly_convertible(Q1{}, Q2{})) - return q2; - else if constexpr (implicitly_convertible(Q2{}, Q1{})) - return q1; - else if constexpr (implicitly_convertible(get-kind-tree-root(Q1{}), - get-kind-tree-root(Q2{}))) - return get-kind-tree-root(q2); - else - return get-kind-tree-root(q1); -} else - return get_common_quantity_spec(get_common_quantity_spec(q1, q2), rest...); -
Remarks: The expression in the requires-clause is equivalent to: -(sizeof...(qs) != 0 && - (sizeof...(qs) == 1 || - (sizeof...(qs) == 2 && - (QuantitySpecConvertibleTo<get-kind-tree-root(Q1{}), get-kind-tree-root(Q2{})> || - QuantitySpecConvertibleTo<get-kind-tree-root(Q2{}), get-kind-tree-root(Q1{})>)) || - requires { get_common_quantity_spec(get_common_quantity_spec(q1, q2), rest...); })) -

5.4.3.6.4 Get common base [qty.get.common.base]

In this subclause and [qty.is.child.of], -let the kind of quantity (IEC 60050, 112-01-04) hierarchy of q be the tuple -, -where par is parent.
template<QuantitySpec auto A, QuantitySpec auto B> -consteval auto get-common-base(); // exposition only -
Let -
  • be the number of elements in h(A),
  • be the number of elements in h(B),
  • s be ,
  • A be a tuple of the last s elements of h(A), and
  • B be a tuple of the last s elements of h(B).
Effects: Looks for x, the first pair-wise equal element in A and B.
Returns: std​::​optional(x), if x is found, and std​::​optional<unspecified>() otherwise.

5.4.3.6.5 Is child of [qty.is.child.of]

template<QuantitySpec Child, QuantitySpec Parent> -consteval bool is-child-of(Child ch, Parent p); // exposition only -
Returns: If h(p) has more elements than h(ch), returns false.
Otherwise, let C be a tuple of the last s elements of h(ch), -where s is the number of elements in h(p).
Returns == p.

5.4.4 Unit [qty.unit]

5.4.4.1 General [qty.unit.general]

Subclause [qty.unit] specifies the components -for defining a unit of measurement (IEC 60050, 112-01-14).

5.4.4.2 Magnitude [qty.unit.mag]

5.4.4.2.1 General [qty.unit.mag.general]

Subclause [qty.unit.mag] specifies the components -used to represent the numerical value (IEC 60050, 112-01-29) of a unit -with support for powers (IEC 60050, 102-02-08) of real numbers (IEC 60050, 102-02-05).

5.4.4.2.2 Concepts [qty.unit.mag.concepts]

template<typename T> -concept MagConstant = SymbolicConstant<T> && is-derived-from-specialization-of<T, mag_constant>(); - -template<typename T> -concept UnitMagnitude = (is-specialization-of<T, unit-magnitude>()); - -template<typename T> -concept MagArg = std::integral<T> || MagConstant<T>; // exposition only -

5.4.4.2.3 Types [qty.unit.mag.types]

namespace mp_units { - -template<symbol_text Symbol, long double Value> - requires(Value > 0) -struct mag_constant { - static constexpr auto symbol = Symbol; // exposition only - static constexpr long double value = Value; // exposition only -}; - -} -
A specialization of mag_constant represents a real number (IEC 60050, 102-02-05).
Symbol is its symbol, and -Value is (an approximation of) its value.
namespace mp_units { - -template<auto... Ms> -struct unit-magnitude { // exposition only - // [qty.unit.mag.ops], operations - - template<UnitMagnitude M> - friend consteval UnitMagnitude auto operator*(unit-magnitude lhs, M rhs); - - friend consteval auto operator/(unit-magnitude lhs, UnitMagnitude auto rhs); - - template<UnitMagnitude Rhs> - friend consteval bool operator==(unit-magnitude, Rhs); - - template<int Num, int Den = 1> - friend consteval auto pow(unit-magnitude); // exposition only - - // [qty.unit.mag.utils], utilities - - friend consteval bool is-positive-integral-power(unit-magnitude); // exposition only - - template<auto... Ms2> - friend consteval auto common-magnitude(unit-magnitude, // exposition only - unit-magnitude<Ms2...>); -}; - -} -
A specialization of unit-magnitude -represents the product of its template arguments.
For the purposes of specifying the implementation-defined limits, -let the representation of the terms of unit-magnitude be the structure -struct { - ratio exp; - base-type base; -}; - -representing the number , -where base-type is a model of MagArg.
  • There is a single term for each base-type.
  • exp.num is not expanded into base.
    [Note 1: 
    is not permitted.
    — end note]
  • exp.den can reduce the base.
    [Note 2: 
    is permitted.
    — end note]
  • If the result of an operation on std​::​intmax_t values is undefined, -the behavior is -implementation-defined.

5.4.4.2.4 Operations [qty.unit.mag.ops]

template<UnitMagnitude M> -friend consteval UnitMagnitude auto operator*(unit-magnitude lhs, M rhs); -
Returns:
  • If sizeof...(Ms) == 0 is true, returns rhs.
  • Otherwise, if std​::​is_same_v<M, unit-magnitude<>>, returns lhs.
  • Otherwise, returns an unspecified value equal to lhs ×rhs.
friend consteval auto operator/(unit-magnitude lhs, UnitMagnitude auto rhs); -
Returns: lhs * pow<-1>(rhs).
template<UnitMagnitude Rhs> -friend consteval bool operator==(unit-magnitude, Rhs); -
Returns: std​::​is_same_v<unit-magnitude, Rhs>.
template<int Num, int Den = 1> -friend consteval auto pow(unit-magnitude base); // exposition only -
Returns:
  • If Num == 0 is true, returns unit-magnitude<>{}.
  • Otherwise, returns an unspecified value equal to .
template<MagArg auto V> -constexpr UnitMagnitude auto mag = see below; -
Constraints: V is greater than 0.
Effects: If MagConstant<decltype(V)> is satisfied, -initializes mag with unit-magnitude<V>{}.
Otherwise, initializes mag with -an unspecified value equal to V.
template<std::intmax_t N, std::intmax_t D> - requires(N > 0) -constexpr UnitMagnitude auto mag_ratio = see below; -
Effects: Initializes mag_ratio with -an unspecified value equal to .
template<MagArg auto Base, int Num, int Den = 1> -constexpr UnitMagnitude auto mag_power = pow<Num, Den>(mag<Base>); -
Constraints: Base is greater than 0.

5.4.4.2.5 Utilities [qty.unit.mag.utils]

friend consteval bool is-positive-integral-power(unit-magnitude x); // exposition only -
Returns: false if x has a negative or rational exponent, and -true otherwise.
template<auto... Ms2> -friend consteval auto common-magnitude(unit-magnitude, unit-magnitude<Ms2...>); // exposition only -
Returns: The largest magnitude C -such that each input magnitude is expressible -by only positive powers relative to C.

5.4.4.3 Traits [qty.unit.traits]

template<Unit auto U> -constexpr bool space_before_unit_symbol = true; -
The formatting functions ([qty.unit.sym.fmt]) use space_before_unit_symbol -to determine whether there is a space -between the numerical value and the unit symbol.
Remarks: Pursuant to N4971, [namespace.std] ([spec.ext]), -users may specialize space_before_unit_symbol -for cv-unqualified program-defined types.
Such specializations shall be usable in constant expressions (N4971, [expr.const]) -and have type const bool.

5.4.4.4 Concepts [qty.unit.concepts]

template<typename T> -concept Unit = SymbolicConstant<T> && std::derived_from<T, unit-interface>; - -template<typename T> -concept PrefixableUnit = Unit<T> && is-derived-from-specialization-of<T, named_unit>(); - -template<typename T> -concept AssociatedUnit = Unit<U> && has-associated-quantity(U{}); - -template<typename U, auto QS> -concept UnitOf = AssociatedUnit<U> && QuantitySpec<decltype(QS)> && - QuantitySpecConvertibleTo<get_quantity_spec(U{}), QS> && - (get_kind(QS) == get_kind(get_quantity_spec(U{})) || - !NestedQuantityKindSpecOf<get_quantity_spec(U{}), QS>); - -template<auto From, auto To> -concept UnitConvertibleTo = // exposition only - Unit<decltype(From)> && Unit<decltype(To)> && (convertible(From, To)); - -template<typename U, auto FromU, auto QS> -concept UnitCompatibleWith = // exposition only - Unit<U> && Unit<decltype(FromU)> && QuantitySpec<decltype(QS)> && - (!AssociatedUnit<U> || UnitOf<U, QS>) && UnitConvertibleTo<FromU, U{}>; - -template<typename T> -concept OffsetUnit = Unit<T> && requires { T::point-origin; }; // exposition only - -template<typename From, typename To> -concept PotentiallyConvertibleTo = // exposition only - Unit<From> && Unit<To> && - ((AssociatedUnit<From> && AssociatedUnit<To> && - implicitly_convertible(get_quantity_spec(From{}), get_quantity_spec(To{}))) || - (!AssociatedUnit<From> && !AssociatedUnit<To>)); -

5.4.4.5 Types [qty.unit.types]

5.4.4.5.1 Canonical [qty.canon.unit]

namespace mp_units { - -template<UnitMagnitude M, Unit U> -struct canonical-unit { // exposition only - M mag; - U reference_unit; -}; - -} -
canonical-unit represents a unit expressed in terms of base units (IEC 60050, 112-01-18).
[Note 1: 
Other types representing units are equal only if they have the same type.
canonical-unit is used to implement binary relations other than equality.
— end note]
reference_unit is simplified ([qty.sym.expr.algos]).
consteval auto get-canonical-unit(Unit auto u); // exposition only -
Returns: The instantiation of canonical-unit for u.

5.4.4.5.2 Scaled [qty.scaled.unit]

namespace mp_units { - -template<UnitMagnitude auto M, Unit U> - requires(M != unit-magnitude<>{} && M != mag<1>) -struct scaled_unit final : unit-interface { - using base-type = scaled_unit; // exposition only - static constexpr UnitMagnitude auto mag = M; // exposition only - static constexpr U reference-unit{}; // exposition only - static constexpr auto point-origin = U::point_origin; // exposition only, present only - // if the qualified-id U​::​point_origin is valid and denotes an object -}; - -} -
scaled_unit<M, U> is used by the library -to represent the unit M ×U.

5.4.4.5.3 Named [qty.named.unit]

namespace mp_units { - -template<symbol_text Symbol, QuantityKindSpec auto QS> - requires(!Symbol.empty()) && BaseDimension<decltype(auto(QS.dimension))> -struct named_unit<Symbol, QS> : unit-interface { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto quantity-spec = QS; // exposition only -}; - -template<symbol_text Symbol, QuantityKindSpec auto QS, PointOrigin auto PO> - requires(!Symbol.empty()) && BaseDimension<decltype(auto(QS.dimension))> -struct named_unit<Symbol, QS, PO> : unit-interface { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto quantity-spec = QS; // exposition only - static constexpr auto point-origin = PO; // exposition only -}; - -template<symbol_text Symbol> - requires(!Symbol.empty()) -struct named_unit<Symbol> : unit-interface { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only -}; - -template<symbol_text Symbol, Unit auto U> - requires(!Symbol.empty()) -struct named_unit<Symbol, U> : decltype(U)::base-type { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only -}; - -template<symbol_text Symbol, Unit auto U, PointOrigin auto PO> - requires(!Symbol.empty()) -struct named_unit<Symbol, U, PO> : decltype(U)::base-type { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto point-origin = PO; // exposition only -}; - -template<symbol_text Symbol, AssociatedUnit auto U, QuantityKindSpec auto QS> - requires(!Symbol.empty()) && (QS.dimension == get-associated-quantity(U).dimension) -struct named_unit<Symbol, U, QS> : decltype(U)::base-type { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto quantity-spec = QS; // exposition only -}; - -template<symbol_text Symbol, AssociatedUnit auto U, QuantityKindSpec auto QS, - PointOrigin auto PO> - requires(!Symbol.empty()) && (QS.dimension == get-associated-quantity(U).dimension) -struct named_unit<Symbol, U, QS, PO> : decltype(U)::base-type { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto quantity-spec = QS; // exposition only - static constexpr auto point-origin = PO; // exposition only -}; - -} -
A named unit is a type that models PrefixableUnit.
A specialization of named_unit is used as a base type when defining a named unit.
In the following descriptions, let U be a named unit defined with an alluded signature.
The identifier of U represents -its unit name (IEC 60050, 112-01-15) -or special unit name (IEC 60050, 112-01-16).
Symbol is its unit symbol (IEC 60050, 112-01-17).
The possible arguments to named_unit are -
  • ,
  • ,
  • , and
  • .
The first signature defines the unit of a base quantity -without a unit prefix (IEC 60050, 112-01-26).
The second signature defines a unit -that can be reused by several base quantities.
The third and fourth signatures with a unit expression argument E -define U as implicitly convertible from E.
The first and fourth signatures with a kind of quantity (IEC 60050, 112-01-04) Q -also restrict U to Q.
A point origin argument specifies the default point origin of U ([qty.pt.syn]).
[Example 1: // The first signature defines a base unit restricted to a kind of base quantity. -inline constexpr struct second final : named_unit<"s", kind_of<time>> { -} second; - -// The third and fourth signatures give a name to the unit argument. -inline constexpr struct minute final : named_unit<"min", mag<60> * second> { -} minute; // . - -// The fourth signature also further restricts the kind of quantity. -inline constexpr struct hertz final : named_unit<"Hz", inverse(second), kind_of<frequency>> { -} hertz; // Hz can't measure becquerel, activity, - // or any other quantity with dimension - // that isn't a kind of frequency. - — end example]

5.4.4.5.4 Prefixed [qty.prefixed.unit]

namespace mp_units { - -template<symbol_text Symbol, UnitMagnitude auto M, PrefixableUnit auto U> - requires(!Symbol.empty()) -struct prefixed_unit : decltype(M * U)::base-type { - using base-type = prefixed_unit; // exposition only - static constexpr auto symbol = Symbol + U.symbol; // exposition only -}; - -} -
prefixed_unit<Symbol, M, U> represents the unit U with a unit prefix (IEC 60050, 112-01-26).
Symbol is the symbol of the unit prefix.
M is the factor of the unit prefix.
A specialization of prefixed_unit is used as a base type when defining a unit prefix.
[Example 1: template<PrefixableUnit auto U> -struct kilo_ : prefixed_unit<"k", mag_power<10, 3>, U> {}; - -template<PrefixableUnit auto U> -constexpr kilo_<U> kilo; - -inline constexpr auto kilogram = kilo<si::gram>; - — end example]

5.4.4.5.5 Common [qty.common.unit]

namespace mp_units { - -template<Unit U1, Unit U2, Unit... Rest> -struct common_unit final : decltype(get-common-scaled-unit(U1{}, U2{}, Rest{}...))::base-type -{ - using base-type = common_unit; // exposition only - static constexpr auto common-unit = // exposition only - get-common-scaled-unit(U1{}, U2{}, Rest{}...); -}; - -} -
common_unit is used by the library -to encapsulate a conversion factor between units (IEC 60050, 112-01-33) -common to the operands of quantity addition.
[Example 1: 
The result of 1 * km + 1 * mi -has a common unit -encapsulated by common_unit<mi, km>.
— end example]
-A program that instantiates a specialization of common_unit -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
template<Unit U1, Unit U2, Unit... Rest> -consteval Unit auto get-common-scaled-unit(U1, U2, Rest... rest) // exposition only - requires see below; -
Effects: Equivalent to: -constexpr auto res = [] { - constexpr auto canonical_lhs = get-canonical-unit(U1{}); - constexpr auto canonical_rhs = get-canonical-unit(U2{}); - constexpr auto common_mag = common-magnitude(canonical_lhs.mag, canonical_rhs.mag); - if constexpr (common_mag == mag<1>) - return canonical_lhs.reference_unit; - else - return scaled_unit<common_mag, decltype(auto(canonical_lhs.reference_unit))>{}; -}(); -if constexpr (sizeof...(rest) == 0) - return res; -else - return get-common-scaled-unit(res, rest...); -
Remarks: The expression in the requires-clause is equivalent to: -(convertible(U1{}, U2{}) && (sizeof...(Rest) == 0 || requires { - get-common-scaled-unit(get-common-scaled-unit(u1, u2), rest...); - })) -

5.4.4.5.6 Derived [qty.derived.unit]

namespace mp_units { - -template<typename... Expr> -struct derived-unit-impl : // exposition only - unit-interface, - expr-fractions<struct one, Expr...> { - using base-type = derived-unit-impl; // exposition only -}; - -template<SymbolicConstant... Expr> -struct derived_unit final : derived-unit-impl<Expr...> {}; - -} -
derived_unit is used by the library -to represent a derived unit (IEC 60050, 112-01-19).
[Example 1: using namespace si::unit_symbols; -int x = m * m; // error: cannot construct from derived_unit<power<si​::​metre, 2>> -int y = m * s; // error: cannot construct from derived_unit<si​::​metre, si​::​second> -int z = m / s; // error: cannot construct from derived_unit<si​::​metre, per<si​::​second>> - — end example]
-A program that instantiates a specialization of derived_unit -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.

5.4.4.5.7 One [qty.unit.one]

namespace mp_units { - -struct one final : derived-unit-impl<> {}; - -} -
one represents the base unit (IEC 60050, 112-01-18) of a quantity of dimension one (IEC 60050, 112-01-13).

5.4.4.6 Operations [qty.unit.ops]

namespace mp_units { - -struct unit-interface { // exposition only - template<UnitMagnitude M, Unit U> - friend consteval Unit auto operator*(M, U u); - - friend consteval Unit auto operator*(Unit auto, UnitMagnitude auto) = delete; - - template<UnitMagnitude M, Unit U> - friend consteval Unit auto operator/(M mag, U u); - - template<Unit Lhs, Unit Rhs> - friend consteval Unit auto operator*(Lhs lhs, Rhs rhs); - - template<Unit Lhs, Unit Rhs> - friend consteval Unit auto operator/(Lhs lhs, Rhs rhs); - - // [qty.unit.cmp], comparison - - template<Unit Lhs, Unit Rhs> - friend consteval bool operator==(Lhs, Rhs); - - template<Unit Lhs, Unit Rhs> - friend consteval bool equivalent(Lhs lhs, Rhs rhs); -}; - -} -
template<UnitMagnitude M, Unit U> -friend consteval Unit auto operator*(M, U u); -
Effects: Equivalent to: -if constexpr (std::is_same_v<M, decltype(auto(mag<1>))>) - return u; -else if constexpr (is-specialization-of<U, scaled_unit>()) { - if constexpr (M{} * U::mag == mag<1>) - return U::reference-unit; - else - return scaled_unit<M{} * U::mag, decltype(auto(U::reference-unit))>{}; -} else - return scaled_unit<M{}, U>{}; -
friend consteval Unit auto operator*(Unit auto, UnitMagnitude auto) = delete; -
Recommended practice: Suggest swapping the operands.
template<UnitMagnitude M, Unit U> -friend consteval Unit auto operator/(M mag, U u); -
Returns: mag * inverse(u).
template<Unit Lhs, Unit Rhs> -friend consteval Unit auto operator*(Lhs lhs, Rhs rhs); -
Returns: expr-multiply<derived_unit, struct one>(lhs, rhs).
template<Unit Lhs, Unit Rhs> -friend consteval Unit auto operator/(Lhs lhs, Rhs rhs); -
Returns: expr-divide<derived_unit, struct one>(lhs, rhs).
consteval Unit auto inverse(Unit auto u); -
Returns: one / u.
template<std::intmax_t Num, std::intmax_t Den = 1, Unit U> - requires(Den != 0) -consteval Unit auto pow(U u); -
Returns: expr-pow<Num, Den, derived_unit, struct one>(u).
consteval Unit auto sqrt(Unit auto u); -
Returns: pow<1, 2>(u).
consteval Unit auto cbrt(Unit auto u); -
Returns: pow<1, 3>(u).
consteval Unit auto square(Unit auto u); -
Returns: pow<2>(u).
consteval Unit auto cubic(Unit auto u); -
Returns: pow<3>(u).

5.4.4.7 Comparison [qty.unit.cmp]

template<Unit Lhs, Unit Rhs> -friend consteval bool operator==(Lhs, Rhs); -
Returns: std​::​is_same_v<Lhs, Rhs>.
template<Unit Lhs, Unit Rhs> -friend consteval bool equivalent(Lhs lhs, Rhs rhs); -
Effects: Equivalent to: -const auto lhs_canonical = get-canonical-unit(lhs); -const auto rhs_canonical = get-canonical-unit(rhs); -return lhs_canonical.mag == rhs_canonical.mag && - lhs_canonical.reference_unit == rhs_canonical.reference_unit; -
template<Unit From, Unit To> -consteval bool convertible(From from, To to); -
Effects: Equivalent to: -if constexpr (std::is_same_v<From, To>) - return true; -else if constexpr (PotentiallyConvertibleTo<From, To>) - return std::is_same_v<decltype(get-canonical-unit(from).reference_unit), - decltype(get-canonical-unit(to).reference_unit)>; -else - return false; -

5.4.4.8 Observers [qty.unit.obs]

consteval QuantitySpec auto get_quantity_spec(AssociatedUnit auto u); -
Returns: kind_of<get-associated-quantity(u)>.
consteval Unit auto get_unit(AssociatedUnit auto u); -
Returns: u.
consteval Unit auto get_common_unit(Unit auto... us) - requires see below; -
Let -
  • u1 be us...[0],
  • u2 be us...[1],
  • U1 be decltype(u1),
  • U2 be decltype(u2), and
  • rest be a pack denoting the elements of us without u1 and u2.
Effects: Equivalent to: -if constexpr (sizeof...(us) == 1) - return u1; -else if constexpr (sizeof...(us) == 2) { - if constexpr (is-derived-from-specialization-of<U1, common_unit>()) { - return TBD.; - } else if constexpr (is-derived-from-specialization-of<U2, common_unit>()) - return get_common_unit(u2, u1); - else if constexpr (std::is_same_v<U1, U2>) - return u1; - else if constexpr (equivalent(U1{}, U2{})) { - if constexpr (std::derived_from<U1, typename U2::base-type>) - return u1; - else if constexpr (std::derived_from<U2, typename U1::base-type>) - return u2; - else - return std::conditional_t<type-less-impl<U1, U2>(), U1, U2>{}; - } else { - constexpr auto canonical_lhs = get-canonical-unit(U1{}); - constexpr auto canonical_rhs = get-canonical-unit(U2{}); - - if constexpr (is-positive-integral-power(canonical_lhs.mag / canonical_rhs.mag)) - return u2; - else if constexpr (is-positive-integral-power(canonical_rhs.mag / canonical_lhs.mag)) - return u1; - else { - if constexpr (type-less<U1, U2>{}) - return common_unit<U1, U2>{}; - else - return common_unit<U2, U1>{}; - } - } -} else - return get_common_unit(get_common_unit(u1, u2), rest...); -
Remarks: The expression in the requires-clause is equivalent to: -(sizeof...(us) != 0 && (sizeof...(us) == 1 || // - (sizeof...(us) == 2 && convertible(U1{}, U2{})) || - requires { get_common_unit(get_common_unit(u1, u2), rest...); })) -

5.4.4.9 Associated quantity [assoc.qty]

template<Unit U> -consteval bool has-associated-quantity(U); // exposition only -
Returns:
  • If U​::​quantity-spec is a valid expression, -returns true.
  • Otherwise, if U​::​reference-unit is a valid expression, -returns -has-associated-quantity(U::reference-unit) -
  • Otherwise, if -is-derived-from-specialization-of<U, expr-fractions>() -is true, -let Nums and Dens -be packs denoting the template arguments of -U​::​nums and U​::​dens, respectively.
    Returns -(... && has-associated-quantity(expr-type<Nums>{})) && - (... && has-associated-quantity(expr-type<Dens>{})) -
  • Otherwise, returns false.
template<AssociatedUnit U> -consteval auto get-associated-quantity(U u); // exposition only -
Returns:
  • If U is of the form common_unit<Us...>, -returns -get_common_quantity_spec(get-associated-quantity(Us{})...) -
  • Otherwise, if U​::​quantity-spec is a valid expression, -returns -remove-kind(U::quantity-spec) -
  • Otherwise, if U​::​reference-unit is a valid expression, -returns -get-associated-quantity(U::reference-unit) -
  • Otherwise, if -is-derived-from-specialization-of<U, expr-fractions>() -is true, -returns -expr-map<to-quantity-spec, derived_quantity_spec, struct dimensionless>(u) - -where to-quantity-spec is defined as follows: -template<AssociatedUnit U> -using to-quantity-spec = decltype(get-associated-quantity(U{})); // exposition only -

5.4.4.10 Symbol formatting [qty.unit.sym.fmt]

template<typename CharT = char, std::output_iterator<CharT> Out, Unit U> -constexpr Out unit_symbol_to(Out out, U u, const unit_symbol_formatting& fmt = {}); -
Effects: TBD.
Returns: TBD.
template<unit_symbol_formatting fmt = {}, typename CharT = char, Unit U> -consteval std::string_view unit_symbol(U); -
Effects: Equivalent to: -TBD. -

5.4.5 Concepts [qty.ref.concepts]

template<typename T> -concept Reference = AssociatedUnit<T> || (is-specialization-of<T, reference>()); -
A type T that satisfies Reference -represents the reference of a quantity (IEC 60050, 112-01-01).
template<typename T, auto QS> -concept ReferenceOf = Reference<T> && QuantitySpecOf<decltype(get_quantity_spec(T{})), QS>; -

5.4.6 Class template reference [qty.ref.syn]

namespace mp_units { - -template<QuantitySpec auto Q, Unit auto U> -using reference-t = reference<decltype(Q), decltype(U)>; // exposition only - -template<QuantitySpec Q, Unit U> -struct reference { - // [qty.ref.ops], operations - - template<typename Q2, typename U2> - friend consteval auto operator*(reference, reference<Q2, U2>) - -> reference-t<Q{} * Q2{}, U{} * U2{}>; - - template<AssociatedUnit U2> - friend consteval auto operator*(reference, U2) - -> reference-t<Q{} * get_quantity_spec(U2{}), U{} * U2{}>; - - template<AssociatedUnit U1> - friend consteval auto operator*(U1, reference) - -> reference-t<get_quantity_spec(U1{}) * Q{}, U1{} * U{}>; - - template<typename Q2, typename U2> - friend consteval auto operator/(reference, reference<Q2, U2>) - -> reference-t<Q{} / Q2{}, U{} / U2{}>; - - template<AssociatedUnit U2> - friend consteval auto operator/(reference, U2) - -> reference-t<Q{} / get_quantity_spec(U2{}), U{} / U2{}>; - - template<AssociatedUnit U1> - friend consteval auto operator/(U1, reference) - -> reference-t<get_quantity_spec(U1{}) / Q{}, U1{} / U{}>; - - friend consteval auto inverse(reference) -> reference-t<inverse(Q{}), inverse(U{})>; - - template<std::intmax_t Num, std::intmax_t Den = 1> - requires(Den != 0) - friend consteval auto pow(reference) -> reference-t<pow<Num, Den>(Q{}), pow<Num, Den>(U{})>; - friend consteval auto sqrt(reference) -> reference-t<sqrt(Q{}), sqrt(U{})>; - friend consteval auto cbrt(reference) -> reference-t<cbrt(Q{}), cbrt(U{})>; - - // [qty.ref.cmp], comparison - - template<typename Q2, typename U2> - friend consteval bool operator==(reference, reference<Q2, U2>); - - template<AssociatedUnit U2> - friend consteval bool operator==(reference, U2 u2); - - template<typename Q2, typename U2> - friend consteval bool convertible(reference, reference<Q2, U2>); - - template<AssociatedUnit U2> - friend consteval bool convertible(reference, U2 u2); - - template<AssociatedUnit U1> - friend consteval bool convertible(U1 u1, reference); -}; - -} -
reference<Q, U> represents the reference of a quantity (IEC 60050, 112-01-01).
The unit of measurement U (IEC 60050, 112-01-14) -is used to measure a value of the quantity Q (IEC 60050, 112-01-28).
[Note 1: 
reference is typically implicitly instantiated -when specifying that a unit measures a more specific quantity.
[Example 1: using namespace si::unit_symbols; -auto x = 1 * m; // measures a length -auto y = 1 * isq::width[m]; // measures a width -auto z = 1 * isq::diameter[m]; // measures a diameter - — end example]
— end note]

5.4.7 Operations [qty.ref.ops]

Each member function with a trailing-return-type -of -> reference-t<T...> -returns {}.
template<typename FwdRep, Reference R, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> - requires(!OffsetUnit<decltype(get_unit(R{}))>) -constexpr quantity<R{}, Rep> operator*(FwdRep&& lhs, R r); -
Effects: Equivalent to: -return quantity{std​::​forward<FwdRep>(lhs), r};
template<typename FwdRep, Reference R, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> - requires(!OffsetUnit<decltype(get_unit(R{}))>) -constexpr Quantity auto operator/(FwdRep&& lhs, R); -
Effects: Equivalent to: -return quantity{std​::​forward<FwdRep>(lhs), inverse(R{})};
template<typename FwdQ, Reference R, Quantity Q = std::remove_cvref_t<FwdQ>> -constexpr Quantity auto operator*(FwdQ&& q, R); -template<typename FwdQ, Reference R, Quantity Q = std::remove_cvref_t<FwdQ>> -constexpr Quantity auto operator/(FwdQ&& q, R); -
Let @ be the operator.
Effects: Equivalent to: -return quantity{std::forward<FwdQ>(q).numerical-value, Q::reference @ R{}}; -
template<Reference R, typename Rep> - requires RepresentationOf<std::remove_cvref_t<Rep>, get_quantity_spec(R{})> -constexpr auto operator*(R, Rep&&) = delete; - -template<Reference R, typename Rep> - requires RepresentationOf<std::remove_cvref_t<Rep>, get_quantity_spec(R{})> -constexpr auto operator/(R, Rep&&) = delete; - -template<Reference R, typename Q> - requires Quantity<std::remove_cvref_t<Q>> -constexpr auto operator*(R, Q&&) = delete; - -template<Reference R, typename Q> - requires Quantity<std::remove_cvref_t<Q>> -constexpr auto operator/(R, Q&&) = delete; -
Recommended practice: Suggest swapping the operands.

5.4.8 Comparison [qty.ref.cmp]

template<typename Q2, typename U2> -friend consteval bool operator==(reference, reference<Q2, U2>); -
Returns: Q{} == Q2{} && U{} == U2{}.
template<AssociatedUnit U2> -friend consteval bool operator==(reference, U2 u2); -
Returns: Q{} == get_quantity_spec(u2) && U{} == u2.
template<typename Q2, typename U2> -friend consteval bool convertible(reference, reference<Q2, U2>); -
Returns: implicitly_convertible(Q{}, Q2{}) && convertible(U{}, U2{}).
template<AssociatedUnit U2> -friend consteval bool convertible(reference, U2 u2); -
Returns: implicitly_convertible(Q{}, get_quantity_spec(u2)) && convertible(U{}, u2).
template<AssociatedUnit U1> -friend consteval bool convertible(U1 u1, reference); -
Returns: implicitly_convertible(get_quantity_spec(u1), Q{}) && convertible(u1, U{}).

5.4.9 Observers [qty.ref.obs]

template<typename Q, typename U> -consteval QuantitySpec auto get_quantity_spec(reference<Q, U>); -
Returns: Q{}.
template<typename Q, typename U> -consteval Unit auto get_unit(reference<Q, U>); -
Returns: U{}.
consteval AssociatedUnit auto get_common_reference(AssociatedUnit auto u1, - AssociatedUnit auto u2, - AssociatedUnit auto... rest) - requires see below; -
Returns: get_common_unit(u1, u2, rest...).
Remarks: The expression in the requires-clause is equivalent to: -requires { - get_common_quantity_spec(get_quantity_spec(u1), get_quantity_spec(u2), - get_quantity_spec(rest)...); - { get_common_unit(u1, u2, rest...) } -> AssociatedUnit; -} -
template<Reference R1, Reference R2, Reference... Rest> -consteval Reference auto get_common_reference(R1 r1, R2 r2, Rest... rest) - requires see below; -
Returns: reference-t<get_common_quantity_spec(get_quantity_spec(R1{}), get_quantity_spec(R2{}), - get_quantity_spec(rest)...), - get_common_unit(get_unit(R1{}), get_unit(R2{}), get_unit(rest)...)>{}; -
Remarks: The expression in the requires-clause is equivalent to: -requires { - get_common_quantity_spec(get_quantity_spec(r1), get_quantity_spec(r2), - get_quantity_spec(rest)...); - get_common_unit(get_unit(r1), get_unit(r2), get_unit(rest)...); -} -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.ref.obs.html b/HEAD/api_reference/gen/qty.ref.obs.html deleted file mode 100644 index b184b733..00000000 --- a/HEAD/api_reference/gen/qty.ref.obs.html +++ /dev/null @@ -1,27 +0,0 @@ -[qty.ref.obs]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.9 Observers [qty.ref.obs]

template<typename Q, typename U> -consteval QuantitySpec auto get_quantity_spec(reference<Q, U>); -
Returns: Q{}.
template<typename Q, typename U> -consteval Unit auto get_unit(reference<Q, U>); -
Returns: U{}.
consteval AssociatedUnit auto get_common_reference(AssociatedUnit auto u1, - AssociatedUnit auto u2, - AssociatedUnit auto... rest) - requires see below; -
Returns: get_common_unit(u1, u2, rest...).
Remarks: The expression in the requires-clause is equivalent to: -requires { - get_common_quantity_spec(get_quantity_spec(u1), get_quantity_spec(u2), - get_quantity_spec(rest)...); - { get_common_unit(u1, u2, rest...) } -> AssociatedUnit; -} -
template<Reference R1, Reference R2, Reference... Rest> -consteval Reference auto get_common_reference(R1 r1, R2 r2, Rest... rest) - requires see below; -
Returns: reference-t<get_common_quantity_spec(get_quantity_spec(R1{}), get_quantity_spec(R2{}), - get_quantity_spec(rest)...), - get_common_unit(get_unit(R1{}), get_unit(R2{}), get_unit(rest)...)>{}; -
Remarks: The expression in the requires-clause is equivalent to: -requires { - get_common_quantity_spec(get_quantity_spec(r1), get_quantity_spec(r2), - get_quantity_spec(rest)...); - get_common_unit(get_unit(r1), get_unit(r2), get_unit(rest)...); -} -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.ref.ops.html b/HEAD/api_reference/gen/qty.ref.ops.html deleted file mode 100644 index 9b19bf85..00000000 --- a/HEAD/api_reference/gen/qty.ref.ops.html +++ /dev/null @@ -1,34 +0,0 @@ -[qty.ref.ops]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.7 Operations [qty.ref.ops]

Each member function with a trailing-return-type -of -> reference-t<T...> -returns {}.
template<typename FwdRep, Reference R, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> - requires(!OffsetUnit<decltype(get_unit(R{}))>) -constexpr quantity<R{}, Rep> operator*(FwdRep&& lhs, R r); -
Effects: Equivalent to: -return quantity{std​::​forward<FwdRep>(lhs), r};
template<typename FwdRep, Reference R, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> - requires(!OffsetUnit<decltype(get_unit(R{}))>) -constexpr Quantity auto operator/(FwdRep&& lhs, R); -
Effects: Equivalent to: -return quantity{std​::​forward<FwdRep>(lhs), inverse(R{})};
template<typename FwdQ, Reference R, Quantity Q = std::remove_cvref_t<FwdQ>> -constexpr Quantity auto operator*(FwdQ&& q, R); -template<typename FwdQ, Reference R, Quantity Q = std::remove_cvref_t<FwdQ>> -constexpr Quantity auto operator/(FwdQ&& q, R); -
Let @ be the operator.
Effects: Equivalent to: -return quantity{std::forward<FwdQ>(q).numerical-value, Q::reference @ R{}}; -
template<Reference R, typename Rep> - requires RepresentationOf<std::remove_cvref_t<Rep>, get_quantity_spec(R{})> -constexpr auto operator*(R, Rep&&) = delete; - -template<Reference R, typename Rep> - requires RepresentationOf<std::remove_cvref_t<Rep>, get_quantity_spec(R{})> -constexpr auto operator/(R, Rep&&) = delete; - -template<Reference R, typename Q> - requires Quantity<std::remove_cvref_t<Q>> -constexpr auto operator*(R, Q&&) = delete; - -template<Reference R, typename Q> - requires Quantity<std::remove_cvref_t<Q>> -constexpr auto operator/(R, Q&&) = delete; -
Recommended practice: Suggest swapping the operands.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.ref.syn.html b/HEAD/api_reference/gen/qty.ref.syn.html deleted file mode 100644 index da53423f..00000000 --- a/HEAD/api_reference/gen/qty.ref.syn.html +++ /dev/null @@ -1,67 +0,0 @@ -[qty.ref.syn]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.6 Class template reference [qty.ref.syn]

namespace mp_units { - -template<QuantitySpec auto Q, Unit auto U> -using reference-t = reference<decltype(Q), decltype(U)>; // exposition only - -template<QuantitySpec Q, Unit U> -struct reference { - // [qty.ref.ops], operations - - template<typename Q2, typename U2> - friend consteval auto operator*(reference, reference<Q2, U2>) - -> reference-t<Q{} * Q2{}, U{} * U2{}>; - - template<AssociatedUnit U2> - friend consteval auto operator*(reference, U2) - -> reference-t<Q{} * get_quantity_spec(U2{}), U{} * U2{}>; - - template<AssociatedUnit U1> - friend consteval auto operator*(U1, reference) - -> reference-t<get_quantity_spec(U1{}) * Q{}, U1{} * U{}>; - - template<typename Q2, typename U2> - friend consteval auto operator/(reference, reference<Q2, U2>) - -> reference-t<Q{} / Q2{}, U{} / U2{}>; - - template<AssociatedUnit U2> - friend consteval auto operator/(reference, U2) - -> reference-t<Q{} / get_quantity_spec(U2{}), U{} / U2{}>; - - template<AssociatedUnit U1> - friend consteval auto operator/(U1, reference) - -> reference-t<get_quantity_spec(U1{}) / Q{}, U1{} / U{}>; - - friend consteval auto inverse(reference) -> reference-t<inverse(Q{}), inverse(U{})>; - - template<std::intmax_t Num, std::intmax_t Den = 1> - requires(Den != 0) - friend consteval auto pow(reference) -> reference-t<pow<Num, Den>(Q{}), pow<Num, Den>(U{})>; - friend consteval auto sqrt(reference) -> reference-t<sqrt(Q{}), sqrt(U{})>; - friend consteval auto cbrt(reference) -> reference-t<cbrt(Q{}), cbrt(U{})>; - - // [qty.ref.cmp], comparison - - template<typename Q2, typename U2> - friend consteval bool operator==(reference, reference<Q2, U2>); - - template<AssociatedUnit U2> - friend consteval bool operator==(reference, U2 u2); - - template<typename Q2, typename U2> - friend consteval bool convertible(reference, reference<Q2, U2>); - - template<AssociatedUnit U2> - friend consteval bool convertible(reference, U2 u2); - - template<AssociatedUnit U1> - friend consteval bool convertible(U1 u1, reference); -}; - -} -
reference<Q, U> represents the reference of a quantity (IEC 60050, 112-01-01).
The unit of measurement U (IEC 60050, 112-01-14) -is used to measure a value of the quantity Q (IEC 60050, 112-01-28).
[Note 1: 
reference is typically implicitly instantiated -when specifying that a unit measures a more specific quantity.
[Example 1: using namespace si::unit_symbols; -auto x = 1 * m; // measures a length -auto y = 1 * isq::width[m]; // measures a width -auto z = 1 * isq::diameter[m]; // measures a diameter - — end example]
— end note]
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.rel.pt.orig.html b/HEAD/api_reference/gen/qty.rel.pt.orig.html deleted file mode 100644 index 27e9b67f..00000000 --- a/HEAD/api_reference/gen/qty.rel.pt.orig.html +++ /dev/null @@ -1,18 +0,0 @@ -[qty.rel.pt.orig]

5 Quantities and units library [quantities]

5.7 Quantity point [qty.pt]

5.7.2 Point origin [qty.pt.orig]

5.7.2.3 Types [qty.pt.orig.types]

5.7.2.3.2 Relative [qty.rel.pt.orig]

namespace mp_units { - -template<QuantityPoint auto QP> -struct relative_point_origin : point-origin-interface { - static constexpr QuantityPoint auto quantity-point = QP; // exposition only - static constexpr QuantitySpec auto quantity-spec = see below; // exposition only - static constexpr PointOrigin auto absolute-point-origin = // exposition only - QP.absolute_point_origin; -}; - -} -
A relative origin is an origin -of a subspace (IEC 60050, 102-03-03).
A specialization of relative_point_origin is used as a base type when defining a relative origin O.
O is offset from QP.absolute_point_origin by QP.quantity_from_zero().
The member quantity-spec is equal to -QP.point_origin.quantity-spec if -QuantityKindSpec<decltype(auto(QP.quantity-spec))> - -is satisfied, and -to QP.quantity-spec otherwise.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.rep.concepts.html b/HEAD/api_reference/gen/qty.rep.concepts.html deleted file mode 100644 index 3ee6ab81..00000000 --- a/HEAD/api_reference/gen/qty.rep.concepts.html +++ /dev/null @@ -1,88 +0,0 @@ -[qty.rep.concepts]

5 Quantities and units library [quantities]

5.5 Representation [qty.rep]

5.5.4 Concepts [qty.rep.concepts]

template<typename T> -concept WeaklyRegular = std::copyable<T> && std::equality_comparable<T>; // exposition only - -template<typename T> -concept Scalar = (!disable_scalar<T>) && WeaklyRegular<T> && requires(T a, T b) { // exposition only - // scalar operations - { -a } -> std::common_with<T>; - { a + b } -> std::common_with<T>; - { a - b } -> std::common_with<T>; - { a * b } -> std::common_with<T>; - { a / b } -> std::common_with<T>; -}; -
TBD.
template<typename T> -using value-type-t = actual-value-type-t<T>; // exposition only, see [qty.fp.traits] - -template<typename T> -concept Complex = // exposition only - (!disable_complex<T>) && WeaklyRegular<T> && Scalar<value-type-t<T>> && - std::constructible_from<T, value-type-t<T>, value-type-t<T>> && - requires(T a, T b, value-type-t<T> s) { - // complex operations - { -a } -> std::common_with<T>; - { a + b } -> std::common_with<T>; - { a - b } -> std::common_with<T>; - { a * b } -> std::common_with<T>; - { a / b } -> std::common_with<T>; - { a * s } -> std::common_with<T>; - { s * a } -> std::common_with<T>; - { a / s } -> std::common_with<T>; - ::mp_units::real(a); - ::mp_units::imag(a); - ::mp_units::modulus(a); - }; -
TBD.
template<typename T> -concept Vector = // exposition only - (!disable_vector<T>) && WeaklyRegular<T> && Scalar<value-type-t<T>> && - requires(T a, T b, value-type-t<T> s) { - // vector operations - { -a } -> std::common_with<T>; - { a + b } -> std::common_with<T>; - { a - b } -> std::common_with<T>; - { a * s } -> std::common_with<T>; - { s * a } -> std::common_with<T>; - { a / s } -> std::common_with<T>; - ::mp_units::magnitude(a); - }; -
TBD.
template<typename T> -using scaling-factor-type-t = // exposition only - std::conditional_t<treat_as_floating_point<T>, long double, std::intmax_t>; - -template<typename T> -concept ScalarRepresentation = // exposition only - (!is-specialization-of<T, quantity>()) && Scalar<T> && - requires(T a, T b, scaling-factor-type-t<T> f) { - // scaling - { a * f } -> std::common_with<T>; - { f * a } -> std::common_with<T>; - { a / f } -> std::common_with<T>; - }; -
TBD.
template<typename T> -concept ComplexRepresentation = // exposition only - (!is-specialization-of<T, quantity>()) && Complex<T> && - requires(T a, T b, scaling-factor-type-t<T> f) { - // scaling - { a * T(f) } -> std::common_with<T>; - { T(f) * a } -> std::common_with<T>; - { a / T(f) } -> std::common_with<T>; - }; -
TBD.
template<typename T> -concept VectorRepresentation = // exposition only - (!is-specialization-of<T, quantity>()) && Vector<T>; -
TBD.
template<typename T> -concept Representation = ScalarRepresentation<T> || ComplexRepresentation<T> || - VectorRepresentation<T>; -
A type T models Representation if -it represents the numerical value of a quantity (IEC 60050, 112-01-29).
template<typename T, quantity_character Ch> -concept IsOfCharacter = (Ch == quantity_character::real_scalar && Scalar<T>) || // exposition only - (Ch == quantity_character::complex_scalar && Complex<T>) || - (Ch == quantity_character::vector && Vector<T>); - -template<typename T, auto V> -concept RepresentationOf = - Representation<T> && ((QuantitySpec<decltype(V)> && - (QuantityKindSpec<decltype(V)> || IsOfCharacter<T, V.character>)) || - (std::same_as<quantity_character, decltype(V)> && IsOfCharacter<T, V>)); -
A type T models RepresentationOf<V> if -T models Representation and -
  • V is a kind of quantity, or
  • if V is a quantity, then T represents a value of its character, or
  • if V is a quantity character, then T represents a value of V.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.rep.cpos.general.html b/HEAD/api_reference/gen/qty.rep.cpos.general.html deleted file mode 100644 index c2b6f5b6..00000000 --- a/HEAD/api_reference/gen/qty.rep.cpos.general.html +++ /dev/null @@ -1,2 +0,0 @@ -[qty.rep.cpos.general]

5 Quantities and units library [quantities]

5.5 Representation [qty.rep]

5.5.3 Customization point objects [qty.rep.cpos]

5.5.3.1 General [qty.rep.cpos.general]

\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.rep.cpos.html b/HEAD/api_reference/gen/qty.rep.cpos.html deleted file mode 100644 index e9b33ef0..00000000 --- a/HEAD/api_reference/gen/qty.rep.cpos.html +++ /dev/null @@ -1,38 +0,0 @@ -[qty.rep.cpos]

5 Quantities and units library [quantities]

5.5 Representation [qty.rep]

5.5.3 Customization point objects [qty.rep.cpos]

5.5.3.1 General [qty.rep.cpos.general]

Within subclause [qty.rep.cpos], -reified object is as defined in N4971, [range.access.general].

5.5.3.2 mp_units​::​real [qty.real.cpo]

The name mp_units​::​real denotes a customization point object (N4971, [customization.point.object]).
Given a subexpression E with type T, -let t be an lvalue that denotes the reified object for E.
Then: -
  • If T does not model WeaklyRegular, -mp_units​::​real(E) is ill-formed.
  • If auto(t.real()) is a valid expression whose type models Scalar, -mp_units​::​real(E) is expression-equivalent to auto(t.real()).
  • Otherwise, if T is a class or enumeration type and -auto(real(t)) is a valid expression whose type models Scalar -where the meaning of real is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​real(E) is expression-equivalent to that expression.
  • Otherwise, mp_units​::​real(E) is ill-formed.

5.5.3.3 mp_units​::​imag [qty.imag.cpo]

The name mp_units​::​imag denotes a customization point object (N4971, [customization.point.object]).
Given a subexpression E with type T, -let t be an lvalue that denotes the reified object for E.
Then: -
  • If T does not model WeaklyRegular, -mp_units​::​imag(E) is ill-formed.
  • If auto(t.imag()) is a valid expression whose type models Scalar, -mp_units​::​imag(E) is expression-equivalent to auto(t.imag()).
  • Otherwise, if T is a class or enumeration type and -auto(imag(t)) is a valid expression whose type models Scalar -where the meaning of imag is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​imag(E) is expression-equivalent to that expression.
  • Otherwise, mp_units​::​imag(E) is ill-formed.

5.5.3.4 mp_units​::​modulus [qty.modulus.cpo]

The name mp_units​::​modulus denotes a customization point object (N4971, [customization.point.object]).
Given a subexpression E with type T, -let t be an lvalue that denotes the reified object for E.
Then: -
  • If T does not model WeaklyRegular, -mp_units​::​modulus(E) is ill-formed.
  • If auto(t.modulus()) is a valid expression whose type models Scalar, -mp_units​::​modulus(E) is expression-equivalent to auto(t.modulus()).
  • Otherwise, if T is a class or enumeration type and -auto(modulus(t)) is a valid expression whose type models Scalar -where the meaning of modulus is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​modulus(E) is expression-equivalent to that expression.
  • If auto(t.abs()) is a valid expression whose type models Scalar, -mp_units​::​modulus(E) is expression-equivalent to auto(t.abs()).
  • Otherwise, if T is a class or enumeration type and -auto(abs(t)) is a valid expression whose type models Scalar -where the meaning of abs is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​modulus(E) is expression-equivalent to that expression.
  • Otherwise, mp_units​::​modulus(E) is ill-formed.

5.5.3.5 mp_units​::​magnitude [qty.mag.cpo]

The name mp_units​::​magnitude denotes a customization point object (N4971, [customization.point.object]).
Given a subexpression E with type T, -let t be an lvalue that denotes the reified object for E.
Then: -
  • If T does not model WeaklyRegular, -mp_units​::​magnitude(E) is ill-formed.
  • If auto(t.magnitude()) is a valid expression whose type models Scalar, -mp_units​::​magnitude(E) is expression-equivalent to auto(t.magnitude()).
  • Otherwise, if T is a class or enumeration type and -auto(magnitude(t)) is a valid expression whose type models Scalar -where the meaning of magnitude is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​magnitude(E) is expression-equivalent to that expression.
  • Otherwise, if auto(t.abs()) is a valid expression whose type models Scalar, -mp_units​::​magnitude(​E) is expression-equivalent to auto(t.abs()).
  • Otherwise, if T is a class or enumeration type and -auto(abs(t)) is a valid expression whose type models Scalar -where the meaning of magnitude is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​magnitude(E) is expression-equivalent to that expression.
  • Otherwise, mp_units​::​magnitude(E) is ill-formed.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.rep.general.html b/HEAD/api_reference/gen/qty.rep.general.html deleted file mode 100644 index 2c65db00..00000000 --- a/HEAD/api_reference/gen/qty.rep.general.html +++ /dev/null @@ -1,2 +0,0 @@ -[qty.rep.general]

5 Quantities and units library [quantities]

5.5 Representation [qty.rep]

5.5.1 General [qty.rep.general]

Subclause [qty.rep] specifies the components -used to constrain the numerical value of a quantity (IEC 60050, 112-01-29).
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.rep.html b/HEAD/api_reference/gen/qty.rep.html deleted file mode 100644 index 5b83fd88..00000000 --- a/HEAD/api_reference/gen/qty.rep.html +++ /dev/null @@ -1,166 +0,0 @@ -[qty.rep]

5 Quantities and units library [quantities]

5.5 Representation [qty.rep]

5.5.1 General [qty.rep.general]

Subclause [qty.rep] specifies the components -used to constrain the numerical value of a quantity (IEC 60050, 112-01-29).

5.5.2 Traits [qty.rep.traits]

5.5.2.1 Floating-point [qty.fp.traits]

template<typename T> -struct actual-value-type : cond-value-type<T> {}; // see N4971, [readable.traits] - -template<typename T> - requires(!std::is_pointer_v<T> && !std::is_array_v<T>) && - requires { typename std::indirectly_readable_traits<T>::value_type; } -struct actual-value-type<T> : std::indirectly_readable_traits<T> {}; - -template<typename T> -using actual-value-type-t = actual-value-type<T>::value_type; - -template<typename Rep> -constexpr bool treat_as_floating_point = - std::chrono::treat_as_floating_point_v<actual-value-type-t<Rep>>; -
quantity and quantity_point use treat_as_floating_point -to help determine whether implicit conversions are allowed among them.
Remarks: Pursuant to N4971, [namespace.std] ([spec.ext]), -users may specialize treat_as_floating_point -for cv-unqualified program-defined types.
Such specializations shall be usable in constant expressions (N4971, [expr.const]) -and have type const bool.

5.5.2.2 Quantity character [qty.char.traits]

template<typename T> -constexpr bool disable_scalar = false; -template<typename T> -constexpr bool disable_complex = false; -template<typename T> -constexpr bool disable_vector = false; -
Some quantities are defined as having a numerical value (IEC 60050, 112-01-29) of a specific set (IEC 60050, 102-01-02).
The representation concepts use these traits -to help determine the sets T represents.
Remarks: Pursuant to N4971, [namespace.std] ([spec.ext]), -users may specialize these templates -for cv-unqualified program-defined types.
Such specializations shall be usable in constant expressions (N4971, [expr.const]) -and have type const bool.
[Note 1: 
These templates prevent use of representation types with the library -that satisfy but do not in fact model their corresponding concept.
— end note]

5.5.2.3 Values [qty.val.traits]

quantity and quantity_point use representation_values -to construct special values of its representation type.
namespace mp_units { - -template<typename Rep> -struct representation_values : std::chrono::duration_values<Rep> { - static constexpr Rep one() noexcept; -}; - -} -
The requirements on std​::​chrono​::​duration_values<Rep> (N4971, [time.traits.duration.values]) -also apply to representation_values<Rep>.
static constexpr Rep one() noexcept; -
Returns: Rep(1).
Remarks: The value returned shall be the neutral element for multiplication (IEC 60050, 102-01-19).

5.5.3 Customization point objects [qty.rep.cpos]

5.5.3.2 mp_units​::​real [qty.real.cpo]

The name mp_units​::​real denotes a customization point object (N4971, [customization.point.object]).
Given a subexpression E with type T, -let t be an lvalue that denotes the reified object for E.
Then: -
  • If T does not model WeaklyRegular, -mp_units​::​real(E) is ill-formed.
  • If auto(t.real()) is a valid expression whose type models Scalar, -mp_units​::​real(E) is expression-equivalent to auto(t.real()).
  • Otherwise, if T is a class or enumeration type and -auto(real(t)) is a valid expression whose type models Scalar -where the meaning of real is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​real(E) is expression-equivalent to that expression.
  • Otherwise, mp_units​::​real(E) is ill-formed.

5.5.3.3 mp_units​::​imag [qty.imag.cpo]

The name mp_units​::​imag denotes a customization point object (N4971, [customization.point.object]).
Given a subexpression E with type T, -let t be an lvalue that denotes the reified object for E.
Then: -
  • If T does not model WeaklyRegular, -mp_units​::​imag(E) is ill-formed.
  • If auto(t.imag()) is a valid expression whose type models Scalar, -mp_units​::​imag(E) is expression-equivalent to auto(t.imag()).
  • Otherwise, if T is a class or enumeration type and -auto(imag(t)) is a valid expression whose type models Scalar -where the meaning of imag is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​imag(E) is expression-equivalent to that expression.
  • Otherwise, mp_units​::​imag(E) is ill-formed.

5.5.3.4 mp_units​::​modulus [qty.modulus.cpo]

The name mp_units​::​modulus denotes a customization point object (N4971, [customization.point.object]).
Given a subexpression E with type T, -let t be an lvalue that denotes the reified object for E.
Then: -
  • If T does not model WeaklyRegular, -mp_units​::​modulus(E) is ill-formed.
  • If auto(t.modulus()) is a valid expression whose type models Scalar, -mp_units​::​modulus(E) is expression-equivalent to auto(t.modulus()).
  • Otherwise, if T is a class or enumeration type and -auto(modulus(t)) is a valid expression whose type models Scalar -where the meaning of modulus is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​modulus(E) is expression-equivalent to that expression.
  • If auto(t.abs()) is a valid expression whose type models Scalar, -mp_units​::​modulus(E) is expression-equivalent to auto(t.abs()).
  • Otherwise, if T is a class or enumeration type and -auto(abs(t)) is a valid expression whose type models Scalar -where the meaning of abs is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​modulus(E) is expression-equivalent to that expression.
  • Otherwise, mp_units​::​modulus(E) is ill-formed.

5.5.3.5 mp_units​::​magnitude [qty.mag.cpo]

The name mp_units​::​magnitude denotes a customization point object (N4971, [customization.point.object]).
Given a subexpression E with type T, -let t be an lvalue that denotes the reified object for E.
Then: -
  • If T does not model WeaklyRegular, -mp_units​::​magnitude(E) is ill-formed.
  • If auto(t.magnitude()) is a valid expression whose type models Scalar, -mp_units​::​magnitude(E) is expression-equivalent to auto(t.magnitude()).
  • Otherwise, if T is a class or enumeration type and -auto(magnitude(t)) is a valid expression whose type models Scalar -where the meaning of magnitude is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​magnitude(E) is expression-equivalent to that expression.
  • Otherwise, if auto(t.abs()) is a valid expression whose type models Scalar, -mp_units​::​magnitude(​E) is expression-equivalent to auto(t.abs()).
  • Otherwise, if T is a class or enumeration type and -auto(abs(t)) is a valid expression whose type models Scalar -where the meaning of magnitude is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​magnitude(E) is expression-equivalent to that expression.
  • Otherwise, mp_units​::​magnitude(E) is ill-formed.

5.5.4 Concepts [qty.rep.concepts]

template<typename T> -concept WeaklyRegular = std::copyable<T> && std::equality_comparable<T>; // exposition only - -template<typename T> -concept Scalar = (!disable_scalar<T>) && WeaklyRegular<T> && requires(T a, T b) { // exposition only - // scalar operations - { -a } -> std::common_with<T>; - { a + b } -> std::common_with<T>; - { a - b } -> std::common_with<T>; - { a * b } -> std::common_with<T>; - { a / b } -> std::common_with<T>; -}; -
TBD.
template<typename T> -using value-type-t = actual-value-type-t<T>; // exposition only, see [qty.fp.traits] - -template<typename T> -concept Complex = // exposition only - (!disable_complex<T>) && WeaklyRegular<T> && Scalar<value-type-t<T>> && - std::constructible_from<T, value-type-t<T>, value-type-t<T>> && - requires(T a, T b, value-type-t<T> s) { - // complex operations - { -a } -> std::common_with<T>; - { a + b } -> std::common_with<T>; - { a - b } -> std::common_with<T>; - { a * b } -> std::common_with<T>; - { a / b } -> std::common_with<T>; - { a * s } -> std::common_with<T>; - { s * a } -> std::common_with<T>; - { a / s } -> std::common_with<T>; - ::mp_units::real(a); - ::mp_units::imag(a); - ::mp_units::modulus(a); - }; -
TBD.
template<typename T> -concept Vector = // exposition only - (!disable_vector<T>) && WeaklyRegular<T> && Scalar<value-type-t<T>> && - requires(T a, T b, value-type-t<T> s) { - // vector operations - { -a } -> std::common_with<T>; - { a + b } -> std::common_with<T>; - { a - b } -> std::common_with<T>; - { a * s } -> std::common_with<T>; - { s * a } -> std::common_with<T>; - { a / s } -> std::common_with<T>; - ::mp_units::magnitude(a); - }; -
TBD.
template<typename T> -using scaling-factor-type-t = // exposition only - std::conditional_t<treat_as_floating_point<T>, long double, std::intmax_t>; - -template<typename T> -concept ScalarRepresentation = // exposition only - (!is-specialization-of<T, quantity>()) && Scalar<T> && - requires(T a, T b, scaling-factor-type-t<T> f) { - // scaling - { a * f } -> std::common_with<T>; - { f * a } -> std::common_with<T>; - { a / f } -> std::common_with<T>; - }; -
TBD.
template<typename T> -concept ComplexRepresentation = // exposition only - (!is-specialization-of<T, quantity>()) && Complex<T> && - requires(T a, T b, scaling-factor-type-t<T> f) { - // scaling - { a * T(f) } -> std::common_with<T>; - { T(f) * a } -> std::common_with<T>; - { a / T(f) } -> std::common_with<T>; - }; -
TBD.
template<typename T> -concept VectorRepresentation = // exposition only - (!is-specialization-of<T, quantity>()) && Vector<T>; -
TBD.
template<typename T> -concept Representation = ScalarRepresentation<T> || ComplexRepresentation<T> || - VectorRepresentation<T>; -
A type T models Representation if -it represents the numerical value of a quantity (IEC 60050, 112-01-29).
template<typename T, quantity_character Ch> -concept IsOfCharacter = (Ch == quantity_character::real_scalar && Scalar<T>) || // exposition only - (Ch == quantity_character::complex_scalar && Complex<T>) || - (Ch == quantity_character::vector && Vector<T>); - -template<typename T, auto V> -concept RepresentationOf = - Representation<T> && ((QuantitySpec<decltype(V)> && - (QuantityKindSpec<decltype(V)> || IsOfCharacter<T, V.character>)) || - (std::same_as<quantity_character, decltype(V)> && IsOfCharacter<T, V>)); -
A type T models RepresentationOf<V> if -T models Representation and -
  • V is a kind of quantity, or
  • if V is a quantity, then T represents a value of its character, or
  • if V is a quantity character, then T represents a value of V.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.rep.traits.html b/HEAD/api_reference/gen/qty.rep.traits.html deleted file mode 100644 index db7bac47..00000000 --- a/HEAD/api_reference/gen/qty.rep.traits.html +++ /dev/null @@ -1,41 +0,0 @@ -[qty.rep.traits]

5 Quantities and units library [quantities]

5.5 Representation [qty.rep]

5.5.2 Traits [qty.rep.traits]

5.5.2.1 Floating-point [qty.fp.traits]

template<typename T> -struct actual-value-type : cond-value-type<T> {}; // see N4971, [readable.traits] - -template<typename T> - requires(!std::is_pointer_v<T> && !std::is_array_v<T>) && - requires { typename std::indirectly_readable_traits<T>::value_type; } -struct actual-value-type<T> : std::indirectly_readable_traits<T> {}; - -template<typename T> -using actual-value-type-t = actual-value-type<T>::value_type; - -template<typename Rep> -constexpr bool treat_as_floating_point = - std::chrono::treat_as_floating_point_v<actual-value-type-t<Rep>>; -
quantity and quantity_point use treat_as_floating_point -to help determine whether implicit conversions are allowed among them.
Remarks: Pursuant to N4971, [namespace.std] ([spec.ext]), -users may specialize treat_as_floating_point -for cv-unqualified program-defined types.
Such specializations shall be usable in constant expressions (N4971, [expr.const]) -and have type const bool.

5.5.2.2 Quantity character [qty.char.traits]

template<typename T> -constexpr bool disable_scalar = false; -template<typename T> -constexpr bool disable_complex = false; -template<typename T> -constexpr bool disable_vector = false; -
Some quantities are defined as having a numerical value (IEC 60050, 112-01-29) of a specific set (IEC 60050, 102-01-02).
The representation concepts use these traits -to help determine the sets T represents.
Remarks: Pursuant to N4971, [namespace.std] ([spec.ext]), -users may specialize these templates -for cv-unqualified program-defined types.
Such specializations shall be usable in constant expressions (N4971, [expr.const]) -and have type const bool.
[Note 1: 
These templates prevent use of representation types with the library -that satisfy but do not in fact model their corresponding concept.
— end note]

5.5.2.3 Values [qty.val.traits]

quantity and quantity_point use representation_values -to construct special values of its representation type.
namespace mp_units { - -template<typename Rep> -struct representation_values : std::chrono::duration_values<Rep> { - static constexpr Rep one() noexcept; -}; - -} -
The requirements on std​::​chrono​::​duration_values<Rep> (N4971, [time.traits.duration.values]) -also apply to representation_values<Rep>.
static constexpr Rep one() noexcept; -
Returns: Rep(1).
Remarks: The value returned shall be the neutral element for multiplication (IEC 60050, 102-01-19).
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.same.abs.pt.origs.html b/HEAD/api_reference/gen/qty.same.abs.pt.origs.html deleted file mode 100644 index ee66f818..00000000 --- a/HEAD/api_reference/gen/qty.same.abs.pt.origs.html +++ /dev/null @@ -1,16 +0,0 @@ -[qty.same.abs.pt.origs]

5 Quantities and units library [quantities]

5.7 Quantity point [qty.pt]

5.7.2 Point origin [qty.pt.orig]

5.7.2.5 Utilities [qty.pt.orig.utils]

5.7.2.5.1 Same absolute [qty.same.abs.pt.origs]

template<PointOrigin PO1, PointOrigin PO2> -consteval bool same-absolute-point-origins(PO1 po1, PO2 po2); // exposition only -
Effects: Equivalent to: -if constexpr (is-derived-from-specialization-of<PO1, absolute_point_origin>() && - is-derived-from-specialization-of<PO2, absolute_point_origin>()) - return po1 == po2; -else if constexpr (is-derived-from-specialization-of<PO1, relative_point_origin>() && - is-derived-from-specialization-of<PO2, relative_point_origin>()) - return po1.absolute-point-origin == po2.absolute-point-origin; -else if constexpr (is-derived-from-specialization-of<PO1, relative_point_origin>()) - return po1.absolute-point-origin == po2; -else if constexpr (is-derived-from-specialization-of<PO2, relative_point_origin>()) - return po1 == po2.absolute-point-origin; -else - return false; -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.scaled.unit.html b/HEAD/api_reference/gen/qty.scaled.unit.html deleted file mode 100644 index 8481c066..00000000 --- a/HEAD/api_reference/gen/qty.scaled.unit.html +++ /dev/null @@ -1,15 +0,0 @@ -[qty.scaled.unit]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.4 Unit [qty.unit]

5.4.4.5 Types [qty.unit.types]

5.4.4.5.2 Scaled [qty.scaled.unit]

namespace mp_units { - -template<UnitMagnitude auto M, Unit U> - requires(M != unit-magnitude<>{} && M != mag<1>) -struct scaled_unit final : unit-interface { - using base-type = scaled_unit; // exposition only - static constexpr UnitMagnitude auto mag = M; // exposition only - static constexpr U reference-unit{}; // exposition only - static constexpr auto point-origin = U::point_origin; // exposition only, present only - // if the qualified-id U​::​point_origin is valid and denotes an object -}; - -} -
scaled_unit<M, U> is used by the library -to represent the unit M ×U.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.spec.concepts.html b/HEAD/api_reference/gen/qty.spec.concepts.html deleted file mode 100644 index 4b2a603a..00000000 --- a/HEAD/api_reference/gen/qty.spec.concepts.html +++ /dev/null @@ -1,48 +0,0 @@ -[qty.spec.concepts]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.3 Quantity specification [qty.spec]

5.4.3.2 Concepts [qty.spec.concepts]

template<typename T> -concept QuantitySpec = SymbolicConstant<T> && std::derived_from<T, quantity-spec-interface>; - -template<typename T> -concept QuantityKindSpec = // exposition only - QuantitySpec<T> && is-specialization-of<T, kind_of_>(); - -template<typename T> -concept NamedQuantitySpec = // exposition only - QuantitySpec<T> && is-derived-from-specialization-of<T, quantity_spec>() && - (!QuantityKindSpec<T>); - -template<typename T> -concept DerivedQuantitySpec = // exposition only - QuantitySpec<T> && - (is-specialization-of<T, derived_quantity_spec>() || - (QuantityKindSpec<T> && - is-specialization-of<decltype(auto(T::quantity-spec)), derived_quantity_spec>())); - -template<auto Child, auto Parent> -concept ChildQuantitySpecOf = (is-child-of(Child, Parent)); // exposition only - -template<auto To, auto From> -concept NestedQuantityKindSpecOf = // exposition only - QuantitySpec<decltype(From)> && QuantitySpec<decltype(To)> && - (get_kind(From) != get_kind(To)) && ChildQuantitySpecOf<To, get_kind(From).quantity-spec>; - -template<auto From, auto To> -concept QuantitySpecConvertibleTo = // exposition only - QuantitySpec<decltype(From)> && QuantitySpec<decltype(To)> && implicitly_convertible(From, To); - -template<auto From, auto To> -concept QuantitySpecExplicitlyConvertibleTo = // exposition only - QuantitySpec<decltype(From)> && QuantitySpec<decltype(To)> && explicitly_convertible(From, To); - -template<auto From, auto To> -concept QuantitySpecCastableTo = // exposition only - QuantitySpec<decltype(From)> && QuantitySpec<decltype(To)> && castable(From, To); - -template<typename T, auto QS> -concept QuantitySpecOf = - QuantitySpec<T> && QuantitySpec<decltype(QS)> && QuantitySpecConvertibleTo<T{}, QS> && - !NestedQuantityKindSpecOf<T{}, QS> && - (QuantityKindSpec<T> || !NestedQuantityKindSpecOf<QS, T{}>); - -template<typename T> -concept QSProperty = (!QuantitySpec<T>); // exposition only -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.spec.conv.html b/HEAD/api_reference/gen/qty.spec.conv.html deleted file mode 100644 index d947b175..00000000 --- a/HEAD/api_reference/gen/qty.spec.conv.html +++ /dev/null @@ -1,5 +0,0 @@ -[qty.spec.conv]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.3 Quantity specification [qty.spec]

5.4.3.6 Hierarchy algorithms [qty.spec.hier.algos]

5.4.3.6.1 Conversion [qty.spec.conv]

consteval bool implicitly_convertible(QuantitySpec auto from, QuantitySpec auto to); -
Returns: TBD.
consteval bool explicitly_convertible(QuantitySpec auto from, QuantitySpec auto to); -
Returns: TBD.
consteval bool castable(QuantitySpec auto from, QuantitySpec auto to); -
Returns: TBD.
consteval bool interconvertible(QuantitySpec auto qs1, QuantitySpec auto qs2); -
Returns: implicitly_convertible(qs1, qs2) && implicitly_convertible(qs2, qs1).
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.spec.general.html b/HEAD/api_reference/gen/qty.spec.general.html deleted file mode 100644 index 97d93d5c..00000000 --- a/HEAD/api_reference/gen/qty.spec.general.html +++ /dev/null @@ -1,2 +0,0 @@ -[qty.spec.general]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.3 Quantity specification [qty.spec]

5.4.3.1 General [qty.spec.general]

Subclause [qty.spec] specifies the components -for defining a quantity (IEC 60050, 112-01-01).
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.spec.hier.algos.html b/HEAD/api_reference/gen/qty.spec.hier.algos.html deleted file mode 100644 index 9005aaec..00000000 --- a/HEAD/api_reference/gen/qty.spec.hier.algos.html +++ /dev/null @@ -1,75 +0,0 @@ -[qty.spec.hier.algos]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.3 Quantity specification [qty.spec]

5.4.3.6 Hierarchy algorithms [qty.spec.hier.algos]

5.4.3.6.1 Conversion [qty.spec.conv]

consteval bool implicitly_convertible(QuantitySpec auto from, QuantitySpec auto to); -
Returns: TBD.
consteval bool explicitly_convertible(QuantitySpec auto from, QuantitySpec auto to); -
Returns: TBD.
consteval bool castable(QuantitySpec auto from, QuantitySpec auto to); -
Returns: TBD.
consteval bool interconvertible(QuantitySpec auto qs1, QuantitySpec auto qs2); -
Returns: implicitly_convertible(qs1, qs2) && implicitly_convertible(qs2, qs1).

5.4.3.6.2 Get kind [qty.get.kind]

template<QuantitySpec Q> -consteval QuantitySpec auto get-kind-tree-root(Q q); // exposition only -
Returns:
  • If QuantityKindSpec<Q> is true, -returns remove-kind(q).
  • Otherwise, if -is-derived-from-specialization-of<Q, quantity_spec>() -is true, and -the specialization of Q​::​quantity_spec has a template argument equal to is_kind, -returns q.
  • Otherwise, if Q​::​parent is a valid expression, -returns get-kind-tree-root(Q​::​parent).
  • Otherwise, if DerivedQuantitySpec<Q> is true, -returns -expr-map<to-kind, derived_quantity_spec, struct dimensionless>(q) - -where to-kind is defined as follows: -template<QuantitySpec Q> -using to-kind = decltype(get-kind-tree-root(Q{})); // exposition only -
  • Otherwise, returns q.
template<QuantitySpec Q> -consteval QuantityKindSpec auto get_kind(Q); -
Returns: kind_of<get-kind-tree-root(Q{})>.

5.4.3.6.3 Get common quantity specification [get.common.qty.spec]

consteval QuantitySpec auto get_common_quantity_spec(QuantitySpec auto... qs) - requires see below; -
Let -
  • q1 be qs...[0],
  • q2 be qs...[1],
  • Q1 be decltype(q1),
  • Q2 be decltype(q2), and
  • rest be a pack denoting the elements of qs without q1 and q2.
Effects: Equivalent to: -if constexpr (sizeof...(qs) == 1) - return q1; -else if constexpr (sizeof...(qs) == 2) { - using QQ1 = decltype(remove-kind(q1)); - using QQ2 = decltype(remove-kind(q2)); - - if constexpr (std::is_same_v<Q1, Q2>) - return q1; - else if constexpr (NestedQuantityKindSpecOf<Q1{}, Q2{}>) - return QQ1{}; - else if constexpr (NestedQuantityKindSpecOf<Q2{}, Q1{}>) - return QQ2{}; - else if constexpr ((QuantityKindSpec<Q1> && !QuantityKindSpec<Q2>) || - (DerivedQuantitySpec<QQ1> && NamedQuantitySpec<QQ2> && - implicitly_convertible(Q1{}, Q2{}))) - return q2; - else if constexpr ((!QuantityKindSpec<Q1> && QuantityKindSpec<Q2>) || - (NamedQuantitySpec<QQ1> && DerivedQuantitySpec<QQ2> && - implicitly_convertible(Q2{}, Q1{}))) - return q1; - else if constexpr (constexpr auto common_base = get-common-base<Q1{}, Q2{}>()) - return *common_base; - else if constexpr (implicitly_convertible(Q1{}, Q2{})) - return q2; - else if constexpr (implicitly_convertible(Q2{}, Q1{})) - return q1; - else if constexpr (implicitly_convertible(get-kind-tree-root(Q1{}), - get-kind-tree-root(Q2{}))) - return get-kind-tree-root(q2); - else - return get-kind-tree-root(q1); -} else - return get_common_quantity_spec(get_common_quantity_spec(q1, q2), rest...); -
Remarks: The expression in the requires-clause is equivalent to: -(sizeof...(qs) != 0 && - (sizeof...(qs) == 1 || - (sizeof...(qs) == 2 && - (QuantitySpecConvertibleTo<get-kind-tree-root(Q1{}), get-kind-tree-root(Q2{})> || - QuantitySpecConvertibleTo<get-kind-tree-root(Q2{}), get-kind-tree-root(Q1{})>)) || - requires { get_common_quantity_spec(get_common_quantity_spec(q1, q2), rest...); })) -

5.4.3.6.4 Get common base [qty.get.common.base]

In this subclause and [qty.is.child.of], -let the kind of quantity (IEC 60050, 112-01-04) hierarchy of q be the tuple -, -where par is parent.
template<QuantitySpec auto A, QuantitySpec auto B> -consteval auto get-common-base(); // exposition only -
Let -
  • be the number of elements in h(A),
  • be the number of elements in h(B),
  • s be ,
  • A be a tuple of the last s elements of h(A), and
  • B be a tuple of the last s elements of h(B).
Effects: Looks for x, the first pair-wise equal element in A and B.
Returns: std​::​optional(x), if x is found, and std​::​optional<unspecified>() otherwise.

5.4.3.6.5 Is child of [qty.is.child.of]

template<QuantitySpec Child, QuantitySpec Parent> -consteval bool is-child-of(Child ch, Parent p); // exposition only -
Returns: If h(p) has more elements than h(ch), returns false.
Otherwise, let C be a tuple of the last s elements of h(ch), -where s is the number of elements in h(p).
Returns == p.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.spec.html b/HEAD/api_reference/gen/qty.spec.html deleted file mode 100644 index 567ccdf0..00000000 --- a/HEAD/api_reference/gen/qty.spec.html +++ /dev/null @@ -1,306 +0,0 @@ -[qty.spec]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.3 Quantity specification [qty.spec]

5.4.3.1 General [qty.spec.general]

Subclause [qty.spec] specifies the components -for defining a quantity (IEC 60050, 112-01-01).

5.4.3.2 Concepts [qty.spec.concepts]

template<typename T> -concept QuantitySpec = SymbolicConstant<T> && std::derived_from<T, quantity-spec-interface>; - -template<typename T> -concept QuantityKindSpec = // exposition only - QuantitySpec<T> && is-specialization-of<T, kind_of_>(); - -template<typename T> -concept NamedQuantitySpec = // exposition only - QuantitySpec<T> && is-derived-from-specialization-of<T, quantity_spec>() && - (!QuantityKindSpec<T>); - -template<typename T> -concept DerivedQuantitySpec = // exposition only - QuantitySpec<T> && - (is-specialization-of<T, derived_quantity_spec>() || - (QuantityKindSpec<T> && - is-specialization-of<decltype(auto(T::quantity-spec)), derived_quantity_spec>())); - -template<auto Child, auto Parent> -concept ChildQuantitySpecOf = (is-child-of(Child, Parent)); // exposition only - -template<auto To, auto From> -concept NestedQuantityKindSpecOf = // exposition only - QuantitySpec<decltype(From)> && QuantitySpec<decltype(To)> && - (get_kind(From) != get_kind(To)) && ChildQuantitySpecOf<To, get_kind(From).quantity-spec>; - -template<auto From, auto To> -concept QuantitySpecConvertibleTo = // exposition only - QuantitySpec<decltype(From)> && QuantitySpec<decltype(To)> && implicitly_convertible(From, To); - -template<auto From, auto To> -concept QuantitySpecExplicitlyConvertibleTo = // exposition only - QuantitySpec<decltype(From)> && QuantitySpec<decltype(To)> && explicitly_convertible(From, To); - -template<auto From, auto To> -concept QuantitySpecCastableTo = // exposition only - QuantitySpec<decltype(From)> && QuantitySpec<decltype(To)> && castable(From, To); - -template<typename T, auto QS> -concept QuantitySpecOf = - QuantitySpec<T> && QuantitySpec<decltype(QS)> && QuantitySpecConvertibleTo<T{}, QS> && - !NestedQuantityKindSpecOf<T{}, QS> && - (QuantityKindSpec<T> || !NestedQuantityKindSpecOf<QS, T{}>); - -template<typename T> -concept QSProperty = (!QuantitySpec<T>); // exposition only -

5.4.3.3 Types [qty.spec.types]

5.4.3.3.1 Named [named.qty]

namespace mp_units { - -struct is_kind {}; - -template<BaseDimension auto Dim, QSProperty auto... Args> -struct quantity_spec<Dim, Args...> : quantity-spec-interface { - using base-type = quantity_spec; - static constexpr BaseDimension auto dimension = Dim; - static constexpr quantity_character character = see below; -}; - -template<DerivedQuantitySpec auto Eq, QSProperty auto... Args> -struct quantity_spec<Eq, Args...> : quantity-spec-interface { - using base-type = quantity_spec; - static constexpr auto equation = Eq; - static constexpr Dimension auto dimension = Eq.dimension; - static constexpr quantity_character character = see below; -}; - -template<NamedQuantitySpec auto QS, QSProperty auto... Args> -struct quantity_spec<QS, Args...> : quantity-spec-interface { - using base-type = quantity_spec; - static constexpr auto parent = QS; - static constexpr auto equation = parent.equation; // exposition only, present only - // if the qualified-id parent.equation is valid and denotes an object - static constexpr Dimension auto dimension = parent.dimension; - static constexpr quantity_character character = see below; -}; - -template<NamedQuantitySpec auto QS, DerivedQuantitySpec auto Eq, QSProperty auto... Args> - requires QuantitySpecExplicitlyConvertibleTo<Eq, QS> -struct quantity_spec<QS, Eq, Args...> : quantity-spec-interface { - using base-type = quantity_spec; - static constexpr auto parent = QS; - static constexpr auto equation = Eq; - static constexpr Dimension auto dimension = parent.dimension; - static constexpr quantity_character character = see below; -}; - -} -
A named quantity is a type that models NamedQuantitySpec.
A specialization of quantity_spec is used as a base type when defining a named quantity.
In the following descriptions, let Q be a named quantity defined with an alluded signature.
The identifier of Q represents its quantity name (IEC 60050, 112-01-02).
Let Ch be an enumerator value of quantity_character.
The possible arguments to quantity_spec are -
  • ,
  • ,
  • , and
  • .
If the first argument is a base quantity dimension, -then Q is that base quantity (IEC 60050, 112-01-08).
If an argument is a quantity calculus (IEC 60050, 112-01-30) C, -then Q is implicitly convertible from C.
If the first argument is a named quantity, -then Q is of its kind (IEC 60050, 112-01-04).
The member character represents -the set of the numerical value of Q ([qty.char.traits]) -and is equal to -
  • Ch if specified,
  • otherwise, quantity_character​::​real_scalar for the first signature, and
  • otherwise, (BC).character, -where BC is the argument preceding Ch in the signatures above.
is_kind specifies Q to start a new hierarchy tree of a kind.
Optional arguments may appear in any order.
[Example 1: // The first signature defines a base quantity. -inline constexpr struct length final : quantity_spec<dim_length> { -} length; // Length is a base quantity. - -// The second signature defines a derived quantity. -inline constexpr struct area final : quantity_spec<pow<2>(length)> { -} area; // An area equals length by length. - -// The third and fourth signatures add a leaf to a hierarchy of kinds. -inline constexpr struct width final : quantity_spec<length> { -} width; // Width is a kind of length. - -// The fourth signature also refines the calculus required for implicit conversions. -inline constexpr struct angular_measure final : - quantity_spec<dimensionless, arc_length / radius, is_kind> { -} angular_measure; // Requires an arc length per radius, not just any quantity of dimension one. - — end example]

5.4.3.3.2 Derived [derived.qty]

namespace mp_units { - -template<NamedQuantitySpec Q> -using to-dimension = decltype(auto(Q::dimension)); // exposition only - -template<typename... Expr> -struct derived-quantity-spec-impl : // exposition only - quantity-spec-interface, - expr-fractions<struct dimensionless, Expr...> { - using base-type = derived-quantity-spec-impl; - using base = expr-fractions<struct dimensionless, Expr...>; - - static constexpr Dimension auto dimension = - expr-map<to-dimension, derived_dimension, struct dimension_one>(base{}); - static constexpr quantity_character character = see below; -}; - -template<SymbolicConstant... Expr> -struct derived_quantity_spec final : derived-quantity-spec-impl<Expr...> {}; - -} -
derived_quantity_spec is used by the library -to represent the result of a quantity calculus not equal to a named quantity.
[Example 1: constexpr auto area = pow<2>(isq::length); -int x = area; // error: cannot construct from derived_quantity_spec<power<isq​::​length, 2>> - — end example]
-A program that instantiates a specialization of derived_quantity_spec -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
Let -
  • Nums and Dens -be packs denoting the template arguments of -base​::​nums and base​::​dens, respectively,
  • QUANTITY-CHARACTER-OF(Pack) be -std::max({quantity_character::real_scalar, expr-type<Pack>::character...}) - -and
  • num_char be QUANTITY-CHARACTER-OF(Nums) and -den_char be QUANTITY-CHARACTER-OF(Dens).
-The member character is equal to -quantity_character​::​real_scalar if num_char == den_char is true, and -std​::​max(num_char, den_char) otherwise.

5.4.3.3.3 Base quantity of dimension one [dimless.qty]

namespace mp_units { - -struct dimensionless final : quantity_spec<derived_quantity_spec<>> {}; - -} -
dimensionless represents the base quantity of dimension one (IEC 60050, 112-01-13).

5.4.3.3.4 Kind of [kind.of.qty]

namespace mp_units { - -template<QuantitySpec Q> - requires(!QuantityKindSpec<Q>) && (get-kind-tree-root(Q{}) == Q{}) -struct kind_of_ final : Q::base-type { - using base-type = kind_of_; // exposition only - static constexpr auto quantity-spec = Q{}; // exposition only -}; - -} -
kind_of<Q> represents a kind of quantity (IEC 60050, 112-01-04) Q.

5.4.3.4 Utilities [qty.spec.utils]

template<QuantitySpec auto... From, QuantitySpec Q> -consteval QuantitySpec auto clone-kind-of(Q q); // exposition only -
Effects: Equivalent to: -if constexpr ((... && QuantityKindSpec<decltype(From)>)) - return kind_of<Q{}>; -else - return q; -
template<QuantitySpec Q> -consteval auto remove-kind(Q q); // exposition only -
Effects: Equivalent to: -if constexpr (QuantityKindSpec<Q>) - return Q::quantity-spec; -else - return q; -
template<QuantitySpec QS, Unit U> - requires(!AssociatedUnit<U>) || UnitOf<U, QS{}> -consteval Reference auto make-reference(QS, U u); // exposition only -
Effects: Equivalent to: -if constexpr (requires { requires get_quantity_spec(U{}) == QS{}; }) - return u; -else - return reference<QS, U>{}; -

5.4.3.5 Operations [qty.spec.ops]

namespace mp_units { - -struct quantity-spec-interface { // exposition only - template<QuantitySpec Lhs, QuantitySpec Rhs> - friend consteval QuantitySpec auto operator*(Lhs lhs, Rhs rhs); - - template<QuantitySpec Lhs, QuantitySpec Rhs> - friend consteval QuantitySpec auto operator/(Lhs lhs, Rhs rhs); - - template<typename Self, UnitOf<Self{}> U> - consteval Reference auto operator[](this Self self, U u); - - template<typename Self, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>> - requires QuantitySpecExplicitlyConvertibleTo<Q::quantity_spec, Self{}> - constexpr Quantity auto operator()(this Self self, FwdQ&& q); - - template<QuantitySpec Lhs, QuantitySpec Rhs> - friend consteval bool operator==(Lhs, Rhs); -}; - -} -
template<QuantitySpec Lhs, QuantitySpec Rhs> -friend consteval QuantitySpec auto operator*(Lhs lhs, Rhs rhs); -
Returns: clone-kind-of<Lhs{}, Rhs{}>(expr-multiply<derived_quantity_spec, struct dimensionless>( - remove-kind(lhs), remove-kind(rhs))) -
template<QuantitySpec Lhs, QuantitySpec Rhs> -friend consteval QuantitySpec auto operator/(Lhs lhs, Rhs rhs); -
Returns: clone-kind-of<Lhs{}, Rhs{}>(expr-divide<derived_quantity_spec, struct dimensionless>( - remove-kind(lhs), remove-kind(rhs))) -
template<typename Self, UnitOf<Self{}> U> -consteval Reference auto operator[](this Self self, U u); -
Returns: make-reference(self, u).
template<typename Self, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>> - requires QuantitySpecExplicitlyConvertibleTo<Q::quantity_spec, Self{}> -constexpr Quantity auto operator()(this Self self, FwdQ&& q); -
Returns: quantity{std::forward<FwdQ>(q).numerical-value, make-reference(self, Q::unit)} -
template<QuantitySpec Lhs, QuantitySpec Rhs> -friend consteval bool operator==(Lhs, Rhs); -
Returns: std​::​is_same_v<Lhs, Rhs>.
consteval QuantitySpec auto inverse(QuantitySpec auto q); -
Returns: dimensionless / q.
template<std::intmax_t Num, std::intmax_t Den = 1, QuantitySpec Q> - requires(Den != 0) -consteval QuantitySpec auto pow(Q q); -
Returns: clone-kind-of<Q{}>( - expr-pow<Num, Den, derived_quantity_spec, struct dimensionless>(remove-kind(q))); -
consteval QuantitySpec auto sqrt(QuantitySpec auto q); -
Returns: pow<1, 2>(q).
consteval QuantitySpec auto cbrt(QuantitySpec auto q); -
Returns: pow<1, 3>(q).

5.4.3.6 Hierarchy algorithms [qty.spec.hier.algos]

5.4.3.6.1 Conversion [qty.spec.conv]

consteval bool implicitly_convertible(QuantitySpec auto from, QuantitySpec auto to); -
Returns: TBD.
consteval bool explicitly_convertible(QuantitySpec auto from, QuantitySpec auto to); -
Returns: TBD.
consteval bool castable(QuantitySpec auto from, QuantitySpec auto to); -
Returns: TBD.
consteval bool interconvertible(QuantitySpec auto qs1, QuantitySpec auto qs2); -
Returns: implicitly_convertible(qs1, qs2) && implicitly_convertible(qs2, qs1).

5.4.3.6.2 Get kind [qty.get.kind]

template<QuantitySpec Q> -consteval QuantitySpec auto get-kind-tree-root(Q q); // exposition only -
Returns:
  • If QuantityKindSpec<Q> is true, -returns remove-kind(q).
  • Otherwise, if -is-derived-from-specialization-of<Q, quantity_spec>() -is true, and -the specialization of Q​::​quantity_spec has a template argument equal to is_kind, -returns q.
  • Otherwise, if Q​::​parent is a valid expression, -returns get-kind-tree-root(Q​::​parent).
  • Otherwise, if DerivedQuantitySpec<Q> is true, -returns -expr-map<to-kind, derived_quantity_spec, struct dimensionless>(q) - -where to-kind is defined as follows: -template<QuantitySpec Q> -using to-kind = decltype(get-kind-tree-root(Q{})); // exposition only -
  • Otherwise, returns q.
template<QuantitySpec Q> -consteval QuantityKindSpec auto get_kind(Q); -
Returns: kind_of<get-kind-tree-root(Q{})>.

5.4.3.6.3 Get common quantity specification [get.common.qty.spec]

consteval QuantitySpec auto get_common_quantity_spec(QuantitySpec auto... qs) - requires see below; -
Let -
  • q1 be qs...[0],
  • q2 be qs...[1],
  • Q1 be decltype(q1),
  • Q2 be decltype(q2), and
  • rest be a pack denoting the elements of qs without q1 and q2.
Effects: Equivalent to: -if constexpr (sizeof...(qs) == 1) - return q1; -else if constexpr (sizeof...(qs) == 2) { - using QQ1 = decltype(remove-kind(q1)); - using QQ2 = decltype(remove-kind(q2)); - - if constexpr (std::is_same_v<Q1, Q2>) - return q1; - else if constexpr (NestedQuantityKindSpecOf<Q1{}, Q2{}>) - return QQ1{}; - else if constexpr (NestedQuantityKindSpecOf<Q2{}, Q1{}>) - return QQ2{}; - else if constexpr ((QuantityKindSpec<Q1> && !QuantityKindSpec<Q2>) || - (DerivedQuantitySpec<QQ1> && NamedQuantitySpec<QQ2> && - implicitly_convertible(Q1{}, Q2{}))) - return q2; - else if constexpr ((!QuantityKindSpec<Q1> && QuantityKindSpec<Q2>) || - (NamedQuantitySpec<QQ1> && DerivedQuantitySpec<QQ2> && - implicitly_convertible(Q2{}, Q1{}))) - return q1; - else if constexpr (constexpr auto common_base = get-common-base<Q1{}, Q2{}>()) - return *common_base; - else if constexpr (implicitly_convertible(Q1{}, Q2{})) - return q2; - else if constexpr (implicitly_convertible(Q2{}, Q1{})) - return q1; - else if constexpr (implicitly_convertible(get-kind-tree-root(Q1{}), - get-kind-tree-root(Q2{}))) - return get-kind-tree-root(q2); - else - return get-kind-tree-root(q1); -} else - return get_common_quantity_spec(get_common_quantity_spec(q1, q2), rest...); -
Remarks: The expression in the requires-clause is equivalent to: -(sizeof...(qs) != 0 && - (sizeof...(qs) == 1 || - (sizeof...(qs) == 2 && - (QuantitySpecConvertibleTo<get-kind-tree-root(Q1{}), get-kind-tree-root(Q2{})> || - QuantitySpecConvertibleTo<get-kind-tree-root(Q2{}), get-kind-tree-root(Q1{})>)) || - requires { get_common_quantity_spec(get_common_quantity_spec(q1, q2), rest...); })) -

5.4.3.6.4 Get common base [qty.get.common.base]

In this subclause and [qty.is.child.of], -let the kind of quantity (IEC 60050, 112-01-04) hierarchy of q be the tuple -, -where par is parent.
template<QuantitySpec auto A, QuantitySpec auto B> -consteval auto get-common-base(); // exposition only -
Let -
  • be the number of elements in h(A),
  • be the number of elements in h(B),
  • s be ,
  • A be a tuple of the last s elements of h(A), and
  • B be a tuple of the last s elements of h(B).
Effects: Looks for x, the first pair-wise equal element in A and B.
Returns: std​::​optional(x), if x is found, and std​::​optional<unspecified>() otherwise.

5.4.3.6.5 Is child of [qty.is.child.of]

template<QuantitySpec Child, QuantitySpec Parent> -consteval bool is-child-of(Child ch, Parent p); // exposition only -
Returns: If h(p) has more elements than h(ch), returns false.
Otherwise, let C be a tuple of the last s elements of h(ch), -where s is the number of elements in h(p).
Returns == p.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.spec.ops.html b/HEAD/api_reference/gen/qty.spec.ops.html deleted file mode 100644 index b5682d44..00000000 --- a/HEAD/api_reference/gen/qty.spec.ops.html +++ /dev/null @@ -1,46 +0,0 @@ -[qty.spec.ops]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.3 Quantity specification [qty.spec]

5.4.3.5 Operations [qty.spec.ops]

namespace mp_units { - -struct quantity-spec-interface { // exposition only - template<QuantitySpec Lhs, QuantitySpec Rhs> - friend consteval QuantitySpec auto operator*(Lhs lhs, Rhs rhs); - - template<QuantitySpec Lhs, QuantitySpec Rhs> - friend consteval QuantitySpec auto operator/(Lhs lhs, Rhs rhs); - - template<typename Self, UnitOf<Self{}> U> - consteval Reference auto operator[](this Self self, U u); - - template<typename Self, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>> - requires QuantitySpecExplicitlyConvertibleTo<Q::quantity_spec, Self{}> - constexpr Quantity auto operator()(this Self self, FwdQ&& q); - - template<QuantitySpec Lhs, QuantitySpec Rhs> - friend consteval bool operator==(Lhs, Rhs); -}; - -} -
template<QuantitySpec Lhs, QuantitySpec Rhs> -friend consteval QuantitySpec auto operator*(Lhs lhs, Rhs rhs); -
Returns: clone-kind-of<Lhs{}, Rhs{}>(expr-multiply<derived_quantity_spec, struct dimensionless>( - remove-kind(lhs), remove-kind(rhs))) -
template<QuantitySpec Lhs, QuantitySpec Rhs> -friend consteval QuantitySpec auto operator/(Lhs lhs, Rhs rhs); -
Returns: clone-kind-of<Lhs{}, Rhs{}>(expr-divide<derived_quantity_spec, struct dimensionless>( - remove-kind(lhs), remove-kind(rhs))) -
template<typename Self, UnitOf<Self{}> U> -consteval Reference auto operator[](this Self self, U u); -
Returns: make-reference(self, u).
template<typename Self, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>> - requires QuantitySpecExplicitlyConvertibleTo<Q::quantity_spec, Self{}> -constexpr Quantity auto operator()(this Self self, FwdQ&& q); -
Returns: quantity{std::forward<FwdQ>(q).numerical-value, make-reference(self, Q::unit)} -
template<QuantitySpec Lhs, QuantitySpec Rhs> -friend consteval bool operator==(Lhs, Rhs); -
Returns: std​::​is_same_v<Lhs, Rhs>.
consteval QuantitySpec auto inverse(QuantitySpec auto q); -
Returns: dimensionless / q.
template<std::intmax_t Num, std::intmax_t Den = 1, QuantitySpec Q> - requires(Den != 0) -consteval QuantitySpec auto pow(Q q); -
Returns: clone-kind-of<Q{}>( - expr-pow<Num, Den, derived_quantity_spec, struct dimensionless>(remove-kind(q))); -
consteval QuantitySpec auto sqrt(QuantitySpec auto q); -
Returns: pow<1, 2>(q).
consteval QuantitySpec auto cbrt(QuantitySpec auto q); -
Returns: pow<1, 3>(q).
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.spec.types.html b/HEAD/api_reference/gen/qty.spec.types.html deleted file mode 100644 index 31aaeedc..00000000 --- a/HEAD/api_reference/gen/qty.spec.types.html +++ /dev/null @@ -1,117 +0,0 @@ -[qty.spec.types]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.3 Quantity specification [qty.spec]

5.4.3.3 Types [qty.spec.types]

5.4.3.3.1 Named [named.qty]

namespace mp_units { - -struct is_kind {}; - -template<BaseDimension auto Dim, QSProperty auto... Args> -struct quantity_spec<Dim, Args...> : quantity-spec-interface { - using base-type = quantity_spec; - static constexpr BaseDimension auto dimension = Dim; - static constexpr quantity_character character = see below; -}; - -template<DerivedQuantitySpec auto Eq, QSProperty auto... Args> -struct quantity_spec<Eq, Args...> : quantity-spec-interface { - using base-type = quantity_spec; - static constexpr auto equation = Eq; - static constexpr Dimension auto dimension = Eq.dimension; - static constexpr quantity_character character = see below; -}; - -template<NamedQuantitySpec auto QS, QSProperty auto... Args> -struct quantity_spec<QS, Args...> : quantity-spec-interface { - using base-type = quantity_spec; - static constexpr auto parent = QS; - static constexpr auto equation = parent.equation; // exposition only, present only - // if the qualified-id parent.equation is valid and denotes an object - static constexpr Dimension auto dimension = parent.dimension; - static constexpr quantity_character character = see below; -}; - -template<NamedQuantitySpec auto QS, DerivedQuantitySpec auto Eq, QSProperty auto... Args> - requires QuantitySpecExplicitlyConvertibleTo<Eq, QS> -struct quantity_spec<QS, Eq, Args...> : quantity-spec-interface { - using base-type = quantity_spec; - static constexpr auto parent = QS; - static constexpr auto equation = Eq; - static constexpr Dimension auto dimension = parent.dimension; - static constexpr quantity_character character = see below; -}; - -} -
A named quantity is a type that models NamedQuantitySpec.
A specialization of quantity_spec is used as a base type when defining a named quantity.
In the following descriptions, let Q be a named quantity defined with an alluded signature.
The identifier of Q represents its quantity name (IEC 60050, 112-01-02).
Let Ch be an enumerator value of quantity_character.
The possible arguments to quantity_spec are -
  • ,
  • ,
  • , and
  • .
If the first argument is a base quantity dimension, -then Q is that base quantity (IEC 60050, 112-01-08).
If an argument is a quantity calculus (IEC 60050, 112-01-30) C, -then Q is implicitly convertible from C.
If the first argument is a named quantity, -then Q is of its kind (IEC 60050, 112-01-04).
The member character represents -the set of the numerical value of Q ([qty.char.traits]) -and is equal to -
  • Ch if specified,
  • otherwise, quantity_character​::​real_scalar for the first signature, and
  • otherwise, (BC).character, -where BC is the argument preceding Ch in the signatures above.
is_kind specifies Q to start a new hierarchy tree of a kind.
Optional arguments may appear in any order.
[Example 1: // The first signature defines a base quantity. -inline constexpr struct length final : quantity_spec<dim_length> { -} length; // Length is a base quantity. - -// The second signature defines a derived quantity. -inline constexpr struct area final : quantity_spec<pow<2>(length)> { -} area; // An area equals length by length. - -// The third and fourth signatures add a leaf to a hierarchy of kinds. -inline constexpr struct width final : quantity_spec<length> { -} width; // Width is a kind of length. - -// The fourth signature also refines the calculus required for implicit conversions. -inline constexpr struct angular_measure final : - quantity_spec<dimensionless, arc_length / radius, is_kind> { -} angular_measure; // Requires an arc length per radius, not just any quantity of dimension one. - — end example]

5.4.3.3.2 Derived [derived.qty]

namespace mp_units { - -template<NamedQuantitySpec Q> -using to-dimension = decltype(auto(Q::dimension)); // exposition only - -template<typename... Expr> -struct derived-quantity-spec-impl : // exposition only - quantity-spec-interface, - expr-fractions<struct dimensionless, Expr...> { - using base-type = derived-quantity-spec-impl; - using base = expr-fractions<struct dimensionless, Expr...>; - - static constexpr Dimension auto dimension = - expr-map<to-dimension, derived_dimension, struct dimension_one>(base{}); - static constexpr quantity_character character = see below; -}; - -template<SymbolicConstant... Expr> -struct derived_quantity_spec final : derived-quantity-spec-impl<Expr...> {}; - -} -
derived_quantity_spec is used by the library -to represent the result of a quantity calculus not equal to a named quantity.
[Example 1: constexpr auto area = pow<2>(isq::length); -int x = area; // error: cannot construct from derived_quantity_spec<power<isq​::​length, 2>> - — end example]
-A program that instantiates a specialization of derived_quantity_spec -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
Let -
  • Nums and Dens -be packs denoting the template arguments of -base​::​nums and base​::​dens, respectively,
  • QUANTITY-CHARACTER-OF(Pack) be -std::max({quantity_character::real_scalar, expr-type<Pack>::character...}) - -and
  • num_char be QUANTITY-CHARACTER-OF(Nums) and -den_char be QUANTITY-CHARACTER-OF(Dens).
-The member character is equal to -quantity_character​::​real_scalar if num_char == den_char is true, and -std​::​max(num_char, den_char) otherwise.

5.4.3.3.3 Base quantity of dimension one [dimless.qty]

namespace mp_units { - -struct dimensionless final : quantity_spec<derived_quantity_spec<>> {}; - -} -
dimensionless represents the base quantity of dimension one (IEC 60050, 112-01-13).

5.4.3.3.4 Kind of [kind.of.qty]

namespace mp_units { - -template<QuantitySpec Q> - requires(!QuantityKindSpec<Q>) && (get-kind-tree-root(Q{}) == Q{}) -struct kind_of_ final : Q::base-type { - using base-type = kind_of_; // exposition only - static constexpr auto quantity-spec = Q{}; // exposition only -}; - -} -
kind_of<Q> represents a kind of quantity (IEC 60050, 112-01-04) Q.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.spec.utils.html b/HEAD/api_reference/gen/qty.spec.utils.html deleted file mode 100644 index c1b70cef..00000000 --- a/HEAD/api_reference/gen/qty.spec.utils.html +++ /dev/null @@ -1,23 +0,0 @@ -[qty.spec.utils]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.3 Quantity specification [qty.spec]

5.4.3.4 Utilities [qty.spec.utils]

template<QuantitySpec auto... From, QuantitySpec Q> -consteval QuantitySpec auto clone-kind-of(Q q); // exposition only -
Effects: Equivalent to: -if constexpr ((... && QuantityKindSpec<decltype(From)>)) - return kind_of<Q{}>; -else - return q; -
template<QuantitySpec Q> -consteval auto remove-kind(Q q); // exposition only -
Effects: Equivalent to: -if constexpr (QuantityKindSpec<Q>) - return Q::quantity-spec; -else - return q; -
template<QuantitySpec QS, Unit U> - requires(!AssociatedUnit<U>) || UnitOf<U, QS{}> -consteval Reference auto make-reference(QS, U u); // exposition only -
Effects: Equivalent to: -if constexpr (requires { requires get_quantity_spec(U{}) == QS{}; }) - return u; -else - return reference<QS, U>{}; -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.static.html b/HEAD/api_reference/gen/qty.static.html deleted file mode 100644 index 786a0a9d..00000000 --- a/HEAD/api_reference/gen/qty.static.html +++ /dev/null @@ -1,11 +0,0 @@ -[qty.static]

5 Quantities and units library [quantities]

5.6 Quantity [qty]

5.6.4 Static member functions [qty.static]

static constexpr quantity zero() noexcept - requires see below; -static constexpr quantity one() noexcept - requires see below; -static constexpr quantity min() noexcept - requires see below; -static constexpr quantity max() noexcept - requires see below; -
Let F be one of zero, one, min, and max.
Returns: {representation_values<rep>​::​F(), R}.
Remarks: The expression in the requires-clause is equivalent to: -requires { representation_values<rep>::F(); } -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.sym.expr.algos.html b/HEAD/api_reference/gen/qty.sym.expr.algos.html deleted file mode 100644 index 5bb4fcf7..00000000 --- a/HEAD/api_reference/gen/qty.sym.expr.algos.html +++ /dev/null @@ -1,81 +0,0 @@ -[qty.sym.expr.algos]

5 Quantities and units library [quantities]

5.3 Utilities [qty.utils]

5.3.4 Symbolic expressions [qty.sym.expr]

5.3.4.4 Algorithms [qty.sym.expr.algos]

template<typename T> -using expr-type = see below; // exposition only -
expr-type<T> denotes -U if T is of the form power<U, Ints...>, and -T otherwise.
template<typename T, typename U> -consteval bool type-less-impl(); // exposition only -
Returns: true if T is less than U -in an implementation-defined total order for types, and -false otherwise.
template<typename Lhs, typename Rhs> -struct type-less : // exposition only - std::bool_constant<is-specialization-of<Rhs, power>() || - type-less-impl<expr-type<Lhs>, expr-type<Rhs>>()> {}; -
type-less meets the requirements of -the Pred parameter of the symbolic expression algorithms below.
template<typename... Ts> -struct type-list {}; // exposition only - -template<typename OneType, typename... Ts> -struct expr-fractions { // exposition only - using num = see below; // exposition only - using den = see below; // exposition only -} -
expr-fractions divides a symbolic expression to numerator and denominator parts.
Let EF be a specialization of expr-fractions.
  • If EF is of the form expr-fractions<OneType, Ts..., per<Us...>>, -then -
    • EF​::​num denotes type-list<Ts...>, and
    • EF​::​den denotes type-list<Us...>.
  • Otherwise, EF is of the form expr-fractions<OneType, Ts...>, and -
    • EF​::​num denotes type-list<Ts...>, and
    • EF​::​den denotes type-list<>.
The symbolic expression algorithms perform operations on symbolic constants.
A symbolic constant is a type that is a model of SymbolicConstant.
[Example 1: 
The dimension dim_length, the quantity time, and the unit one are symbolic constants.
— end example]
-The algorithms also support -powers with a symbolic constant base and a rational exponent, -products thereof, and -fractions thereof.
template<template<typename...> typename To, typename OneType, - template<typename, typename> typename Pred = type-less, typename Lhs, typename Rhs> -consteval auto expr-multiply(Lhs, Rhs); // exposition only - -template<template<typename...> typename To, typename OneType, - template<typename, typename> typename Pred = type-less, typename Lhs, typename Rhs> -consteval auto expr-divide(Lhs lhs, Rhs rhs); // exposition only - -template<template<typename...> typename To, typename OneType, typename T> -consteval auto expr-invert(T); // exposition only - -template<std::intmax_t Num, std::intmax_t Den, template<typename...> typename To, - typename OneType, template<typename, typename> typename Pred = type-less, typename T> - requires(Den != 0) -consteval auto expr-pow(T); // exposition only -
Mandates:
  • OneType is the neutral element (IEC 60050, 102-01-19) of the operation, and
  • Pred is a Cpp17BinaryTypeTrait (N4971, [meta.rqmts]) -with a base characteristic of std​::​bool_constant<B>.
    Pred<T, U> implements a total order for types; -B is true if T is ordered before U, and false otherwise.
Effects:
First, inputs to the operations are obtained from the types of the function parameters.
If the type of a function parameter is: -
  • A specialization of To, -then its input is the product of its template arguments, and -the following also apply.
  • A specialization of per, -then its input is the product of the inverse of its template arguments, and -the following also apply.
  • A specialization of the form power<F, Num>, -then its input is , or -a specialization of the form power<F, Num, Den>, -then its input is , and -the following also applies.
  • Otherwise, the input is the symbolic constant itself.
[Example 2: 
Item by item, this algorithm step goes from the C++ parameter type -decltype(km / square(h)), -styled in diagnostics like -derived_unit<si​::​kilo_<si​::​metre>, per<power<non_si​::​hour, 2>>, -
  • to decltype(km) ×per<power<decltype(h), 2> (product of To's arguments),
  • to (product of inverse of per's arguments),
  • to (powers as powers),
  • to where and (symbolic substitution) -in the mathematical domain.
— end example]
Then, the operation takes place: -
  • expr-multiply multiplies its inputs,
  • expr-divide divides the input of its first parameter by the input of its second parameter,
  • expr-invert divides 1 by its input, and
  • expr-pow raises its input to the .
Finally, let r be the result of the operation simplified as follows: -
  • All terms are part of the same fraction (if any).
  • There is at most a single term with a given symbolic constant.
  • There are no negative exponents.
  • 1 is only present as r and as a numerator with a denominator not equal to 1.
[Example 3: 
Item by item:

(single fraction)
(unique symbolic constants)
(positive exponents)
(non-redundant 1s)
— end example]
Returns: r is mapped to the return type: -
  • If , returns OneType{}.
  • Otherwise, if r is a symbolic constant, returns r.
  • Otherwise, first applies the following mappings to the terms of r: -
    • is mapped to power<x, n, d>, and - is mapped to power<x, n>, and
    • 1 is mapped to OneType{}.
  • Then, a denominator x of r (if any) is mapped to per<x>.
  • Then, sorts r without per (if any) and -the template arguments of per (if any) -according to Pred.
  • Finally, returns To<r>{}, where per (if any) is the last argument.
Remarks: A valid template argument list for To and per -is formed by interspersing commas between each mapped term.
If a mapping to std​::​intmax_t is not representable, -the program is ill-formed.
expr-map maps the contents of one symbolic expression to another resulting in a different type list.
template<template<typename> typename Proj, template<typename...> typename To, typename OneType, - template<typename, typename> typename Pred = type-less, typename T> -consteval auto expr-map(T); // exposition only -
Let -
  • expr-type-map<U> be -power<Proj<F>, Ints...> if U is of the form power<F, Ints...>, and -Proj<U> otherwise,
  • map-power(u) be -pow<Ints...>(F{}) if decltype(u) is of the form power<F, Ints...>, and -u otherwise, and
  • Nums and Dens -be packs denoting the template arguments of -T​::​nums and T​::​dens, respectively.
Returns: (OneType{} * ... * map-power(expr-type-map<Nums>{})) / -(OneType{} * ... * map-power(expr-type-map<Dens>{})) -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.sym.expr.concepts.html b/HEAD/api_reference/gen/qty.sym.expr.concepts.html deleted file mode 100644 index 5a74eaa1..00000000 --- a/HEAD/api_reference/gen/qty.sym.expr.concepts.html +++ /dev/null @@ -1,8 +0,0 @@ -[qty.sym.expr.concepts]

5 Quantities and units library [quantities]

5.3 Utilities [qty.utils]

5.3.4 Symbolic expressions [qty.sym.expr]

5.3.4.2 Concept SymbolicConstant [qty.sym.expr.concepts]

template<typename T> -concept SymbolicConstant = // exposition only - std::is_empty_v<T> && std::is_final_v<T> && std::is_trivially_default_constructible_v<T> && - std::is_trivially_copy_constructible_v<T> && std::is_trivially_move_constructible_v<T> && - std::is_trivially_destructible_v<T>; -
The concept SymbolicConstant -is used to constrain the types -that are used in symbolic expressions.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.sym.expr.general.html b/HEAD/api_reference/gen/qty.sym.expr.general.html deleted file mode 100644 index b4e2b1b3..00000000 --- a/HEAD/api_reference/gen/qty.sym.expr.general.html +++ /dev/null @@ -1,9 +0,0 @@ -[qty.sym.expr.general]

5 Quantities and units library [quantities]

5.3 Utilities [qty.utils]

5.3.4 Symbolic expressions [qty.sym.expr]

5.3.4.1 General [qty.sym.expr.general]

Subclause [qty.sym.expr] specifies the components -used to maintain ordered, simplified, and readable -argument lists in the names of specializations.
[Example 1: using namespace si::unit_symbols; -int x = kg * km / square(h); // error: cannot construct from - // derived_unit<si​::​kilo_<si​::​gram>, si​::​kilo_<si​::​metre>, per<power<non_si​::​hour, 2>>> -
-The library ensures decltype(kg * km / square(h)) is styled-like as commented in diagnostics, -provided that, in the implementation-defined total order of types, -decltype(kg) is less than decltype(km).
— end example]
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.sym.expr.html b/HEAD/api_reference/gen/qty.sym.expr.html deleted file mode 100644 index a8a549b0..00000000 --- a/HEAD/api_reference/gen/qty.sym.expr.html +++ /dev/null @@ -1,123 +0,0 @@ -[qty.sym.expr]

5 Quantities and units library [quantities]

5.3 Utilities [qty.utils]

5.3.4 Symbolic expressions [qty.sym.expr]

5.3.4.1 General [qty.sym.expr.general]

Subclause [qty.sym.expr] specifies the components -used to maintain ordered, simplified, and readable -argument lists in the names of specializations.
[Example 1: using namespace si::unit_symbols; -int x = kg * km / square(h); // error: cannot construct from - // derived_unit<si​::​kilo_<si​::​gram>, si​::​kilo_<si​::​metre>, per<power<non_si​::​hour, 2>>> -
-The library ensures decltype(kg * km / square(h)) is styled-like as commented in diagnostics, -provided that, in the implementation-defined total order of types, -decltype(kg) is less than decltype(km).
— end example]

5.3.4.2 Concept SymbolicConstant [qty.sym.expr.concepts]

template<typename T> -concept SymbolicConstant = // exposition only - std::is_empty_v<T> && std::is_final_v<T> && std::is_trivially_default_constructible_v<T> && - std::is_trivially_copy_constructible_v<T> && std::is_trivially_move_constructible_v<T> && - std::is_trivially_destructible_v<T>; -
The concept SymbolicConstant -is used to constrain the types -that are used in symbolic expressions.

5.3.4.3 Types [qty.sym.expr.types]

namespace mp_units { - -template<typename T, typename... Ts> -struct per final {}; - -} -
per is used to store arguments with negative exponents.
A specialization of per -represents the product of the inverse of its template arguments.
A program that instantiates a specialization of per -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
namespace mp_units { - -template<typename F, int Num, int... Den> - requires see below -struct power final { - using factor = F; // exposition only - static constexpr ratio exponent{Num, Den...}; // exposition only -}; - -} -
power represents a power (IEC 60050, 102-02-08) -of the form .
[Note 1: 
Den is optional to shorten the type name when Den is 1.
— end note]
-A program that instantiates a specialization of power -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
Let r be ratio{Num, Den...}.
Let is-valid-ratio be -true if r is a valid constant expression, and -false otherwise.
The expression in the requires-clause is equivalent to: -is-valid-ratio && (r > ratio{0}) && (r != ratio{1}) -

5.3.4.4 Algorithms [qty.sym.expr.algos]

template<typename T> -using expr-type = see below; // exposition only -
expr-type<T> denotes -U if T is of the form power<U, Ints...>, and -T otherwise.
template<typename T, typename U> -consteval bool type-less-impl(); // exposition only -
Returns: true if T is less than U -in an implementation-defined total order for types, and -false otherwise.
template<typename Lhs, typename Rhs> -struct type-less : // exposition only - std::bool_constant<is-specialization-of<Rhs, power>() || - type-less-impl<expr-type<Lhs>, expr-type<Rhs>>()> {}; -
type-less meets the requirements of -the Pred parameter of the symbolic expression algorithms below.
template<typename... Ts> -struct type-list {}; // exposition only - -template<typename OneType, typename... Ts> -struct expr-fractions { // exposition only - using num = see below; // exposition only - using den = see below; // exposition only -} -
expr-fractions divides a symbolic expression to numerator and denominator parts.
Let EF be a specialization of expr-fractions.
  • If EF is of the form expr-fractions<OneType, Ts..., per<Us...>>, -then -
    • EF​::​num denotes type-list<Ts...>, and
    • EF​::​den denotes type-list<Us...>.
  • Otherwise, EF is of the form expr-fractions<OneType, Ts...>, and -
    • EF​::​num denotes type-list<Ts...>, and
    • EF​::​den denotes type-list<>.
The symbolic expression algorithms perform operations on symbolic constants.
A symbolic constant is a type that is a model of SymbolicConstant.
[Example 1: 
The dimension dim_length, the quantity time, and the unit one are symbolic constants.
— end example]
-The algorithms also support -powers with a symbolic constant base and a rational exponent, -products thereof, and -fractions thereof.
template<template<typename...> typename To, typename OneType, - template<typename, typename> typename Pred = type-less, typename Lhs, typename Rhs> -consteval auto expr-multiply(Lhs, Rhs); // exposition only - -template<template<typename...> typename To, typename OneType, - template<typename, typename> typename Pred = type-less, typename Lhs, typename Rhs> -consteval auto expr-divide(Lhs lhs, Rhs rhs); // exposition only - -template<template<typename...> typename To, typename OneType, typename T> -consteval auto expr-invert(T); // exposition only - -template<std::intmax_t Num, std::intmax_t Den, template<typename...> typename To, - typename OneType, template<typename, typename> typename Pred = type-less, typename T> - requires(Den != 0) -consteval auto expr-pow(T); // exposition only -
Mandates:
  • OneType is the neutral element (IEC 60050, 102-01-19) of the operation, and
  • Pred is a Cpp17BinaryTypeTrait (N4971, [meta.rqmts]) -with a base characteristic of std​::​bool_constant<B>.
    Pred<T, U> implements a total order for types; -B is true if T is ordered before U, and false otherwise.
Effects:
First, inputs to the operations are obtained from the types of the function parameters.
If the type of a function parameter is: -
  • A specialization of To, -then its input is the product of its template arguments, and -the following also apply.
  • A specialization of per, -then its input is the product of the inverse of its template arguments, and -the following also apply.
  • A specialization of the form power<F, Num>, -then its input is , or -a specialization of the form power<F, Num, Den>, -then its input is , and -the following also applies.
  • Otherwise, the input is the symbolic constant itself.
[Example 2: 
Item by item, this algorithm step goes from the C++ parameter type -decltype(km / square(h)), -styled in diagnostics like -derived_unit<si​::​kilo_<si​::​metre>, per<power<non_si​::​hour, 2>>, -
  • to decltype(km) ×per<power<decltype(h), 2> (product of To's arguments),
  • to (product of inverse of per's arguments),
  • to (powers as powers),
  • to where and (symbolic substitution) -in the mathematical domain.
— end example]
Then, the operation takes place: -
  • expr-multiply multiplies its inputs,
  • expr-divide divides the input of its first parameter by the input of its second parameter,
  • expr-invert divides 1 by its input, and
  • expr-pow raises its input to the .
Finally, let r be the result of the operation simplified as follows: -
  • All terms are part of the same fraction (if any).
  • There is at most a single term with a given symbolic constant.
  • There are no negative exponents.
  • 1 is only present as r and as a numerator with a denominator not equal to 1.
[Example 3: 
Item by item:

(single fraction)
(unique symbolic constants)
(positive exponents)
(non-redundant 1s)
— end example]
Returns: r is mapped to the return type: -
  • If , returns OneType{}.
  • Otherwise, if r is a symbolic constant, returns r.
  • Otherwise, first applies the following mappings to the terms of r: -
    • is mapped to power<x, n, d>, and - is mapped to power<x, n>, and
    • 1 is mapped to OneType{}.
  • Then, a denominator x of r (if any) is mapped to per<x>.
  • Then, sorts r without per (if any) and -the template arguments of per (if any) -according to Pred.
  • Finally, returns To<r>{}, where per (if any) is the last argument.
Remarks: A valid template argument list for To and per -is formed by interspersing commas between each mapped term.
If a mapping to std​::​intmax_t is not representable, -the program is ill-formed.
expr-map maps the contents of one symbolic expression to another resulting in a different type list.
template<template<typename> typename Proj, template<typename...> typename To, typename OneType, - template<typename, typename> typename Pred = type-less, typename T> -consteval auto expr-map(T); // exposition only -
Let -
  • expr-type-map<U> be -power<Proj<F>, Ints...> if U is of the form power<F, Ints...>, and -Proj<U> otherwise,
  • map-power(u) be -pow<Ints...>(F{}) if decltype(u) is of the form power<F, Ints...>, and -u otherwise, and
  • Nums and Dens -be packs denoting the template arguments of -T​::​nums and T​::​dens, respectively.
Returns: (OneType{} * ... * map-power(expr-type-map<Nums>{})) / -(OneType{} * ... * map-power(expr-type-map<Dens>{})) -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.sym.expr.types.html b/HEAD/api_reference/gen/qty.sym.expr.types.html deleted file mode 100644 index 92027ef2..00000000 --- a/HEAD/api_reference/gen/qty.sym.expr.types.html +++ /dev/null @@ -1,28 +0,0 @@ -[qty.sym.expr.types]

5 Quantities and units library [quantities]

5.3 Utilities [qty.utils]

5.3.4 Symbolic expressions [qty.sym.expr]

5.3.4.3 Types [qty.sym.expr.types]

namespace mp_units { - -template<typename T, typename... Ts> -struct per final {}; - -} -
per is used to store arguments with negative exponents.
A specialization of per -represents the product of the inverse of its template arguments.
A program that instantiates a specialization of per -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
namespace mp_units { - -template<typename F, int Num, int... Den> - requires see below -struct power final { - using factor = F; // exposition only - static constexpr ratio exponent{Num, Den...}; // exposition only -}; - -} -
power represents a power (IEC 60050, 102-02-08) -of the form .
[Note 1: 
Den is optional to shorten the type name when Den is 1.
— end note]
-A program that instantiates a specialization of power -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
Let r be ratio{Num, Den...}.
Let is-valid-ratio be -true if r is a valid constant expression, and -false otherwise.
The expression in the requires-clause is equivalent to: -is-valid-ratio && (r > ratio{0}) && (r != ratio{1}) -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.sym.txt.html b/HEAD/api_reference/gen/qty.sym.txt.html deleted file mode 100644 index f1c77e78..00000000 --- a/HEAD/api_reference/gen/qty.sym.txt.html +++ /dev/null @@ -1,80 +0,0 @@ -[qty.sym.txt]

5 Quantities and units library [quantities]

5.3 Utilities [qty.utils]

5.3.3 Symbol text [qty.sym.txt]

namespace mp_units { - -template<std::size_t N, std::size_t M> -class symbol_text { -public: - std::fixed_u8string<N> utf8; // exposition only - std::fixed_string<M> portable; // exposition only - - // constructors - constexpr symbol_text(char portable); - consteval symbol_text(const char (&portable)[N + 1]); - constexpr symbol_text(const std::fixed_string<N>& portable); - consteval symbol_text(const char8_t (&utf8)[N + 1], const char (&portable)[M + 1]); - constexpr symbol_text(const std::fixed_u8string<N>& utf8, - const std::fixed_string<M>& portable); - - // observers - constexpr const auto& utf8() const { return utf8; } - constexpr const auto& portable() const { return portable; } - constexpr bool empty() const { return utf8().empty(); } - - // string operations - template<std::size_t N2, std::size_t M2> - friend constexpr symbol_text<N + N2, M + M2> operator+(const symbol_text& lhs, - const symbol_text<N2, M2>& rhs); - - // comparison - template<std::size_t N2, std::size_t M2> - friend constexpr bool operator==(const symbol_text& lhs, - const symbol_text<N2, M2>& rhs) noexcept; - template<std::size_t N2, std::size_t M2> - friend constexpr auto operator<=>(const symbol_text& lhs, - const symbol_text<N2, M2>& rhs) noexcept; -}; - -symbol_text(char) -> symbol_text<1, 1>; - -template<std::size_t N> -symbol_text(const char (&)[N]) -> symbol_text<N - 1, N - 1>; - -template<std::size_t N> -symbol_text(const std::fixed_string<N>&) -> symbol_text<N, N>; - -template<std::size_t N, std::size_t M> -symbol_text(const char8_t (&)[N], const char (&)[M]) -> symbol_text<N - 1, M - 1>; - -template<std::size_t N, std::size_t M> -symbol_text(const std::fixed_u8string<N>&, const std::fixed_string<M>&) -> symbol_text<N, M>; - -} -
symbol_text represents a symbol text.
utf8 stores its UTF-8 representation, and -portable stores its portable representation.
symbol_text<N, M> is a structural type (N4971, [temp.param]).
In the descriptions that follow, -it is a Precondition that -
  • values of char are in the basic literal character set (N4971, [lex.charset]), and
  • for a parameter of the form const CharT (&txt)[M], -(txt[M - 1] == CharT()) is true.
constexpr symbol_text(char portable); -consteval symbol_text(const char (&portable)[N + 1]); -constexpr symbol_text(const std::fixed_string<N>& portable); -consteval symbol_text(const char8_t (&utf8)[N + 1], const char (&portable)[M + 1]); -constexpr symbol_text(const std::fixed_u8string<N>& utf8, const std::fixed_string<M>& portable); -
For the constructors without a parameter named utf8, -let utf8 be: -std::bit_cast<std::fixed_u8string<N>>(std::basic_fixed_string(portable)) -
Effects: Equivalent to the mem-initializer-list: -utf8{utf8}, portable{portable} -
template<std::size_t N2, std::size_t M2> -friend constexpr symbol_text<N + N2, M + M2> operator+(const symbol_text& lhs, - const symbol_text<N2, M2>& rhs); -
Effects: Equivalent to: -return symbol_text<N + N2, M + M2>(lhs.utf8() + rhs.utf8(), - lhs.portable() + rhs.portable()); -
template<std::size_t N2, std::size_t M2> -friend constexpr bool operator==(const symbol_text& lhs, - const symbol_text<N2, M2>& rhs) noexcept; -template<std::size_t N2, std::size_t M2> -friend constexpr auto operator<=>(const symbol_text& lhs, - const symbol_text<N2, M2>& rhs) noexcept; -
Let @ be the operator.
Effects: Equivalent to: -return std::make_tuple(std::cref(lhs.utf8()), std::cref(lhs.portable())) @ - std::make_tuple(std::cref(rhs.utf8()), std::cref(rhs.portable())); -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.syn.html b/HEAD/api_reference/gen/qty.syn.html deleted file mode 100644 index 101a122d..00000000 --- a/HEAD/api_reference/gen/qty.syn.html +++ /dev/null @@ -1,334 +0,0 @@ -[qty.syn]

5 Quantities and units library [quantities]

5.6 Quantity [qty]

5.6.3 Class template quantity [qty.syn]

namespace mp_units { - -template<typename T> -concept Quantity = (is-derived-from-specialization-of<T, quantity>()); // exposition only - -template<typename Q, auto QS> -concept QuantityOf = // exposition only - Quantity<Q> && QuantitySpecOf<decltype(auto(Q::quantity_spec)), QS>; - -template<Unit UFrom, Unit UTo> -consteval bool integral-conversion-factor(UFrom from, UTo to) // exposition only -{ - return is-integral(get-canonical-unit(from).mag / get-canonical-unit(to).mag); -} - -template<typename T> -concept IsFloatingPoint = treat_as_floating_point<T>; // exposition only - -template<typename FromRep, typename ToRep, auto FromUnit = one, auto ToUnit = one> -concept ValuePreservingTo = // exposition only - Representation<std::remove_cvref_t<FromRep>> && Representation<ToRep> && - Unit<decltype(FromUnit)> && Unit<decltype(ToUnit)> && std::assignable_from<ToRep&, FromRep> && - (IsFloatingPoint<ToRep> || (!IsFloatingPoint<std::remove_cvref_t<FromRep>> && - (integral-conversion-factor(FromUnit, ToUnit)))); - -template<typename QFrom, typename QTo> -concept QuantityConvertibleTo = // exposition only - Quantity<QFrom> && Quantity<QTo> && - QuantitySpecConvertibleTo<QFrom::quantity_spec, QTo::quantity_spec> && - UnitConvertibleTo<QFrom::unit, QTo::unit> && - ValuePreservingTo<typename QFrom::rep, typename QTo::rep, QFrom::unit, QTo::unit> && - requires(QFrom q) { sudo-cast<QTo>(q); }; // see [qty.non.mem.conv] - -template<auto QS, typename Func, typename T, typename U> -concept InvokeResultOf = // exposition only - QuantitySpec<decltype(QS)> && std::regular_invocable<Func, T, U> && - RepresentationOf<std::invoke_result_t<Func, T, U>, QS>; - -template<typename Func, typename Q1, typename Q2, - auto QS = std::invoke_result_t<Func, decltype(auto(Q1::quantity_spec)), - decltype(auto(Q2::quantity_spec))>{}> -concept InvocableQuantities = // exposition only - QuantitySpec<decltype(QS)> && Quantity<Q1> && Quantity<Q2> && - InvokeResultOf<QS, Func, typename Q1::rep, typename Q2::rep>; - -template<auto R1, auto R2> -concept HaveCommonReference = requires { get_common_reference(R1, R2); }; // exposition only - -template<typename Func, Quantity Q1, Quantity Q2> -using common-quantity-for = // exposition only - quantity<get_common_reference(Q1::reference, Q2::reference), - std::invoke_result_t<Func, typename Q1::rep, typename Q2::rep>>; - -template<typename Func, typename Q1, typename Q2> -concept CommonlyInvocableQuantities = // exposition only - Quantity<Q1> && Quantity<Q2> && HaveCommonReference<Q1::reference, Q2::reference> && - std::convertible_to<Q1, common-quantity-for<Func, Q1, Q2>> && - std::convertible_to<Q2, common-quantity-for<Func, Q1, Q2>> && - InvocableQuantities<Func, Q1, Q2, - get_common_quantity_spec(Q1::quantity_spec, Q2::quantity_spec)>; - -template<auto R1, auto R2, typename Rep1, typename Rep2> -concept SameValueAs = // exposition only - (equivalent(get_unit(R1), get_unit(R2))) && std::convertible_to<Rep1, Rep2>; - -template<typename T> -using quantity-like-type = // exposition only - quantity<quantity_like_traits<T>::reference, typename quantity_like_traits<T>::rep>; - -template<typename T, typename U, typename TT = std::remove_reference_t<T>> -concept Mutable = (!std::is_const_v<TT>) && std::derived_from<TT, U>; // exposition only - -template<Reference auto R, RepresentationOf<get_quantity_spec(R)> Rep = double> -class quantity { -public: - Rep numerical-value; // exposition only - - // member types and values - static constexpr Reference auto reference = R; - static constexpr QuantitySpec auto quantity_spec = get_quantity_spec(reference); - static constexpr Dimension auto dimension = quantity_spec.dimension; - static constexpr Unit auto unit = get_unit(reference); - using rep = Rep; - - // [qty.static], static member functions - static constexpr quantity zero() noexcept - requires see below; - static constexpr quantity one() noexcept - requires see below; - static constexpr quantity min() noexcept - requires see below; - static constexpr quantity max() noexcept - requires see below; - - // [qty.cons], constructors and assignment - - quantity() = default; - quantity(const quantity&) = default; - quantity(quantity&&) = default; - ~quantity() = default; - - template<typename FwdValue, Reference R2> - requires SameValueAs<R2{}, R, std::remove_cvref_t<FwdValue>, Rep> - constexpr quantity(FwdValue&& v, R2); - - template<typename FwdValue, Reference R2, typename Value = std::remove_cvref_t<FwdValue>> - requires(!SameValueAs<R2{}, R, Value, Rep>) && - QuantityConvertibleTo<quantity<R2{}, Value>, quantity> - constexpr quantity(FwdValue&& v, R2); - - template<ValuePreservingTo<Rep> FwdValue> - requires(unit == ::mp_units::one) - constexpr quantity(FwdValue&& v); - - template<QuantityConvertibleTo<quantity> Q> - constexpr explicit(see below) quantity(const Q& q); - - template<QuantityLike Q> - requires QuantityConvertibleTo<quantity-like-type<Q>, quantity> - constexpr explicit(see below) quantity(const Q& q); - - quantity& operator=(const quantity&) = default; - quantity& operator=(quantity&&) = default; - - template<ValuePreservingTo<Rep> FwdValue> - requires(unit == ::mp_units::one) - constexpr quantity& operator=(FwdValue&& v); - - // [qty.conv], conversions - - template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires QuantityConvertibleTo<quantity, quantity<make-reference(quantity_spec, ToU{}), Rep>> - constexpr QuantityOf<quantity_spec> auto in(ToU) const; - - template<RepresentationOf<quantity_spec> ToRep> - requires QuantityConvertibleTo<quantity, quantity<reference, ToRep>> - constexpr QuantityOf<quantity_spec> auto in() const; - - template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires QuantityConvertibleTo<quantity, - quantity<make-reference(quantity_spec, ToU{}), ToRep>> - constexpr QuantityOf<quantity_spec> auto in(ToU) const; - - template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires requires(const quantity q) { value_cast<ToU{}>(q); } - constexpr QuantityOf<quantity_spec> auto force_in(ToU) const; - - template<RepresentationOf<quantity_spec> ToRep> - requires requires(const quantity q) { value_cast<ToRep>(q); } - constexpr QuantityOf<quantity_spec> auto force_in() const; - - template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires requires(const quantity q) { value_cast<ToU{}, ToRep>(q); } - constexpr QuantityOf<quantity_spec> auto force_in(ToU) const; - - // [qty.obs], numerical value observers - - template<Unit U> - requires(equivalent(U{}, unit)) - constexpr rep& numerical_value_ref_in(U) & noexcept; - template<Unit U> - requires(equivalent(U{}, unit)) - constexpr const rep& numerical_value_ref_in(U) const & noexcept; - template<Unit U> - requires(equivalent(U{}, unit)) - void numerical_value_ref_in(U) const && = delete; - - template<UnitCompatibleWith<unit, quantity_spec> U> - requires QuantityConvertibleTo<quantity, quantity<make-reference(quantity_spec, U{}), Rep>> - constexpr rep numerical_value_in(U) const noexcept; - - template<UnitCompatibleWith<unit, quantity_spec> U> - requires requires(const quantity q) { value_cast<U{}>(q); } - constexpr rep force_numerical_value_in(U) const noexcept; - - // [qty.conv.ops], conversion operations - - template<typename V_, std::constructible_from<Rep> Value = std::remove_cvref_t<V_>> - requires(unit == ::mp_units::one) - explicit operator V_() const & noexcept; - - template<typename Q_, QuantityLike Q = std::remove_cvref_t<Q_>> - requires QuantityConvertibleTo<quantity, quantity-like-type<Q>> - constexpr explicit(see below) operator Q_() const noexcept(see below); - - // [qty.unary.ops], unary operations - - constexpr QuantityOf<quantity_spec> auto operator+() const - requires see below; - constexpr QuantityOf<quantity_spec> auto operator-() const - requires see below; - - template<Mutable<quantity> Q> - friend constexpr decltype(auto) operator++(Q&& q) - requires see below; - template<Mutable<quantity> Q> - friend constexpr decltype(auto) operator--(Q&& q) - requires see below; - - constexpr QuantityOf<quantity_spec> auto operator++(int) - requires see below; - constexpr QuantityOf<quantity_spec> auto operator--(int) - requires see below; - - // [qty.assign.ops], compound assignment operations - - template<Mutable<quantity> Q, auto R2, typename Rep2> - requires see below - friend constexpr decltype(auto) operator+=(Q&& lhs, const quantity<R2, Rep2>& rhs); - template<Mutable<quantity> Q, auto R2, typename Rep2> - requires see below - friend constexpr decltype(auto) operator-=(Q&& lhs, const quantity<R2, Rep2>& rhs); - template<Mutable<quantity> Q, auto R2, typename Rep2> - requires see below - friend constexpr decltype(auto) operator%=(Q&& lhs, const quantity<R2, Rep2>& rhs); - - template<Mutable<quantity> Q, ValuePreservingTo<Rep> Value> - requires see below - friend constexpr decltype(auto) operator*=(Q&& lhs, const Value& rhs); - template<Mutable<quantity> Q, ValuePreservingTo<Rep> Value> - requires see below - friend constexpr decltype(auto) operator/=(Q&& lhs, const Value& rhs); - - template<Mutable<quantity> Q, QuantityOf<dimensionless> Q2> - requires see below - friend constexpr decltype(auto) operator*=(Q&& lhs, const Q2& rhs); - template<Mutable<quantity> Q, QuantityOf<dimensionless> Q2> - requires see below - friend constexpr decltype(auto) operator/=(Q&& lhs, const Q2& rhs); - - // [qty.arith.ops], arithmetic operations - - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires CommonlyInvocableQuantities<std::plus<>, quantity, quantity<R2, Rep2>> - friend constexpr Quantity auto operator+(const Q& lhs, const quantity<R2, Rep2>& rhs); - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires CommonlyInvocableQuantities<std::minus<>, quantity, quantity<R2, Rep2>> - friend constexpr Quantity auto operator-(const Q& lhs, const quantity<R2, Rep2>& rhs); - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires(!treat_as_floating_point<Rep>) && (!treat_as_floating_point<Rep2>) && - CommonlyInvocableQuantities<std::modulus<>, quantity, quantity<R2, Rep2>> - friend constexpr Quantity auto operator%(const Q& lhs, const quantity<R2, Rep2>& rhs); - - template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::plus<>, Rep, const Value&> - friend constexpr Quantity auto operator+(const Q& lhs, const Value& rhs); - template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::minus<>, Rep, const Value&> - friend constexpr Quantity auto operator-(const Q& lhs, const Value& rhs); - template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::modulus<>, Rep, const Value&> - friend constexpr Quantity auto operator%(const Q& lhs, const Value& rhs); - - template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::plus<>, Rep, const Value&> - friend constexpr Quantity auto operator+(const Value& lhs, const Q& rhs); - template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::minus<>, Rep, const Value&> - friend constexpr Quantity auto operator-(const Value& lhs, const Q& rhs); - template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::modulus<>, Rep, const Value&> - friend constexpr Quantity auto operator%(const Value& lhs, const Q& rhs); - - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires InvocableQuantities<std::multiplies<>, quantity, quantity<R2, Rep2>> - friend constexpr Quantity auto operator*(const Q& lhs, const quantity<R2, Rep2>& rhs); - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires InvocableQuantities<std::divides<>, quantity, quantity<R2, Rep2>> - friend constexpr Quantity auto operator/(const Q& lhs, const quantity<R2, Rep2>& rhs); - - template<std::derived_from<quantity> Q, typename Value> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::multiplies<>, Rep, const Value&> - friend constexpr QuantityOf<quantity_spec> auto operator*(const Q& lhs, const Value& rhs); - template<std::derived_from<quantity> Q, typename Value> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::divides<>, Rep, const Value&> - friend constexpr QuantityOf<quantity_spec> auto operator/(const Q& lhs, const Value& rhs); - - template<typename Value, std::derived_from<quantity> Q> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::multiplies<>, const Value&, Rep> - friend constexpr QuantityOf<quantity_spec> auto operator*(const Value& lhs, const Q& rhs); - template<typename Value, std::derived_from<quantity> Q> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::divides<>, const Value&, Rep> - friend constexpr Quantity auto operator/(const Value&, const Q&); - - // [qty.cmp], comparison - - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires see below - friend constexpr bool operator==(const Q& lhs, const quantity<R2, Rep2>& rhs); - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires see below - friend constexpr auto operator<=>(const Q& lhs, const quantity<R2, Rep2>& rhs); - - template<std::derived_from<quantity> Q, Representation Value> - requires see below - friend constexpr bool operator==(const Q& lhs, const Value& rhs); - template<std::derived_from<quantity> Q, Representation Value> - requires see below - friend constexpr auto operator<=>(const Q& lhs, const Value& rhs); - - // [qty.val.cmp], value comparison - friend constexpr bool is_eq_zero(const quantity& q) requires see below; - friend constexpr bool is_neq_zero(const quantity& q) requires see below; - friend constexpr bool is_lt_zero(const quantity& q) requires see below; - friend constexpr bool is_gt_zero(const quantity& q) requires see below; - friend constexpr bool is_lteq_zero(const quantity& q) requires see below; - friend constexpr bool is_gteq_zero(const quantity& q) requires see below; -}; - -template<Representation Value, Reference R> -quantity(Value, R) -> quantity<R{}, Value>; - -template<Representation Value> -quantity(Value) -> quantity<one, Value>; - -template<QuantityLike Q> -explicit(quantity_like_traits<Q>::explicit_import) quantity(Q) - -> quantity<quantity_like_traits<Q>::reference, typename quantity_like_traits<Q>::rep>; - -} -
quantity<R, Rep> is a structural type (N4971, [temp.param]) -if Rep is a structural type.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.systems.html b/HEAD/api_reference/gen/qty.systems.html deleted file mode 100644 index 00ec3463..00000000 --- a/HEAD/api_reference/gen/qty.systems.html +++ /dev/null @@ -1 +0,0 @@ -[qty.systems]

5 Quantities and units library [quantities]

5.8 Systems [qty.systems]

\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.unary.ops.html b/HEAD/api_reference/gen/qty.unary.ops.html deleted file mode 100644 index 593111fd..00000000 --- a/HEAD/api_reference/gen/qty.unary.ops.html +++ /dev/null @@ -1,31 +0,0 @@ -[qty.unary.ops]

5 Quantities and units library [quantities]

5.6 Quantity [qty]

5.6.9 Unary operations [qty.unary.ops]

In the following descriptions, -let @ be the operator.
constexpr QuantityOf<quantity_spec> auto operator+() const - requires see below; -constexpr QuantityOf<quantity_spec> auto operator-() const - requires see below; -
Effects: Equivalent to: -return ​::​mp_units​::​quantity{@numerical-value, reference};
Remarks: The expression in the requires-clause is equivalent to: -requires(const rep v) { - { @v } -> std::common_with<rep>; -} -
template<Mutable<quantity> Q> -friend constexpr decltype(auto) operator++(Q&& q) - requires see below; -template<Mutable<quantity> Q> -friend constexpr decltype(auto) operator--(Q&& q) - requires see below; -
Effects: Equivalent to -@q.numerical-value.
Returns: std​::​forward<Q>(q).
Remarks: The expression in the requires-clause is equivalent to: -requires(rep& v) { - { @v } -> std::same_as<rep&>; -} -
constexpr QuantityOf<quantity_spec> auto operator++(int) - requires see below; -constexpr QuantityOf<quantity_spec> auto operator--(int) - requires see below; -
Effects: Equivalent to: -return ​::​mp_units​::​quantity{numerical-value@, reference};
Remarks: The expression in the requires-clause is equivalent to: -requires(rep& v) { - { v@ } -> std::common_with<rep>; -} -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.unit.cmp.html b/HEAD/api_reference/gen/qty.unit.cmp.html deleted file mode 100644 index cd9fbc3f..00000000 --- a/HEAD/api_reference/gen/qty.unit.cmp.html +++ /dev/null @@ -1,20 +0,0 @@ -[qty.unit.cmp]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.4 Unit [qty.unit]

5.4.4.7 Comparison [qty.unit.cmp]

template<Unit Lhs, Unit Rhs> -friend consteval bool operator==(Lhs, Rhs); -
Returns: std​::​is_same_v<Lhs, Rhs>.
template<Unit Lhs, Unit Rhs> -friend consteval bool equivalent(Lhs lhs, Rhs rhs); -
Effects: Equivalent to: -const auto lhs_canonical = get-canonical-unit(lhs); -const auto rhs_canonical = get-canonical-unit(rhs); -return lhs_canonical.mag == rhs_canonical.mag && - lhs_canonical.reference_unit == rhs_canonical.reference_unit; -
template<Unit From, Unit To> -consteval bool convertible(From from, To to); -
Effects: Equivalent to: -if constexpr (std::is_same_v<From, To>) - return true; -else if constexpr (PotentiallyConvertibleTo<From, To>) - return std::is_same_v<decltype(get-canonical-unit(from).reference_unit), - decltype(get-canonical-unit(to).reference_unit)>; -else - return false; -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.unit.concepts.html b/HEAD/api_reference/gen/qty.unit.concepts.html deleted file mode 100644 index f414e9ca..00000000 --- a/HEAD/api_reference/gen/qty.unit.concepts.html +++ /dev/null @@ -1,34 +0,0 @@ -[qty.unit.concepts]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.4 Unit [qty.unit]

5.4.4.4 Concepts [qty.unit.concepts]

template<typename T> -concept Unit = SymbolicConstant<T> && std::derived_from<T, unit-interface>; - -template<typename T> -concept PrefixableUnit = Unit<T> && is-derived-from-specialization-of<T, named_unit>(); - -template<typename T> -concept AssociatedUnit = Unit<U> && has-associated-quantity(U{}); - -template<typename U, auto QS> -concept UnitOf = AssociatedUnit<U> && QuantitySpec<decltype(QS)> && - QuantitySpecConvertibleTo<get_quantity_spec(U{}), QS> && - (get_kind(QS) == get_kind(get_quantity_spec(U{})) || - !NestedQuantityKindSpecOf<get_quantity_spec(U{}), QS>); - -template<auto From, auto To> -concept UnitConvertibleTo = // exposition only - Unit<decltype(From)> && Unit<decltype(To)> && (convertible(From, To)); - -template<typename U, auto FromU, auto QS> -concept UnitCompatibleWith = // exposition only - Unit<U> && Unit<decltype(FromU)> && QuantitySpec<decltype(QS)> && - (!AssociatedUnit<U> || UnitOf<U, QS>) && UnitConvertibleTo<FromU, U{}>; - -template<typename T> -concept OffsetUnit = Unit<T> && requires { T::point-origin; }; // exposition only - -template<typename From, typename To> -concept PotentiallyConvertibleTo = // exposition only - Unit<From> && Unit<To> && - ((AssociatedUnit<From> && AssociatedUnit<To> && - implicitly_convertible(get_quantity_spec(From{}), get_quantity_spec(To{}))) || - (!AssociatedUnit<From> && !AssociatedUnit<To>)); -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.unit.general.html b/HEAD/api_reference/gen/qty.unit.general.html deleted file mode 100644 index 69d6064b..00000000 --- a/HEAD/api_reference/gen/qty.unit.general.html +++ /dev/null @@ -1,2 +0,0 @@ -[qty.unit.general]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.4 Unit [qty.unit]

5.4.4.1 General [qty.unit.general]

Subclause [qty.unit] specifies the components -for defining a unit of measurement (IEC 60050, 112-01-14).
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.unit.html b/HEAD/api_reference/gen/qty.unit.html deleted file mode 100644 index 9816ef5b..00000000 --- a/HEAD/api_reference/gen/qty.unit.html +++ /dev/null @@ -1,466 +0,0 @@ -[qty.unit]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.4 Unit [qty.unit]

5.4.4.1 General [qty.unit.general]

Subclause [qty.unit] specifies the components -for defining a unit of measurement (IEC 60050, 112-01-14).

5.4.4.2 Magnitude [qty.unit.mag]

5.4.4.2.1 General [qty.unit.mag.general]

Subclause [qty.unit.mag] specifies the components -used to represent the numerical value (IEC 60050, 112-01-29) of a unit -with support for powers (IEC 60050, 102-02-08) of real numbers (IEC 60050, 102-02-05).

5.4.4.2.2 Concepts [qty.unit.mag.concepts]

template<typename T> -concept MagConstant = SymbolicConstant<T> && is-derived-from-specialization-of<T, mag_constant>(); - -template<typename T> -concept UnitMagnitude = (is-specialization-of<T, unit-magnitude>()); - -template<typename T> -concept MagArg = std::integral<T> || MagConstant<T>; // exposition only -

5.4.4.2.3 Types [qty.unit.mag.types]

namespace mp_units { - -template<symbol_text Symbol, long double Value> - requires(Value > 0) -struct mag_constant { - static constexpr auto symbol = Symbol; // exposition only - static constexpr long double value = Value; // exposition only -}; - -} -
A specialization of mag_constant represents a real number (IEC 60050, 102-02-05).
Symbol is its symbol, and -Value is (an approximation of) its value.
namespace mp_units { - -template<auto... Ms> -struct unit-magnitude { // exposition only - // [qty.unit.mag.ops], operations - - template<UnitMagnitude M> - friend consteval UnitMagnitude auto operator*(unit-magnitude lhs, M rhs); - - friend consteval auto operator/(unit-magnitude lhs, UnitMagnitude auto rhs); - - template<UnitMagnitude Rhs> - friend consteval bool operator==(unit-magnitude, Rhs); - - template<int Num, int Den = 1> - friend consteval auto pow(unit-magnitude); // exposition only - - // [qty.unit.mag.utils], utilities - - friend consteval bool is-positive-integral-power(unit-magnitude); // exposition only - - template<auto... Ms2> - friend consteval auto common-magnitude(unit-magnitude, // exposition only - unit-magnitude<Ms2...>); -}; - -} -
A specialization of unit-magnitude -represents the product of its template arguments.
For the purposes of specifying the implementation-defined limits, -let the representation of the terms of unit-magnitude be the structure -struct { - ratio exp; - base-type base; -}; - -representing the number , -where base-type is a model of MagArg.
  • There is a single term for each base-type.
  • exp.num is not expanded into base.
    [Note 1: 
    is not permitted.
    — end note]
  • exp.den can reduce the base.
    [Note 2: 
    is permitted.
    — end note]
  • If the result of an operation on std​::​intmax_t values is undefined, -the behavior is -implementation-defined.

5.4.4.2.4 Operations [qty.unit.mag.ops]

template<UnitMagnitude M> -friend consteval UnitMagnitude auto operator*(unit-magnitude lhs, M rhs); -
Returns:
  • If sizeof...(Ms) == 0 is true, returns rhs.
  • Otherwise, if std​::​is_same_v<M, unit-magnitude<>>, returns lhs.
  • Otherwise, returns an unspecified value equal to lhs ×rhs.
friend consteval auto operator/(unit-magnitude lhs, UnitMagnitude auto rhs); -
Returns: lhs * pow<-1>(rhs).
template<UnitMagnitude Rhs> -friend consteval bool operator==(unit-magnitude, Rhs); -
Returns: std​::​is_same_v<unit-magnitude, Rhs>.
template<int Num, int Den = 1> -friend consteval auto pow(unit-magnitude base); // exposition only -
Returns:
  • If Num == 0 is true, returns unit-magnitude<>{}.
  • Otherwise, returns an unspecified value equal to .
template<MagArg auto V> -constexpr UnitMagnitude auto mag = see below; -
Constraints: V is greater than 0.
Effects: If MagConstant<decltype(V)> is satisfied, -initializes mag with unit-magnitude<V>{}.
Otherwise, initializes mag with -an unspecified value equal to V.
template<std::intmax_t N, std::intmax_t D> - requires(N > 0) -constexpr UnitMagnitude auto mag_ratio = see below; -
Effects: Initializes mag_ratio with -an unspecified value equal to .
template<MagArg auto Base, int Num, int Den = 1> -constexpr UnitMagnitude auto mag_power = pow<Num, Den>(mag<Base>); -
Constraints: Base is greater than 0.

5.4.4.2.5 Utilities [qty.unit.mag.utils]

friend consteval bool is-positive-integral-power(unit-magnitude x); // exposition only -
Returns: false if x has a negative or rational exponent, and -true otherwise.
template<auto... Ms2> -friend consteval auto common-magnitude(unit-magnitude, unit-magnitude<Ms2...>); // exposition only -
Returns: The largest magnitude C -such that each input magnitude is expressible -by only positive powers relative to C.

5.4.4.3 Traits [qty.unit.traits]

template<Unit auto U> -constexpr bool space_before_unit_symbol = true; -
The formatting functions ([qty.unit.sym.fmt]) use space_before_unit_symbol -to determine whether there is a space -between the numerical value and the unit symbol.
Remarks: Pursuant to N4971, [namespace.std] ([spec.ext]), -users may specialize space_before_unit_symbol -for cv-unqualified program-defined types.
Such specializations shall be usable in constant expressions (N4971, [expr.const]) -and have type const bool.

5.4.4.4 Concepts [qty.unit.concepts]

template<typename T> -concept Unit = SymbolicConstant<T> && std::derived_from<T, unit-interface>; - -template<typename T> -concept PrefixableUnit = Unit<T> && is-derived-from-specialization-of<T, named_unit>(); - -template<typename T> -concept AssociatedUnit = Unit<U> && has-associated-quantity(U{}); - -template<typename U, auto QS> -concept UnitOf = AssociatedUnit<U> && QuantitySpec<decltype(QS)> && - QuantitySpecConvertibleTo<get_quantity_spec(U{}), QS> && - (get_kind(QS) == get_kind(get_quantity_spec(U{})) || - !NestedQuantityKindSpecOf<get_quantity_spec(U{}), QS>); - -template<auto From, auto To> -concept UnitConvertibleTo = // exposition only - Unit<decltype(From)> && Unit<decltype(To)> && (convertible(From, To)); - -template<typename U, auto FromU, auto QS> -concept UnitCompatibleWith = // exposition only - Unit<U> && Unit<decltype(FromU)> && QuantitySpec<decltype(QS)> && - (!AssociatedUnit<U> || UnitOf<U, QS>) && UnitConvertibleTo<FromU, U{}>; - -template<typename T> -concept OffsetUnit = Unit<T> && requires { T::point-origin; }; // exposition only - -template<typename From, typename To> -concept PotentiallyConvertibleTo = // exposition only - Unit<From> && Unit<To> && - ((AssociatedUnit<From> && AssociatedUnit<To> && - implicitly_convertible(get_quantity_spec(From{}), get_quantity_spec(To{}))) || - (!AssociatedUnit<From> && !AssociatedUnit<To>)); -

5.4.4.5 Types [qty.unit.types]

5.4.4.5.1 Canonical [qty.canon.unit]

namespace mp_units { - -template<UnitMagnitude M, Unit U> -struct canonical-unit { // exposition only - M mag; - U reference_unit; -}; - -} -
canonical-unit represents a unit expressed in terms of base units (IEC 60050, 112-01-18).
[Note 1: 
Other types representing units are equal only if they have the same type.
canonical-unit is used to implement binary relations other than equality.
— end note]
reference_unit is simplified ([qty.sym.expr.algos]).
consteval auto get-canonical-unit(Unit auto u); // exposition only -
Returns: The instantiation of canonical-unit for u.

5.4.4.5.2 Scaled [qty.scaled.unit]

namespace mp_units { - -template<UnitMagnitude auto M, Unit U> - requires(M != unit-magnitude<>{} && M != mag<1>) -struct scaled_unit final : unit-interface { - using base-type = scaled_unit; // exposition only - static constexpr UnitMagnitude auto mag = M; // exposition only - static constexpr U reference-unit{}; // exposition only - static constexpr auto point-origin = U::point_origin; // exposition only, present only - // if the qualified-id U​::​point_origin is valid and denotes an object -}; - -} -
scaled_unit<M, U> is used by the library -to represent the unit M ×U.

5.4.4.5.3 Named [qty.named.unit]

namespace mp_units { - -template<symbol_text Symbol, QuantityKindSpec auto QS> - requires(!Symbol.empty()) && BaseDimension<decltype(auto(QS.dimension))> -struct named_unit<Symbol, QS> : unit-interface { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto quantity-spec = QS; // exposition only -}; - -template<symbol_text Symbol, QuantityKindSpec auto QS, PointOrigin auto PO> - requires(!Symbol.empty()) && BaseDimension<decltype(auto(QS.dimension))> -struct named_unit<Symbol, QS, PO> : unit-interface { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto quantity-spec = QS; // exposition only - static constexpr auto point-origin = PO; // exposition only -}; - -template<symbol_text Symbol> - requires(!Symbol.empty()) -struct named_unit<Symbol> : unit-interface { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only -}; - -template<symbol_text Symbol, Unit auto U> - requires(!Symbol.empty()) -struct named_unit<Symbol, U> : decltype(U)::base-type { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only -}; - -template<symbol_text Symbol, Unit auto U, PointOrigin auto PO> - requires(!Symbol.empty()) -struct named_unit<Symbol, U, PO> : decltype(U)::base-type { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto point-origin = PO; // exposition only -}; - -template<symbol_text Symbol, AssociatedUnit auto U, QuantityKindSpec auto QS> - requires(!Symbol.empty()) && (QS.dimension == get-associated-quantity(U).dimension) -struct named_unit<Symbol, U, QS> : decltype(U)::base-type { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto quantity-spec = QS; // exposition only -}; - -template<symbol_text Symbol, AssociatedUnit auto U, QuantityKindSpec auto QS, - PointOrigin auto PO> - requires(!Symbol.empty()) && (QS.dimension == get-associated-quantity(U).dimension) -struct named_unit<Symbol, U, QS, PO> : decltype(U)::base-type { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto quantity-spec = QS; // exposition only - static constexpr auto point-origin = PO; // exposition only -}; - -} -
A named unit is a type that models PrefixableUnit.
A specialization of named_unit is used as a base type when defining a named unit.
In the following descriptions, let U be a named unit defined with an alluded signature.
The identifier of U represents -its unit name (IEC 60050, 112-01-15) -or special unit name (IEC 60050, 112-01-16).
Symbol is its unit symbol (IEC 60050, 112-01-17).
The possible arguments to named_unit are -
  • ,
  • ,
  • , and
  • .
The first signature defines the unit of a base quantity -without a unit prefix (IEC 60050, 112-01-26).
The second signature defines a unit -that can be reused by several base quantities.
The third and fourth signatures with a unit expression argument E -define U as implicitly convertible from E.
The first and fourth signatures with a kind of quantity (IEC 60050, 112-01-04) Q -also restrict U to Q.
A point origin argument specifies the default point origin of U ([qty.pt.syn]).
[Example 1: // The first signature defines a base unit restricted to a kind of base quantity. -inline constexpr struct second final : named_unit<"s", kind_of<time>> { -} second; - -// The third and fourth signatures give a name to the unit argument. -inline constexpr struct minute final : named_unit<"min", mag<60> * second> { -} minute; // . - -// The fourth signature also further restricts the kind of quantity. -inline constexpr struct hertz final : named_unit<"Hz", inverse(second), kind_of<frequency>> { -} hertz; // Hz can't measure becquerel, activity, - // or any other quantity with dimension - // that isn't a kind of frequency. - — end example]

5.4.4.5.4 Prefixed [qty.prefixed.unit]

namespace mp_units { - -template<symbol_text Symbol, UnitMagnitude auto M, PrefixableUnit auto U> - requires(!Symbol.empty()) -struct prefixed_unit : decltype(M * U)::base-type { - using base-type = prefixed_unit; // exposition only - static constexpr auto symbol = Symbol + U.symbol; // exposition only -}; - -} -
prefixed_unit<Symbol, M, U> represents the unit U with a unit prefix (IEC 60050, 112-01-26).
Symbol is the symbol of the unit prefix.
M is the factor of the unit prefix.
A specialization of prefixed_unit is used as a base type when defining a unit prefix.
[Example 1: template<PrefixableUnit auto U> -struct kilo_ : prefixed_unit<"k", mag_power<10, 3>, U> {}; - -template<PrefixableUnit auto U> -constexpr kilo_<U> kilo; - -inline constexpr auto kilogram = kilo<si::gram>; - — end example]

5.4.4.5.5 Common [qty.common.unit]

namespace mp_units { - -template<Unit U1, Unit U2, Unit... Rest> -struct common_unit final : decltype(get-common-scaled-unit(U1{}, U2{}, Rest{}...))::base-type -{ - using base-type = common_unit; // exposition only - static constexpr auto common-unit = // exposition only - get-common-scaled-unit(U1{}, U2{}, Rest{}...); -}; - -} -
common_unit is used by the library -to encapsulate a conversion factor between units (IEC 60050, 112-01-33) -common to the operands of quantity addition.
[Example 1: 
The result of 1 * km + 1 * mi -has a common unit -encapsulated by common_unit<mi, km>.
— end example]
-A program that instantiates a specialization of common_unit -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
template<Unit U1, Unit U2, Unit... Rest> -consteval Unit auto get-common-scaled-unit(U1, U2, Rest... rest) // exposition only - requires see below; -
Effects: Equivalent to: -constexpr auto res = [] { - constexpr auto canonical_lhs = get-canonical-unit(U1{}); - constexpr auto canonical_rhs = get-canonical-unit(U2{}); - constexpr auto common_mag = common-magnitude(canonical_lhs.mag, canonical_rhs.mag); - if constexpr (common_mag == mag<1>) - return canonical_lhs.reference_unit; - else - return scaled_unit<common_mag, decltype(auto(canonical_lhs.reference_unit))>{}; -}(); -if constexpr (sizeof...(rest) == 0) - return res; -else - return get-common-scaled-unit(res, rest...); -
Remarks: The expression in the requires-clause is equivalent to: -(convertible(U1{}, U2{}) && (sizeof...(Rest) == 0 || requires { - get-common-scaled-unit(get-common-scaled-unit(u1, u2), rest...); - })) -

5.4.4.5.6 Derived [qty.derived.unit]

namespace mp_units { - -template<typename... Expr> -struct derived-unit-impl : // exposition only - unit-interface, - expr-fractions<struct one, Expr...> { - using base-type = derived-unit-impl; // exposition only -}; - -template<SymbolicConstant... Expr> -struct derived_unit final : derived-unit-impl<Expr...> {}; - -} -
derived_unit is used by the library -to represent a derived unit (IEC 60050, 112-01-19).
[Example 1: using namespace si::unit_symbols; -int x = m * m; // error: cannot construct from derived_unit<power<si​::​metre, 2>> -int y = m * s; // error: cannot construct from derived_unit<si​::​metre, si​::​second> -int z = m / s; // error: cannot construct from derived_unit<si​::​metre, per<si​::​second>> - — end example]
-A program that instantiates a specialization of derived_unit -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.

5.4.4.5.7 One [qty.unit.one]

namespace mp_units { - -struct one final : derived-unit-impl<> {}; - -} -
one represents the base unit (IEC 60050, 112-01-18) of a quantity of dimension one (IEC 60050, 112-01-13).

5.4.4.6 Operations [qty.unit.ops]

namespace mp_units { - -struct unit-interface { // exposition only - template<UnitMagnitude M, Unit U> - friend consteval Unit auto operator*(M, U u); - - friend consteval Unit auto operator*(Unit auto, UnitMagnitude auto) = delete; - - template<UnitMagnitude M, Unit U> - friend consteval Unit auto operator/(M mag, U u); - - template<Unit Lhs, Unit Rhs> - friend consteval Unit auto operator*(Lhs lhs, Rhs rhs); - - template<Unit Lhs, Unit Rhs> - friend consteval Unit auto operator/(Lhs lhs, Rhs rhs); - - // [qty.unit.cmp], comparison - - template<Unit Lhs, Unit Rhs> - friend consteval bool operator==(Lhs, Rhs); - - template<Unit Lhs, Unit Rhs> - friend consteval bool equivalent(Lhs lhs, Rhs rhs); -}; - -} -
template<UnitMagnitude M, Unit U> -friend consteval Unit auto operator*(M, U u); -
Effects: Equivalent to: -if constexpr (std::is_same_v<M, decltype(auto(mag<1>))>) - return u; -else if constexpr (is-specialization-of<U, scaled_unit>()) { - if constexpr (M{} * U::mag == mag<1>) - return U::reference-unit; - else - return scaled_unit<M{} * U::mag, decltype(auto(U::reference-unit))>{}; -} else - return scaled_unit<M{}, U>{}; -
friend consteval Unit auto operator*(Unit auto, UnitMagnitude auto) = delete; -
Recommended practice: Suggest swapping the operands.
template<UnitMagnitude M, Unit U> -friend consteval Unit auto operator/(M mag, U u); -
Returns: mag * inverse(u).
template<Unit Lhs, Unit Rhs> -friend consteval Unit auto operator*(Lhs lhs, Rhs rhs); -
Returns: expr-multiply<derived_unit, struct one>(lhs, rhs).
template<Unit Lhs, Unit Rhs> -friend consteval Unit auto operator/(Lhs lhs, Rhs rhs); -
Returns: expr-divide<derived_unit, struct one>(lhs, rhs).
consteval Unit auto inverse(Unit auto u); -
Returns: one / u.
template<std::intmax_t Num, std::intmax_t Den = 1, Unit U> - requires(Den != 0) -consteval Unit auto pow(U u); -
Returns: expr-pow<Num, Den, derived_unit, struct one>(u).
consteval Unit auto sqrt(Unit auto u); -
Returns: pow<1, 2>(u).
consteval Unit auto cbrt(Unit auto u); -
Returns: pow<1, 3>(u).
consteval Unit auto square(Unit auto u); -
Returns: pow<2>(u).
consteval Unit auto cubic(Unit auto u); -
Returns: pow<3>(u).

5.4.4.7 Comparison [qty.unit.cmp]

template<Unit Lhs, Unit Rhs> -friend consteval bool operator==(Lhs, Rhs); -
Returns: std​::​is_same_v<Lhs, Rhs>.
template<Unit Lhs, Unit Rhs> -friend consteval bool equivalent(Lhs lhs, Rhs rhs); -
Effects: Equivalent to: -const auto lhs_canonical = get-canonical-unit(lhs); -const auto rhs_canonical = get-canonical-unit(rhs); -return lhs_canonical.mag == rhs_canonical.mag && - lhs_canonical.reference_unit == rhs_canonical.reference_unit; -
template<Unit From, Unit To> -consteval bool convertible(From from, To to); -
Effects: Equivalent to: -if constexpr (std::is_same_v<From, To>) - return true; -else if constexpr (PotentiallyConvertibleTo<From, To>) - return std::is_same_v<decltype(get-canonical-unit(from).reference_unit), - decltype(get-canonical-unit(to).reference_unit)>; -else - return false; -

5.4.4.8 Observers [qty.unit.obs]

consteval QuantitySpec auto get_quantity_spec(AssociatedUnit auto u); -
Returns: kind_of<get-associated-quantity(u)>.
consteval Unit auto get_unit(AssociatedUnit auto u); -
Returns: u.
consteval Unit auto get_common_unit(Unit auto... us) - requires see below; -
Let -
  • u1 be us...[0],
  • u2 be us...[1],
  • U1 be decltype(u1),
  • U2 be decltype(u2), and
  • rest be a pack denoting the elements of us without u1 and u2.
Effects: Equivalent to: -if constexpr (sizeof...(us) == 1) - return u1; -else if constexpr (sizeof...(us) == 2) { - if constexpr (is-derived-from-specialization-of<U1, common_unit>()) { - return TBD.; - } else if constexpr (is-derived-from-specialization-of<U2, common_unit>()) - return get_common_unit(u2, u1); - else if constexpr (std::is_same_v<U1, U2>) - return u1; - else if constexpr (equivalent(U1{}, U2{})) { - if constexpr (std::derived_from<U1, typename U2::base-type>) - return u1; - else if constexpr (std::derived_from<U2, typename U1::base-type>) - return u2; - else - return std::conditional_t<type-less-impl<U1, U2>(), U1, U2>{}; - } else { - constexpr auto canonical_lhs = get-canonical-unit(U1{}); - constexpr auto canonical_rhs = get-canonical-unit(U2{}); - - if constexpr (is-positive-integral-power(canonical_lhs.mag / canonical_rhs.mag)) - return u2; - else if constexpr (is-positive-integral-power(canonical_rhs.mag / canonical_lhs.mag)) - return u1; - else { - if constexpr (type-less<U1, U2>{}) - return common_unit<U1, U2>{}; - else - return common_unit<U2, U1>{}; - } - } -} else - return get_common_unit(get_common_unit(u1, u2), rest...); -
Remarks: The expression in the requires-clause is equivalent to: -(sizeof...(us) != 0 && (sizeof...(us) == 1 || // - (sizeof...(us) == 2 && convertible(U1{}, U2{})) || - requires { get_common_unit(get_common_unit(u1, u2), rest...); })) -

5.4.4.9 Associated quantity [assoc.qty]

template<Unit U> -consteval bool has-associated-quantity(U); // exposition only -
Returns:
  • If U​::​quantity-spec is a valid expression, -returns true.
  • Otherwise, if U​::​reference-unit is a valid expression, -returns -has-associated-quantity(U::reference-unit) -
  • Otherwise, if -is-derived-from-specialization-of<U, expr-fractions>() -is true, -let Nums and Dens -be packs denoting the template arguments of -U​::​nums and U​::​dens, respectively.
    Returns -(... && has-associated-quantity(expr-type<Nums>{})) && - (... && has-associated-quantity(expr-type<Dens>{})) -
  • Otherwise, returns false.
template<AssociatedUnit U> -consteval auto get-associated-quantity(U u); // exposition only -
Returns:
  • If U is of the form common_unit<Us...>, -returns -get_common_quantity_spec(get-associated-quantity(Us{})...) -
  • Otherwise, if U​::​quantity-spec is a valid expression, -returns -remove-kind(U::quantity-spec) -
  • Otherwise, if U​::​reference-unit is a valid expression, -returns -get-associated-quantity(U::reference-unit) -
  • Otherwise, if -is-derived-from-specialization-of<U, expr-fractions>() -is true, -returns -expr-map<to-quantity-spec, derived_quantity_spec, struct dimensionless>(u) - -where to-quantity-spec is defined as follows: -template<AssociatedUnit U> -using to-quantity-spec = decltype(get-associated-quantity(U{})); // exposition only -

5.4.4.10 Symbol formatting [qty.unit.sym.fmt]

template<typename CharT = char, std::output_iterator<CharT> Out, Unit U> -constexpr Out unit_symbol_to(Out out, U u, const unit_symbol_formatting& fmt = {}); -
Effects: TBD.
Returns: TBD.
template<unit_symbol_formatting fmt = {}, typename CharT = char, Unit U> -consteval std::string_view unit_symbol(U); -
Effects: Equivalent to: -TBD. -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.unit.mag.concepts.html b/HEAD/api_reference/gen/qty.unit.mag.concepts.html deleted file mode 100644 index b6eebc0c..00000000 --- a/HEAD/api_reference/gen/qty.unit.mag.concepts.html +++ /dev/null @@ -1,9 +0,0 @@ -[qty.unit.mag.concepts]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.4 Unit [qty.unit]

5.4.4.2 Magnitude [qty.unit.mag]

5.4.4.2.2 Concepts [qty.unit.mag.concepts]

template<typename T> -concept MagConstant = SymbolicConstant<T> && is-derived-from-specialization-of<T, mag_constant>(); - -template<typename T> -concept UnitMagnitude = (is-specialization-of<T, unit-magnitude>()); - -template<typename T> -concept MagArg = std::integral<T> || MagConstant<T>; // exposition only -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.unit.mag.general.html b/HEAD/api_reference/gen/qty.unit.mag.general.html deleted file mode 100644 index 53f33ba3..00000000 --- a/HEAD/api_reference/gen/qty.unit.mag.general.html +++ /dev/null @@ -1,3 +0,0 @@ -[qty.unit.mag.general]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.4 Unit [qty.unit]

5.4.4.2 Magnitude [qty.unit.mag]

5.4.4.2.1 General [qty.unit.mag.general]

Subclause [qty.unit.mag] specifies the components -used to represent the numerical value (IEC 60050, 112-01-29) of a unit -with support for powers (IEC 60050, 102-02-08) of real numbers (IEC 60050, 102-02-05).
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.unit.mag.html b/HEAD/api_reference/gen/qty.unit.mag.html deleted file mode 100644 index 521b1d21..00000000 --- a/HEAD/api_reference/gen/qty.unit.mag.html +++ /dev/null @@ -1,83 +0,0 @@ -[qty.unit.mag]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.4 Unit [qty.unit]

5.4.4.2 Magnitude [qty.unit.mag]

5.4.4.2.1 General [qty.unit.mag.general]

Subclause [qty.unit.mag] specifies the components -used to represent the numerical value (IEC 60050, 112-01-29) of a unit -with support for powers (IEC 60050, 102-02-08) of real numbers (IEC 60050, 102-02-05).

5.4.4.2.2 Concepts [qty.unit.mag.concepts]

template<typename T> -concept MagConstant = SymbolicConstant<T> && is-derived-from-specialization-of<T, mag_constant>(); - -template<typename T> -concept UnitMagnitude = (is-specialization-of<T, unit-magnitude>()); - -template<typename T> -concept MagArg = std::integral<T> || MagConstant<T>; // exposition only -

5.4.4.2.3 Types [qty.unit.mag.types]

namespace mp_units { - -template<symbol_text Symbol, long double Value> - requires(Value > 0) -struct mag_constant { - static constexpr auto symbol = Symbol; // exposition only - static constexpr long double value = Value; // exposition only -}; - -} -
A specialization of mag_constant represents a real number (IEC 60050, 102-02-05).
Symbol is its symbol, and -Value is (an approximation of) its value.
namespace mp_units { - -template<auto... Ms> -struct unit-magnitude { // exposition only - // [qty.unit.mag.ops], operations - - template<UnitMagnitude M> - friend consteval UnitMagnitude auto operator*(unit-magnitude lhs, M rhs); - - friend consteval auto operator/(unit-magnitude lhs, UnitMagnitude auto rhs); - - template<UnitMagnitude Rhs> - friend consteval bool operator==(unit-magnitude, Rhs); - - template<int Num, int Den = 1> - friend consteval auto pow(unit-magnitude); // exposition only - - // [qty.unit.mag.utils], utilities - - friend consteval bool is-positive-integral-power(unit-magnitude); // exposition only - - template<auto... Ms2> - friend consteval auto common-magnitude(unit-magnitude, // exposition only - unit-magnitude<Ms2...>); -}; - -} -
A specialization of unit-magnitude -represents the product of its template arguments.
For the purposes of specifying the implementation-defined limits, -let the representation of the terms of unit-magnitude be the structure -struct { - ratio exp; - base-type base; -}; - -representing the number , -where base-type is a model of MagArg.
  • There is a single term for each base-type.
  • exp.num is not expanded into base.
    [Note 1: 
    is not permitted.
    — end note]
  • exp.den can reduce the base.
    [Note 2: 
    is permitted.
    — end note]
  • If the result of an operation on std​::​intmax_t values is undefined, -the behavior is -implementation-defined.

5.4.4.2.4 Operations [qty.unit.mag.ops]

template<UnitMagnitude M> -friend consteval UnitMagnitude auto operator*(unit-magnitude lhs, M rhs); -
Returns:
  • If sizeof...(Ms) == 0 is true, returns rhs.
  • Otherwise, if std​::​is_same_v<M, unit-magnitude<>>, returns lhs.
  • Otherwise, returns an unspecified value equal to lhs ×rhs.
friend consteval auto operator/(unit-magnitude lhs, UnitMagnitude auto rhs); -
Returns: lhs * pow<-1>(rhs).
template<UnitMagnitude Rhs> -friend consteval bool operator==(unit-magnitude, Rhs); -
Returns: std​::​is_same_v<unit-magnitude, Rhs>.
template<int Num, int Den = 1> -friend consteval auto pow(unit-magnitude base); // exposition only -
Returns:
  • If Num == 0 is true, returns unit-magnitude<>{}.
  • Otherwise, returns an unspecified value equal to .
template<MagArg auto V> -constexpr UnitMagnitude auto mag = see below; -
Constraints: V is greater than 0.
Effects: If MagConstant<decltype(V)> is satisfied, -initializes mag with unit-magnitude<V>{}.
Otherwise, initializes mag with -an unspecified value equal to V.
template<std::intmax_t N, std::intmax_t D> - requires(N > 0) -constexpr UnitMagnitude auto mag_ratio = see below; -
Effects: Initializes mag_ratio with -an unspecified value equal to .
template<MagArg auto Base, int Num, int Den = 1> -constexpr UnitMagnitude auto mag_power = pow<Num, Den>(mag<Base>); -
Constraints: Base is greater than 0.

5.4.4.2.5 Utilities [qty.unit.mag.utils]

friend consteval bool is-positive-integral-power(unit-magnitude x); // exposition only -
Returns: false if x has a negative or rational exponent, and -true otherwise.
template<auto... Ms2> -friend consteval auto common-magnitude(unit-magnitude, unit-magnitude<Ms2...>); // exposition only -
Returns: The largest magnitude C -such that each input magnitude is expressible -by only positive powers relative to C.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.unit.mag.ops.html b/HEAD/api_reference/gen/qty.unit.mag.ops.html deleted file mode 100644 index cdbbb642..00000000 --- a/HEAD/api_reference/gen/qty.unit.mag.ops.html +++ /dev/null @@ -1,18 +0,0 @@ -[qty.unit.mag.ops]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.4 Unit [qty.unit]

5.4.4.2 Magnitude [qty.unit.mag]

5.4.4.2.4 Operations [qty.unit.mag.ops]

template<UnitMagnitude M> -friend consteval UnitMagnitude auto operator*(unit-magnitude lhs, M rhs); -
Returns:
  • If sizeof...(Ms) == 0 is true, returns rhs.
  • Otherwise, if std​::​is_same_v<M, unit-magnitude<>>, returns lhs.
  • Otherwise, returns an unspecified value equal to lhs ×rhs.
friend consteval auto operator/(unit-magnitude lhs, UnitMagnitude auto rhs); -
Returns: lhs * pow<-1>(rhs).
template<UnitMagnitude Rhs> -friend consteval bool operator==(unit-magnitude, Rhs); -
Returns: std​::​is_same_v<unit-magnitude, Rhs>.
template<int Num, int Den = 1> -friend consteval auto pow(unit-magnitude base); // exposition only -
Returns:
  • If Num == 0 is true, returns unit-magnitude<>{}.
  • Otherwise, returns an unspecified value equal to .
template<MagArg auto V> -constexpr UnitMagnitude auto mag = see below; -
Constraints: V is greater than 0.
Effects: If MagConstant<decltype(V)> is satisfied, -initializes mag with unit-magnitude<V>{}.
Otherwise, initializes mag with -an unspecified value equal to V.
template<std::intmax_t N, std::intmax_t D> - requires(N > 0) -constexpr UnitMagnitude auto mag_ratio = see below; -
Effects: Initializes mag_ratio with -an unspecified value equal to .
template<MagArg auto Base, int Num, int Den = 1> -constexpr UnitMagnitude auto mag_power = pow<Num, Den>(mag<Base>); -
Constraints: Base is greater than 0.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.unit.mag.types.html b/HEAD/api_reference/gen/qty.unit.mag.types.html deleted file mode 100644 index e31a8256..00000000 --- a/HEAD/api_reference/gen/qty.unit.mag.types.html +++ /dev/null @@ -1,50 +0,0 @@ -[qty.unit.mag.types]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.4 Unit [qty.unit]

5.4.4.2 Magnitude [qty.unit.mag]

5.4.4.2.3 Types [qty.unit.mag.types]

namespace mp_units { - -template<symbol_text Symbol, long double Value> - requires(Value > 0) -struct mag_constant { - static constexpr auto symbol = Symbol; // exposition only - static constexpr long double value = Value; // exposition only -}; - -} -
A specialization of mag_constant represents a real number (IEC 60050, 102-02-05).
Symbol is its symbol, and -Value is (an approximation of) its value.
namespace mp_units { - -template<auto... Ms> -struct unit-magnitude { // exposition only - // [qty.unit.mag.ops], operations - - template<UnitMagnitude M> - friend consteval UnitMagnitude auto operator*(unit-magnitude lhs, M rhs); - - friend consteval auto operator/(unit-magnitude lhs, UnitMagnitude auto rhs); - - template<UnitMagnitude Rhs> - friend consteval bool operator==(unit-magnitude, Rhs); - - template<int Num, int Den = 1> - friend consteval auto pow(unit-magnitude); // exposition only - - // [qty.unit.mag.utils], utilities - - friend consteval bool is-positive-integral-power(unit-magnitude); // exposition only - - template<auto... Ms2> - friend consteval auto common-magnitude(unit-magnitude, // exposition only - unit-magnitude<Ms2...>); -}; - -} -
A specialization of unit-magnitude -represents the product of its template arguments.
For the purposes of specifying the implementation-defined limits, -let the representation of the terms of unit-magnitude be the structure -struct { - ratio exp; - base-type base; -}; - -representing the number , -where base-type is a model of MagArg.
  • There is a single term for each base-type.
  • exp.num is not expanded into base.
    [Note 1: 
    is not permitted.
    — end note]
  • exp.den can reduce the base.
    [Note 2: 
    is permitted.
    — end note]
  • If the result of an operation on std​::​intmax_t values is undefined, -the behavior is -implementation-defined.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.unit.mag.utils.html b/HEAD/api_reference/gen/qty.unit.mag.utils.html deleted file mode 100644 index 40b3675b..00000000 --- a/HEAD/api_reference/gen/qty.unit.mag.utils.html +++ /dev/null @@ -1,7 +0,0 @@ -[qty.unit.mag.utils]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.4 Unit [qty.unit]

5.4.4.2 Magnitude [qty.unit.mag]

5.4.4.2.5 Utilities [qty.unit.mag.utils]

friend consteval bool is-positive-integral-power(unit-magnitude x); // exposition only -
Returns: false if x has a negative or rational exponent, and -true otherwise.
template<auto... Ms2> -friend consteval auto common-magnitude(unit-magnitude, unit-magnitude<Ms2...>); // exposition only -
Returns: The largest magnitude C -such that each input magnitude is expressible -by only positive powers relative to C.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.unit.obs.html b/HEAD/api_reference/gen/qty.unit.obs.html deleted file mode 100644 index 9950262d..00000000 --- a/HEAD/api_reference/gen/qty.unit.obs.html +++ /dev/null @@ -1,44 +0,0 @@ -[qty.unit.obs]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.4 Unit [qty.unit]

5.4.4.8 Observers [qty.unit.obs]

consteval QuantitySpec auto get_quantity_spec(AssociatedUnit auto u); -
Returns: kind_of<get-associated-quantity(u)>.
consteval Unit auto get_unit(AssociatedUnit auto u); -
Returns: u.
consteval Unit auto get_common_unit(Unit auto... us) - requires see below; -
Let -
  • u1 be us...[0],
  • u2 be us...[1],
  • U1 be decltype(u1),
  • U2 be decltype(u2), and
  • rest be a pack denoting the elements of us without u1 and u2.
Effects: Equivalent to: -if constexpr (sizeof...(us) == 1) - return u1; -else if constexpr (sizeof...(us) == 2) { - if constexpr (is-derived-from-specialization-of<U1, common_unit>()) { - return TBD.; - } else if constexpr (is-derived-from-specialization-of<U2, common_unit>()) - return get_common_unit(u2, u1); - else if constexpr (std::is_same_v<U1, U2>) - return u1; - else if constexpr (equivalent(U1{}, U2{})) { - if constexpr (std::derived_from<U1, typename U2::base-type>) - return u1; - else if constexpr (std::derived_from<U2, typename U1::base-type>) - return u2; - else - return std::conditional_t<type-less-impl<U1, U2>(), U1, U2>{}; - } else { - constexpr auto canonical_lhs = get-canonical-unit(U1{}); - constexpr auto canonical_rhs = get-canonical-unit(U2{}); - - if constexpr (is-positive-integral-power(canonical_lhs.mag / canonical_rhs.mag)) - return u2; - else if constexpr (is-positive-integral-power(canonical_rhs.mag / canonical_lhs.mag)) - return u1; - else { - if constexpr (type-less<U1, U2>{}) - return common_unit<U1, U2>{}; - else - return common_unit<U2, U1>{}; - } - } -} else - return get_common_unit(get_common_unit(u1, u2), rest...); -
Remarks: The expression in the requires-clause is equivalent to: -(sizeof...(us) != 0 && (sizeof...(us) == 1 || // - (sizeof...(us) == 2 && convertible(U1{}, U2{})) || - requires { get_common_unit(get_common_unit(u1, u2), rest...); })) -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.unit.one.html b/HEAD/api_reference/gen/qty.unit.one.html deleted file mode 100644 index a5bdb331..00000000 --- a/HEAD/api_reference/gen/qty.unit.one.html +++ /dev/null @@ -1,6 +0,0 @@ -[qty.unit.one]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.4 Unit [qty.unit]

5.4.4.5 Types [qty.unit.types]

5.4.4.5.7 One [qty.unit.one]

namespace mp_units { - -struct one final : derived-unit-impl<> {}; - -} -
one represents the base unit (IEC 60050, 112-01-18) of a quantity of dimension one (IEC 60050, 112-01-13).
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.unit.ops.html b/HEAD/api_reference/gen/qty.unit.ops.html deleted file mode 100644 index 2b2243e5..00000000 --- a/HEAD/api_reference/gen/qty.unit.ops.html +++ /dev/null @@ -1,55 +0,0 @@ -[qty.unit.ops]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.4 Unit [qty.unit]

5.4.4.6 Operations [qty.unit.ops]

namespace mp_units { - -struct unit-interface { // exposition only - template<UnitMagnitude M, Unit U> - friend consteval Unit auto operator*(M, U u); - - friend consteval Unit auto operator*(Unit auto, UnitMagnitude auto) = delete; - - template<UnitMagnitude M, Unit U> - friend consteval Unit auto operator/(M mag, U u); - - template<Unit Lhs, Unit Rhs> - friend consteval Unit auto operator*(Lhs lhs, Rhs rhs); - - template<Unit Lhs, Unit Rhs> - friend consteval Unit auto operator/(Lhs lhs, Rhs rhs); - - // [qty.unit.cmp], comparison - - template<Unit Lhs, Unit Rhs> - friend consteval bool operator==(Lhs, Rhs); - - template<Unit Lhs, Unit Rhs> - friend consteval bool equivalent(Lhs lhs, Rhs rhs); -}; - -} -
template<UnitMagnitude M, Unit U> -friend consteval Unit auto operator*(M, U u); -
Effects: Equivalent to: -if constexpr (std::is_same_v<M, decltype(auto(mag<1>))>) - return u; -else if constexpr (is-specialization-of<U, scaled_unit>()) { - if constexpr (M{} * U::mag == mag<1>) - return U::reference-unit; - else - return scaled_unit<M{} * U::mag, decltype(auto(U::reference-unit))>{}; -} else - return scaled_unit<M{}, U>{}; -
friend consteval Unit auto operator*(Unit auto, UnitMagnitude auto) = delete; -
Recommended practice: Suggest swapping the operands.
template<UnitMagnitude M, Unit U> -friend consteval Unit auto operator/(M mag, U u); -
Returns: mag * inverse(u).
template<Unit Lhs, Unit Rhs> -friend consteval Unit auto operator*(Lhs lhs, Rhs rhs); -
Returns: expr-multiply<derived_unit, struct one>(lhs, rhs).
template<Unit Lhs, Unit Rhs> -friend consteval Unit auto operator/(Lhs lhs, Rhs rhs); -
Returns: expr-divide<derived_unit, struct one>(lhs, rhs).
consteval Unit auto inverse(Unit auto u); -
Returns: one / u.
template<std::intmax_t Num, std::intmax_t Den = 1, Unit U> - requires(Den != 0) -consteval Unit auto pow(U u); -
Returns: expr-pow<Num, Den, derived_unit, struct one>(u).
consteval Unit auto sqrt(Unit auto u); -
Returns: pow<1, 2>(u).
consteval Unit auto cbrt(Unit auto u); -
Returns: pow<1, 3>(u).
consteval Unit auto square(Unit auto u); -
Returns: pow<2>(u).
consteval Unit auto cubic(Unit auto u); -
Returns: pow<3>(u).
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.unit.sym.fmt.html b/HEAD/api_reference/gen/qty.unit.sym.fmt.html deleted file mode 100644 index b2b106fe..00000000 --- a/HEAD/api_reference/gen/qty.unit.sym.fmt.html +++ /dev/null @@ -1,7 +0,0 @@ -[qty.unit.sym.fmt]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.4 Unit [qty.unit]

5.4.4.10 Symbol formatting [qty.unit.sym.fmt]

template<typename CharT = char, std::output_iterator<CharT> Out, Unit U> -constexpr Out unit_symbol_to(Out out, U u, const unit_symbol_formatting& fmt = {}); -
Effects: TBD.
Returns: TBD.
template<unit_symbol_formatting fmt = {}, typename CharT = char, Unit U> -consteval std::string_view unit_symbol(U); -
Effects: Equivalent to: -TBD. -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.unit.traits.html b/HEAD/api_reference/gen/qty.unit.traits.html deleted file mode 100644 index 01ae2f71..00000000 --- a/HEAD/api_reference/gen/qty.unit.traits.html +++ /dev/null @@ -1,8 +0,0 @@ -[qty.unit.traits]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.4 Unit [qty.unit]

5.4.4.3 Traits [qty.unit.traits]

template<Unit auto U> -constexpr bool space_before_unit_symbol = true; -
The formatting functions ([qty.unit.sym.fmt]) use space_before_unit_symbol -to determine whether there is a space -between the numerical value and the unit symbol.
Remarks: Pursuant to N4971, [namespace.std] ([spec.ext]), -users may specialize space_before_unit_symbol -for cv-unqualified program-defined types.
Such specializations shall be usable in constant expressions (N4971, [expr.const]) -and have type const bool.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.unit.types.html b/HEAD/api_reference/gen/qty.unit.types.html deleted file mode 100644 index 4ed3ecfe..00000000 --- a/HEAD/api_reference/gen/qty.unit.types.html +++ /dev/null @@ -1,187 +0,0 @@ -[qty.unit.types]

5 Quantities and units library [quantities]

5.4 Reference [qty.ref]

5.4.4 Unit [qty.unit]

5.4.4.5 Types [qty.unit.types]

5.4.4.5.1 Canonical [qty.canon.unit]

namespace mp_units { - -template<UnitMagnitude M, Unit U> -struct canonical-unit { // exposition only - M mag; - U reference_unit; -}; - -} -
canonical-unit represents a unit expressed in terms of base units (IEC 60050, 112-01-18).
[Note 1: 
Other types representing units are equal only if they have the same type.
canonical-unit is used to implement binary relations other than equality.
— end note]
reference_unit is simplified ([qty.sym.expr.algos]).
consteval auto get-canonical-unit(Unit auto u); // exposition only -
Returns: The instantiation of canonical-unit for u.

5.4.4.5.2 Scaled [qty.scaled.unit]

namespace mp_units { - -template<UnitMagnitude auto M, Unit U> - requires(M != unit-magnitude<>{} && M != mag<1>) -struct scaled_unit final : unit-interface { - using base-type = scaled_unit; // exposition only - static constexpr UnitMagnitude auto mag = M; // exposition only - static constexpr U reference-unit{}; // exposition only - static constexpr auto point-origin = U::point_origin; // exposition only, present only - // if the qualified-id U​::​point_origin is valid and denotes an object -}; - -} -
scaled_unit<M, U> is used by the library -to represent the unit M ×U.

5.4.4.5.3 Named [qty.named.unit]

namespace mp_units { - -template<symbol_text Symbol, QuantityKindSpec auto QS> - requires(!Symbol.empty()) && BaseDimension<decltype(auto(QS.dimension))> -struct named_unit<Symbol, QS> : unit-interface { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto quantity-spec = QS; // exposition only -}; - -template<symbol_text Symbol, QuantityKindSpec auto QS, PointOrigin auto PO> - requires(!Symbol.empty()) && BaseDimension<decltype(auto(QS.dimension))> -struct named_unit<Symbol, QS, PO> : unit-interface { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto quantity-spec = QS; // exposition only - static constexpr auto point-origin = PO; // exposition only -}; - -template<symbol_text Symbol> - requires(!Symbol.empty()) -struct named_unit<Symbol> : unit-interface { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only -}; - -template<symbol_text Symbol, Unit auto U> - requires(!Symbol.empty()) -struct named_unit<Symbol, U> : decltype(U)::base-type { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only -}; - -template<symbol_text Symbol, Unit auto U, PointOrigin auto PO> - requires(!Symbol.empty()) -struct named_unit<Symbol, U, PO> : decltype(U)::base-type { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto point-origin = PO; // exposition only -}; - -template<symbol_text Symbol, AssociatedUnit auto U, QuantityKindSpec auto QS> - requires(!Symbol.empty()) && (QS.dimension == get-associated-quantity(U).dimension) -struct named_unit<Symbol, U, QS> : decltype(U)::base-type { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto quantity-spec = QS; // exposition only -}; - -template<symbol_text Symbol, AssociatedUnit auto U, QuantityKindSpec auto QS, - PointOrigin auto PO> - requires(!Symbol.empty()) && (QS.dimension == get-associated-quantity(U).dimension) -struct named_unit<Symbol, U, QS, PO> : decltype(U)::base-type { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto quantity-spec = QS; // exposition only - static constexpr auto point-origin = PO; // exposition only -}; - -} -
A named unit is a type that models PrefixableUnit.
A specialization of named_unit is used as a base type when defining a named unit.
In the following descriptions, let U be a named unit defined with an alluded signature.
The identifier of U represents -its unit name (IEC 60050, 112-01-15) -or special unit name (IEC 60050, 112-01-16).
Symbol is its unit symbol (IEC 60050, 112-01-17).
The possible arguments to named_unit are -
  • ,
  • ,
  • , and
  • .
The first signature defines the unit of a base quantity -without a unit prefix (IEC 60050, 112-01-26).
The second signature defines a unit -that can be reused by several base quantities.
The third and fourth signatures with a unit expression argument E -define U as implicitly convertible from E.
The first and fourth signatures with a kind of quantity (IEC 60050, 112-01-04) Q -also restrict U to Q.
A point origin argument specifies the default point origin of U ([qty.pt.syn]).
[Example 1: // The first signature defines a base unit restricted to a kind of base quantity. -inline constexpr struct second final : named_unit<"s", kind_of<time>> { -} second; - -// The third and fourth signatures give a name to the unit argument. -inline constexpr struct minute final : named_unit<"min", mag<60> * second> { -} minute; // . - -// The fourth signature also further restricts the kind of quantity. -inline constexpr struct hertz final : named_unit<"Hz", inverse(second), kind_of<frequency>> { -} hertz; // Hz can't measure becquerel, activity, - // or any other quantity with dimension - // that isn't a kind of frequency. - — end example]

5.4.4.5.4 Prefixed [qty.prefixed.unit]

namespace mp_units { - -template<symbol_text Symbol, UnitMagnitude auto M, PrefixableUnit auto U> - requires(!Symbol.empty()) -struct prefixed_unit : decltype(M * U)::base-type { - using base-type = prefixed_unit; // exposition only - static constexpr auto symbol = Symbol + U.symbol; // exposition only -}; - -} -
prefixed_unit<Symbol, M, U> represents the unit U with a unit prefix (IEC 60050, 112-01-26).
Symbol is the symbol of the unit prefix.
M is the factor of the unit prefix.
A specialization of prefixed_unit is used as a base type when defining a unit prefix.
[Example 1: template<PrefixableUnit auto U> -struct kilo_ : prefixed_unit<"k", mag_power<10, 3>, U> {}; - -template<PrefixableUnit auto U> -constexpr kilo_<U> kilo; - -inline constexpr auto kilogram = kilo<si::gram>; - — end example]

5.4.4.5.5 Common [qty.common.unit]

namespace mp_units { - -template<Unit U1, Unit U2, Unit... Rest> -struct common_unit final : decltype(get-common-scaled-unit(U1{}, U2{}, Rest{}...))::base-type -{ - using base-type = common_unit; // exposition only - static constexpr auto common-unit = // exposition only - get-common-scaled-unit(U1{}, U2{}, Rest{}...); -}; - -} -
common_unit is used by the library -to encapsulate a conversion factor between units (IEC 60050, 112-01-33) -common to the operands of quantity addition.
[Example 1: 
The result of 1 * km + 1 * mi -has a common unit -encapsulated by common_unit<mi, km>.
— end example]
-A program that instantiates a specialization of common_unit -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
template<Unit U1, Unit U2, Unit... Rest> -consteval Unit auto get-common-scaled-unit(U1, U2, Rest... rest) // exposition only - requires see below; -
Effects: Equivalent to: -constexpr auto res = [] { - constexpr auto canonical_lhs = get-canonical-unit(U1{}); - constexpr auto canonical_rhs = get-canonical-unit(U2{}); - constexpr auto common_mag = common-magnitude(canonical_lhs.mag, canonical_rhs.mag); - if constexpr (common_mag == mag<1>) - return canonical_lhs.reference_unit; - else - return scaled_unit<common_mag, decltype(auto(canonical_lhs.reference_unit))>{}; -}(); -if constexpr (sizeof...(rest) == 0) - return res; -else - return get-common-scaled-unit(res, rest...); -
Remarks: The expression in the requires-clause is equivalent to: -(convertible(U1{}, U2{}) && (sizeof...(Rest) == 0 || requires { - get-common-scaled-unit(get-common-scaled-unit(u1, u2), rest...); - })) -

5.4.4.5.6 Derived [qty.derived.unit]

namespace mp_units { - -template<typename... Expr> -struct derived-unit-impl : // exposition only - unit-interface, - expr-fractions<struct one, Expr...> { - using base-type = derived-unit-impl; // exposition only -}; - -template<SymbolicConstant... Expr> -struct derived_unit final : derived-unit-impl<Expr...> {}; - -} -
derived_unit is used by the library -to represent a derived unit (IEC 60050, 112-01-19).
[Example 1: using namespace si::unit_symbols; -int x = m * m; // error: cannot construct from derived_unit<power<si​::​metre, 2>> -int y = m * s; // error: cannot construct from derived_unit<si​::​metre, si​::​second> -int z = m / s; // error: cannot construct from derived_unit<si​::​metre, per<si​::​second>> - — end example]
-A program that instantiates a specialization of derived_unit -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.

5.4.4.5.7 One [qty.unit.one]

namespace mp_units { - -struct one final : derived-unit-impl<> {}; - -} -
one represents the base unit (IEC 60050, 112-01-18) of a quantity of dimension one (IEC 60050, 112-01-13).
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.utils.html b/HEAD/api_reference/gen/qty.utils.html deleted file mode 100644 index bf8bdf22..00000000 --- a/HEAD/api_reference/gen/qty.utils.html +++ /dev/null @@ -1,257 +0,0 @@ -[qty.utils]

5 Quantities and units library [quantities]

5.3 Utilities [qty.utils]

5.3.1 Non-types [qty.utils.non.types]

template<typename T, template<see below> typename U> -consteval bool is-specialization-of(); // exposition only -template<typename T, template<see below> typename U> -consteval bool is-derived-from-specialization-of(); // exposition only -
Returns:
  • For the first signature, -true of T is a specialization of U, and -false otherwise.
  • For the second signature, -true if T has exactly one public base class -that is a specialization of U -and has no other base class that is a specialization of U, and -false otherwise.
Remarks: An implementation provides enough overloads for all arguments to U.

5.3.2 Ratio [qty.ratio]

namespace mp_units { - -struct ratio { // exposition only - std::intmax_t num; - std::intmax_t den; - - consteval ratio(std::intmax_t n, std::intmax_t d = 1); - - friend consteval bool operator==(ratio, ratio) = default; - friend consteval auto operator<=>(ratio lhs, ratio rhs) { return (lhs - rhs).num <=> 0; } - - friend consteval ratio operator-(ratio r) { return {-r.num, r.den}; } - - friend consteval ratio operator+(ratio lhs, ratio rhs) - { - return {lhs.num * rhs.den + lhs.den * rhs.num, lhs.den * rhs.den}; - } - - friend consteval ratio operator-(ratio lhs, ratio rhs) { return lhs + (-rhs); } - - friend consteval ratio operator*(ratio lhs, ratio rhs); - - friend consteval ratio operator/(ratio lhs, ratio rhs) - { - return lhs * ratio{rhs.den, rhs.num}; - } -}; - -consteval bool is-integral(ratio r) { return r.num % r.den == 0; } - -consteval ratio common-ratio(ratio r1, ratio r2); - -} -
ratio represents the rational number .
Unless otherwise specified, -in the following descriptions, -let R(r) be std​::​ratio<N, D>, -where N and D are the values of r.num and r.den.
consteval ratio(std::intmax_t n, std::intmax_t d = 1); -
Let N and D be the values of n and d.
Let R be std​::​ratio<N, D>.
Effects: Equivalent to -R.
Postconditions: num == R​::​num && den == R​::​den is true.
friend consteval ratio operator*(ratio lhs, ratio rhs); -
Let Res be std​::​ratio_multiply<R(lhs), R(rhs)>.
Effects: Equivalent to: -return {Res​::​num, Res​::​den};
consteval ratio common-ratio(ratio r1, ratio r2); -
Let Res be equal to -std::common_type<std::chrono::duration<int, R(r1)>, - std::chrono::duration<int, R(r2)>>::type::period -
Effects: Equivalent to: -return {Res​::​num, Res​::​den};

5.3.3 Symbol text [qty.sym.txt]

namespace mp_units { - -template<std::size_t N, std::size_t M> -class symbol_text { -public: - std::fixed_u8string<N> utf8; // exposition only - std::fixed_string<M> portable; // exposition only - - // constructors - constexpr symbol_text(char portable); - consteval symbol_text(const char (&portable)[N + 1]); - constexpr symbol_text(const std::fixed_string<N>& portable); - consteval symbol_text(const char8_t (&utf8)[N + 1], const char (&portable)[M + 1]); - constexpr symbol_text(const std::fixed_u8string<N>& utf8, - const std::fixed_string<M>& portable); - - // observers - constexpr const auto& utf8() const { return utf8; } - constexpr const auto& portable() const { return portable; } - constexpr bool empty() const { return utf8().empty(); } - - // string operations - template<std::size_t N2, std::size_t M2> - friend constexpr symbol_text<N + N2, M + M2> operator+(const symbol_text& lhs, - const symbol_text<N2, M2>& rhs); - - // comparison - template<std::size_t N2, std::size_t M2> - friend constexpr bool operator==(const symbol_text& lhs, - const symbol_text<N2, M2>& rhs) noexcept; - template<std::size_t N2, std::size_t M2> - friend constexpr auto operator<=>(const symbol_text& lhs, - const symbol_text<N2, M2>& rhs) noexcept; -}; - -symbol_text(char) -> symbol_text<1, 1>; - -template<std::size_t N> -symbol_text(const char (&)[N]) -> symbol_text<N - 1, N - 1>; - -template<std::size_t N> -symbol_text(const std::fixed_string<N>&) -> symbol_text<N, N>; - -template<std::size_t N, std::size_t M> -symbol_text(const char8_t (&)[N], const char (&)[M]) -> symbol_text<N - 1, M - 1>; - -template<std::size_t N, std::size_t M> -symbol_text(const std::fixed_u8string<N>&, const std::fixed_string<M>&) -> symbol_text<N, M>; - -} -
symbol_text represents a symbol text.
utf8 stores its UTF-8 representation, and -portable stores its portable representation.
symbol_text<N, M> is a structural type (N4971, [temp.param]).
In the descriptions that follow, -it is a Precondition that -
  • values of char are in the basic literal character set (N4971, [lex.charset]), and
  • for a parameter of the form const CharT (&txt)[M], -(txt[M - 1] == CharT()) is true.
constexpr symbol_text(char portable); -consteval symbol_text(const char (&portable)[N + 1]); -constexpr symbol_text(const std::fixed_string<N>& portable); -consteval symbol_text(const char8_t (&utf8)[N + 1], const char (&portable)[M + 1]); -constexpr symbol_text(const std::fixed_u8string<N>& utf8, const std::fixed_string<M>& portable); -
For the constructors without a parameter named utf8, -let utf8 be: -std::bit_cast<std::fixed_u8string<N>>(std::basic_fixed_string(portable)) -
Effects: Equivalent to the mem-initializer-list: -utf8{utf8}, portable{portable} -
template<std::size_t N2, std::size_t M2> -friend constexpr symbol_text<N + N2, M + M2> operator+(const symbol_text& lhs, - const symbol_text<N2, M2>& rhs); -
Effects: Equivalent to: -return symbol_text<N + N2, M + M2>(lhs.utf8() + rhs.utf8(), - lhs.portable() + rhs.portable()); -
template<std::size_t N2, std::size_t M2> -friend constexpr bool operator==(const symbol_text& lhs, - const symbol_text<N2, M2>& rhs) noexcept; -template<std::size_t N2, std::size_t M2> -friend constexpr auto operator<=>(const symbol_text& lhs, - const symbol_text<N2, M2>& rhs) noexcept; -
Let @ be the operator.
Effects: Equivalent to: -return std::make_tuple(std::cref(lhs.utf8()), std::cref(lhs.portable())) @ - std::make_tuple(std::cref(rhs.utf8()), std::cref(rhs.portable())); -

5.3.4 Symbolic expressions [qty.sym.expr]

5.3.4.1 General [qty.sym.expr.general]

Subclause [qty.sym.expr] specifies the components -used to maintain ordered, simplified, and readable -argument lists in the names of specializations.
[Example 1: using namespace si::unit_symbols; -int x = kg * km / square(h); // error: cannot construct from - // derived_unit<si​::​kilo_<si​::​gram>, si​::​kilo_<si​::​metre>, per<power<non_si​::​hour, 2>>> -
-The library ensures decltype(kg * km / square(h)) is styled-like as commented in diagnostics, -provided that, in the implementation-defined total order of types, -decltype(kg) is less than decltype(km).
— end example]

5.3.4.2 Concept SymbolicConstant [qty.sym.expr.concepts]

template<typename T> -concept SymbolicConstant = // exposition only - std::is_empty_v<T> && std::is_final_v<T> && std::is_trivially_default_constructible_v<T> && - std::is_trivially_copy_constructible_v<T> && std::is_trivially_move_constructible_v<T> && - std::is_trivially_destructible_v<T>; -
The concept SymbolicConstant -is used to constrain the types -that are used in symbolic expressions.

5.3.4.3 Types [qty.sym.expr.types]

namespace mp_units { - -template<typename T, typename... Ts> -struct per final {}; - -} -
per is used to store arguments with negative exponents.
A specialization of per -represents the product of the inverse of its template arguments.
A program that instantiates a specialization of per -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
namespace mp_units { - -template<typename F, int Num, int... Den> - requires see below -struct power final { - using factor = F; // exposition only - static constexpr ratio exponent{Num, Den...}; // exposition only -}; - -} -
power represents a power (IEC 60050, 102-02-08) -of the form .
[Note 1: 
Den is optional to shorten the type name when Den is 1.
— end note]
-A program that instantiates a specialization of power -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
Let r be ratio{Num, Den...}.
Let is-valid-ratio be -true if r is a valid constant expression, and -false otherwise.
The expression in the requires-clause is equivalent to: -is-valid-ratio && (r > ratio{0}) && (r != ratio{1}) -

5.3.4.4 Algorithms [qty.sym.expr.algos]

template<typename T> -using expr-type = see below; // exposition only -
expr-type<T> denotes -U if T is of the form power<U, Ints...>, and -T otherwise.
template<typename T, typename U> -consteval bool type-less-impl(); // exposition only -
Returns: true if T is less than U -in an implementation-defined total order for types, and -false otherwise.
template<typename Lhs, typename Rhs> -struct type-less : // exposition only - std::bool_constant<is-specialization-of<Rhs, power>() || - type-less-impl<expr-type<Lhs>, expr-type<Rhs>>()> {}; -
type-less meets the requirements of -the Pred parameter of the symbolic expression algorithms below.
template<typename... Ts> -struct type-list {}; // exposition only - -template<typename OneType, typename... Ts> -struct expr-fractions { // exposition only - using num = see below; // exposition only - using den = see below; // exposition only -} -
expr-fractions divides a symbolic expression to numerator and denominator parts.
Let EF be a specialization of expr-fractions.
  • If EF is of the form expr-fractions<OneType, Ts..., per<Us...>>, -then -
    • EF​::​num denotes type-list<Ts...>, and
    • EF​::​den denotes type-list<Us...>.
  • Otherwise, EF is of the form expr-fractions<OneType, Ts...>, and -
    • EF​::​num denotes type-list<Ts...>, and
    • EF​::​den denotes type-list<>.
The symbolic expression algorithms perform operations on symbolic constants.
A symbolic constant is a type that is a model of SymbolicConstant.
[Example 1: 
The dimension dim_length, the quantity time, and the unit one are symbolic constants.
— end example]
-The algorithms also support -powers with a symbolic constant base and a rational exponent, -products thereof, and -fractions thereof.
template<template<typename...> typename To, typename OneType, - template<typename, typename> typename Pred = type-less, typename Lhs, typename Rhs> -consteval auto expr-multiply(Lhs, Rhs); // exposition only - -template<template<typename...> typename To, typename OneType, - template<typename, typename> typename Pred = type-less, typename Lhs, typename Rhs> -consteval auto expr-divide(Lhs lhs, Rhs rhs); // exposition only - -template<template<typename...> typename To, typename OneType, typename T> -consteval auto expr-invert(T); // exposition only - -template<std::intmax_t Num, std::intmax_t Den, template<typename...> typename To, - typename OneType, template<typename, typename> typename Pred = type-less, typename T> - requires(Den != 0) -consteval auto expr-pow(T); // exposition only -
Mandates:
  • OneType is the neutral element (IEC 60050, 102-01-19) of the operation, and
  • Pred is a Cpp17BinaryTypeTrait (N4971, [meta.rqmts]) -with a base characteristic of std​::​bool_constant<B>.
    Pred<T, U> implements a total order for types; -B is true if T is ordered before U, and false otherwise.
Effects:
First, inputs to the operations are obtained from the types of the function parameters.
If the type of a function parameter is: -
  • A specialization of To, -then its input is the product of its template arguments, and -the following also apply.
  • A specialization of per, -then its input is the product of the inverse of its template arguments, and -the following also apply.
  • A specialization of the form power<F, Num>, -then its input is , or -a specialization of the form power<F, Num, Den>, -then its input is , and -the following also applies.
  • Otherwise, the input is the symbolic constant itself.
[Example 2: 
Item by item, this algorithm step goes from the C++ parameter type -decltype(km / square(h)), -styled in diagnostics like -derived_unit<si​::​kilo_<si​::​metre>, per<power<non_si​::​hour, 2>>, -
  • to decltype(km) ×per<power<decltype(h), 2> (product of To's arguments),
  • to (product of inverse of per's arguments),
  • to (powers as powers),
  • to where and (symbolic substitution) -in the mathematical domain.
— end example]
Then, the operation takes place: -
  • expr-multiply multiplies its inputs,
  • expr-divide divides the input of its first parameter by the input of its second parameter,
  • expr-invert divides 1 by its input, and
  • expr-pow raises its input to the .
Finally, let r be the result of the operation simplified as follows: -
  • All terms are part of the same fraction (if any).
  • There is at most a single term with a given symbolic constant.
  • There are no negative exponents.
  • 1 is only present as r and as a numerator with a denominator not equal to 1.
[Example 3: 
Item by item:

(single fraction)
(unique symbolic constants)
(positive exponents)
(non-redundant 1s)
— end example]
Returns: r is mapped to the return type: -
  • If , returns OneType{}.
  • Otherwise, if r is a symbolic constant, returns r.
  • Otherwise, first applies the following mappings to the terms of r: -
    • is mapped to power<x, n, d>, and - is mapped to power<x, n>, and
    • 1 is mapped to OneType{}.
  • Then, a denominator x of r (if any) is mapped to per<x>.
  • Then, sorts r without per (if any) and -the template arguments of per (if any) -according to Pred.
  • Finally, returns To<r>{}, where per (if any) is the last argument.
Remarks: A valid template argument list for To and per -is formed by interspersing commas between each mapped term.
If a mapping to std​::​intmax_t is not representable, -the program is ill-formed.
expr-map maps the contents of one symbolic expression to another resulting in a different type list.
template<template<typename> typename Proj, template<typename...> typename To, typename OneType, - template<typename, typename> typename Pred = type-less, typename T> -consteval auto expr-map(T); // exposition only -
Let -
  • expr-type-map<U> be -power<Proj<F>, Ints...> if U is of the form power<F, Ints...>, and -Proj<U> otherwise,
  • map-power(u) be -pow<Ints...>(F{}) if decltype(u) is of the form power<F, Ints...>, and -u otherwise, and
  • Nums and Dens -be packs denoting the template arguments of -T​::​nums and T​::​dens, respectively.
Returns: (OneType{} * ... * map-power(expr-type-map<Nums>{})) / -(OneType{} * ... * map-power(expr-type-map<Dens>{})) -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.utils.non.types.html b/HEAD/api_reference/gen/qty.utils.non.types.html deleted file mode 100644 index 1ef23161..00000000 --- a/HEAD/api_reference/gen/qty.utils.non.types.html +++ /dev/null @@ -1,11 +0,0 @@ -[qty.utils.non.types]

5 Quantities and units library [quantities]

5.3 Utilities [qty.utils]

5.3.1 Non-types [qty.utils.non.types]

template<typename T, template<see below> typename U> -consteval bool is-specialization-of(); // exposition only -template<typename T, template<see below> typename U> -consteval bool is-derived-from-specialization-of(); // exposition only -
Returns:
  • For the first signature, -true of T is a specialization of U, and -false otherwise.
  • For the second signature, -true if T has exactly one public base class -that is a specialization of U -and has no other base class that is a specialization of U, and -false otherwise.
Remarks: An implementation provides enough overloads for all arguments to U.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.val.cmp.html b/HEAD/api_reference/gen/qty.val.cmp.html deleted file mode 100644 index 54b8ee5e..00000000 --- a/HEAD/api_reference/gen/qty.val.cmp.html +++ /dev/null @@ -1,13 +0,0 @@ -[qty.val.cmp]

5 Quantities and units library [quantities]

5.6 Quantity [qty]

5.6.13 Value comparison [qty.val.cmp]

friend constexpr bool is_eq_zero(const quantity& q) requires see below; -friend constexpr bool is_neq_zero(const quantity& q) requires see below; -friend constexpr bool is_lt_zero(const quantity& q) requires see below; -friend constexpr bool is_gt_zero(const quantity& q) requires see below; -friend constexpr bool is_lteq_zero(const quantity& q) requires see below; -friend constexpr bool is_gteq_zero(const quantity& q) requires see below; -
Let is_F_zero be the function name.
Returns:
Remarks: Let C be -std​::​equality_comparable_with if F is eq or neq, and -std​::​three_way_comparable_with otherwise.
The expression in the requires-clause is equivalent to: -requires { - { T::zero() } -> C<quantity>; -} -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.val.traits.html b/HEAD/api_reference/gen/qty.val.traits.html deleted file mode 100644 index 7b11f431..00000000 --- a/HEAD/api_reference/gen/qty.val.traits.html +++ /dev/null @@ -1,12 +0,0 @@ -[qty.val.traits]

5 Quantities and units library [quantities]

5.5 Representation [qty.rep]

5.5.2 Traits [qty.rep.traits]

5.5.2.3 Values [qty.val.traits]

quantity and quantity_point use representation_values -to construct special values of its representation type.
namespace mp_units { - -template<typename Rep> -struct representation_values : std::chrono::duration_values<Rep> { - static constexpr Rep one() noexcept; -}; - -} -
The requirements on std​::​chrono​::​duration_values<Rep> (N4971, [time.traits.duration.values]) -also apply to representation_values<Rep>.
static constexpr Rep one() noexcept; -
Returns: Rep(1).
Remarks: The value returned shall be the neutral element for multiplication (IEC 60050, 102-01-19).
\ No newline at end of file diff --git a/HEAD/api_reference/gen/qty.zeroth.pt.orig.html b/HEAD/api_reference/gen/qty.zeroth.pt.orig.html deleted file mode 100644 index e83b8ae3..00000000 --- a/HEAD/api_reference/gen/qty.zeroth.pt.orig.html +++ /dev/null @@ -1,8 +0,0 @@ -[qty.zeroth.pt.orig]

5 Quantities and units library [quantities]

5.7 Quantity point [qty.pt]

5.7.2 Point origin [qty.pt.orig]

5.7.2.3 Types [qty.pt.orig.types]

5.7.2.3.3 Zeroth [qty.zeroth.pt.orig]

namespace mp_units { - -template<QuantitySpec auto QS> -struct zeroth_point_origin_ final : absolute_point_origin<QS> {}; - -} -
zeroth_point_origin_<QS> represents an origin -chosen by convention as the value 0 of the quantity QS.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/quantities.html b/HEAD/api_reference/gen/quantities.html deleted file mode 100644 index 3bdd50e4..00000000 --- a/HEAD/api_reference/gen/quantities.html +++ /dev/null @@ -1,3469 +0,0 @@ -[quantities]

5 Quantities and units library [quantities]

5.1 Summary [quantities.summary]

This Clause describes components for dealing with quantities and units, -as summarized in Table 3.
Table 3: Quantities and units library summary [tab:quantities.summary]
Subclause
Module
Utilities
mp_units.core
Reference
Representation
Quantity
Quantity point
Systems
mp_units.systems
std​::​chrono interoperability
-
[Editor's note: -Following the SG16 recommendation at https://lists.isocpp.org/sg16/2024/10/4490.php, -the universal-character-names should be replaced by their UTF-8 code points. -]

5.2 mp-units module synopses [mp.units.syns]

5.2.1 Module mp_units synopsis [mp.units.syn]

export module mp_units; - -export import mp_units.core; -export import mp_units.systems; -

5.2.2 Module mp_units.core synopsis [mp.units.core.syn]

// mostly freestanding -export module mp_units.core; - -import std; - -export namespace mp_units { - -// [qty.utils], utilities - -// [qty.sym.txt], symbol text - -enum class character_set : std::int8_t { utf8, portable, default_character_set = utf8 }; - -template<std::size_t N, std::size_t M> -class symbol_text; - -// [qty.sym.expr], symbolic expressions - -// [qty.sym.expr.types], types - -template<typename T, typename... Ts> -struct per; - -template<typename F, int Num, int... Den> - requires see below -struct power; - -// [qty.ref], reference - -// [qty.dim], dimension - -// [qty.dim.concepts], concepts - -template<typename T> -concept Dimension = see below; - -template<typename T, auto D> -concept DimensionOf = see below; - -// [qty.dim.types], types - -template<symbol_text Symbol> -struct base_dimension; - -template<SymbolicConstant... Expr> -struct derived_dimension; - -struct dimension_one; -inline constexpr dimension_one dimension_one{}; - -// [qty.dim.ops], operations - -consteval Dimension auto inverse(Dimension auto d); - -template<std::intmax_t Num, std::intmax_t Den = 1, Dimension D> - requires(Den != 0) -consteval Dimension auto pow(D d); -consteval Dimension auto sqrt(Dimension auto d); -consteval Dimension auto cbrt(Dimension auto d); - -// [qty.dim.sym.fmt], symbol formatting - -struct dimension_symbol_formatting { - character_set char_set = character_set::default_character_set; -}; - -template<typename CharT = char, std::output_iterator<CharT> Out, Dimension D> -constexpr Out dimension_symbol_to(Out out, D d, const dimension_symbol_formatting& fmt = {}); - -template<dimension_symbol_formatting fmt = {}, typename CharT = char, Dimension D> -consteval std::string_view dimension_symbol(D); - -// [qty.spec], quantity specification - -// [qty.spec.concepts], concepts - -template<typename T> -concept QuantitySpec = see below; - -template<typename T, auto QS> -concept QuantitySpecOf = see below; - -// [qty.spec.types], types - -// [named.qty], named - -struct is_kind; -inline constexpr is_kind is_kind{}; - -template<auto...> -struct quantity_spec; // not defined - -template<BaseDimension auto Dim, QSProperty auto... Args> -struct quantity_spec<Dim, Args...>; - -template<DerivedQuantitySpec auto Eq, QSProperty auto... Args> -struct quantity_spec<Eq, Args...>; - -template<NamedQuantitySpec auto QS, QSProperty auto... Args> -struct quantity_spec<QS, Args...>; - -template<NamedQuantitySpec auto QS, DerivedQuantitySpec auto Eq, QSProperty auto... Args> -struct quantity_spec<QS, Eq, Args...>; - -// [derived.qty], derived - -template<SymbolicConstant... Expr> -struct derived_quantity_spec; - -// [dimless.qty], base quantity of dimension one - -struct dimensionless; -inline constexpr dimensionless dimensionless{}; - -// [kind.of.qty], kind of - -template<QuantitySpec Q> - requires see below -struct kind_of_; -template<QuantitySpec auto Q> - requires requires { typename kind_of_<decltype(Q)>; } -inline constexpr kind_of_<decltype(Q)> kind_of{}; - -// [qty.spec.ops], operations - -consteval QuantitySpec auto inverse(QuantitySpec auto q); - -template<std::intmax_t Num, std::intmax_t Den = 1, QuantitySpec Q> - requires(Den != 0) -consteval QuantitySpec auto pow(Q q); -consteval QuantitySpec auto sqrt(QuantitySpec auto q); -consteval QuantitySpec auto cbrt(QuantitySpec auto q); - -// [qty.spec.hier.algos], hierarchy algorithms - -// [qty.spec.conv], conversion - -consteval bool implicitly_convertible(QuantitySpec auto from, QuantitySpec auto to); -consteval bool explicitly_convertible(QuantitySpec auto from, QuantitySpec auto to); -consteval bool castable(QuantitySpec auto from, QuantitySpec auto to); -consteval bool interconvertible(QuantitySpec auto qs1, QuantitySpec auto qs2); - -// [qty.get.kind], get_kind - -template<QuantitySpec Q> -consteval see below get_kind(Q); - -// [get.common.qty.spec], get_common_quantity_spec - -consteval QuantitySpec auto get_common_quantity_spec(QuantitySpec auto... qs) - requires see below; - -// [qty.unit], unit - -// [qty.unit.mag], magnitude - -// [qty.unit.mag.concepts], concepts - -template<typename T> -concept MagConstant = see below; - -template<typename T> -concept UnitMagnitude = see below; - -// [qty.unit.mag.types], types - -template<symbol_text Symbol, long double Value> - requires(Value > 0) -struct mag_constant; - -// [qty.unit.mag.ops], operations - -template<MagArg auto V> -constexpr UnitMagnitude auto mag = see below; - -template<std::intmax_t N, std::intmax_t D> - requires(N > 0) -constexpr UnitMagnitude auto mag_ratio = see below; - -template<MagArg auto Base, int Num, int Den = 1> -constexpr UnitMagnitude auto mag_power = see below; - -// constants - -inline constexpr struct pi final : - mag_constant<{u8"\u03C0" /* U+03c0 GREEK SMALL LETTER PI */, "pi"}, - std::numbers::pi_v<long double>> { -} pi; - -inline constexpr auto \u03C0 /* U+03c0 GREEK SMALL LETTER PI */ = pi; - -// [qty.unit.traits], traits - -template<Unit auto U> -constexpr bool space_before_unit_symbol = true; - -template<> -inline constexpr bool space_before_unit_symbol<one> = false; - -// [qty.unit.concepts], concepts - -template<typename T> -concept Unit = see below; - -template<typename T> -concept PrefixableUnit = see below; - -template<typename T> -concept AssociatedUnit = see below; - -template<typename U, auto QS> -concept UnitOf = see below; - -// [qty.unit.types], types - -// [qty.scaled.unit], scaled - -template<UnitMagnitude auto M, Unit U> - requires see below -struct scaled_unit; - -// [qty.named.unit], named - -template<symbol_text Symbol, auto...> -struct named_unit; // not defined - -template<symbol_text Symbol, QuantityKindSpec auto QS> - requires see below -struct named_unit<Symbol, QS>; - -template<symbol_text Symbol, QuantityKindSpec auto QS, PointOrigin auto PO> - requires see below -struct named_unit<Symbol, QS, PO>; - -template<symbol_text Symbol> - requires see below -struct named_unit<Symbol>; - -template<symbol_text Symbol, Unit auto U> - requires see below -struct named_unit<Symbol, U>; - -template<symbol_text Symbol, Unit auto U, PointOrigin auto PO> - requires see below -struct named_unit<Symbol, U, PO>; - -template<symbol_text Symbol, AssociatedUnit auto U, QuantityKindSpec auto QS> - requires see below -struct named_unit<Symbol, U, QS>; - -template<symbol_text Symbol, AssociatedUnit auto U, QuantityKindSpec auto QS, - PointOrigin auto PO> - requires see below -struct named_unit<Symbol, U, QS, PO>; - -// [qty.prefixed.unit], prefixed - -template<symbol_text Symbol, UnitMagnitude auto M, PrefixableUnit auto U> - requires see below -struct prefixed_unit; - -// [qty.common.unit], common - -template<Unit U1, Unit U2, Unit... Rest> -struct common_unit; - -// [qty.derived.unit], derived - -template<SymbolicConstant... Expr> -struct derived_unit; - -// [qty.unit.one], one - -struct one; -inline constexpr one one{}; - -// named derived units of a quantity of dimension one - -inline constexpr struct percent final : named_unit<"%", mag_ratio<1, 100> * one> { -} percent; - -inline constexpr struct per_mille final : - named_unit<symbol_text{u8"\u2030" /* U+2030 PER MILLE SIGN */, "%o"}, - mag_ratio<1, 1000> * one> { -} per_mille; - -inline constexpr struct parts_per_million final : - named_unit<"ppm", mag_ratio<1, 1'000'000> * one> { -} parts_per_million; - -inline constexpr auto ppm = parts_per_million; - -// [qty.unit.ops], operations - -consteval Unit auto inverse(Unit auto u); - -template<std::intmax_t Num, std::intmax_t Den = 1, Unit U> - requires see below -consteval Unit auto pow(U u); -consteval Unit auto sqrt(Unit auto u); -consteval Unit auto cbrt(Unit auto u); -consteval Unit auto square(Unit auto u); -consteval Unit auto cubic(Unit auto u); - -// [qty.unit.cmp], comparison - -template<Unit From, Unit To> -consteval bool convertible(From from, To to); - -// [qty.unit.obs], observers - -consteval QuantitySpec auto get_quantity_spec(AssociatedUnit auto u); -consteval Unit auto get_unit(AssociatedUnit auto u); - -consteval Unit auto get_common_unit(Unit auto... us) - requires see below; - -// [qty.unit.sym.fmt], symbol formatting - -enum class unit_symbol_solidus : std::int8_t { - one_denominator, - always, - never, - default_denominator = one_denominator -}; - -enum class unit_symbol_separator : std::int8_t { - space, - half_high_dot, - default_separator = space -}; - -struct unit_symbol_formatting { - character_set char_set = character_set::default_character_set; - unit_symbol_solidus solidus = unit_symbol_solidus::default_denominator; - unit_symbol_separator separator = unit_symbol_separator::default_separator; -}; - -template<typename CharT = char, std::output_iterator<CharT> Out, Unit U> -constexpr Out unit_symbol_to(Out out, U u, const unit_symbol_formatting& fmt = {}); - -template<unit_symbol_formatting fmt = {}, typename CharT = char, Unit U> -consteval std::string_view unit_symbol(U); - -// [qty.ref.concepts], concepts - -template<typename T> -concept Reference = see below; - -template<typename T, auto QS> -concept ReferenceOf = see below; - -// [qty.ref.syn], class template reference - -template<QuantitySpec Q, Unit U> -struct reference; - -// [qty.ref.ops], operations - -template<typename FwdRep, Reference R, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> - requires(!OffsetUnit<decltype(get_unit(R{}))>) -constexpr quantity<R{}, Rep> operator*(FwdRep&& lhs, R r); - -template<typename FwdRep, Reference R, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> - requires(!OffsetUnit<decltype(get_unit(R{}))>) -constexpr Quantity auto operator/(FwdRep&& lhs, R); - -template<typename FwdQ, Reference R, Quantity Q = std::remove_cvref_t<FwdQ>> -constexpr Quantity auto operator*(FwdQ&& q, R); - -template<typename FwdQ, Reference R, Quantity Q = std::remove_cvref_t<FwdQ>> -constexpr Quantity auto operator/(FwdQ&& q, R); - -template<Reference R, typename Rep> - requires RepresentationOf<std::remove_cvref_t<Rep>, get_quantity_spec(R{})> -constexpr auto operator*(R, Rep&&) = delete; - -template<Reference R, typename Rep> - requires RepresentationOf<std::remove_cvref_t<Rep>, get_quantity_spec(R{})> -constexpr auto operator/(R, Rep&&) = delete; - -template<Reference R, typename Q> - requires Quantity<std::remove_cvref_t<Q>> -constexpr auto operator*(R, Q&&) = delete; - -template<Reference R, typename Q> - requires Quantity<std::remove_cvref_t<Q>> -constexpr auto operator/(R, Q&&) = delete; - -// [qty.ref.obs], observers - -template<typename Q, typename U> -consteval QuantitySpec auto get_quantity_spec(reference<Q, U>); - -template<typename Q, typename U> -consteval Unit auto get_unit(reference<Q, U>); - -consteval AssociatedUnit auto get_common_reference(AssociatedUnit auto u1, - AssociatedUnit auto u2, - AssociatedUnit auto... rest) - requires see below; - -template<Reference R1, Reference R2, Reference... Rest> -consteval Reference auto get_common_reference(R1 r1, R2 r2, Rest... rest) - requires see below; - -// [qty.rep], representation - -enum class quantity_character { scalar, complex, vector, tensor }; - -// [qty.rep.traits], traits - -// [qty.fp.traits], floating-point - -template<typename Rep> -constexpr bool treat_as_floating_point = see below; - -// [qty.char.traits], quantity character - -template<typename T> -constexpr bool disable_scalar = false; -template<> -inline constexpr bool disable_scalar<bool> = true; -template<typename T> -constexpr bool disable_scalar<std::complex<T>> = true; - -template<typename T> -constexpr bool disable_complex = false; - -template<typename T> -constexpr bool disable_vector = false; - -// [qty.val.traits], values - -template<typename Rep> -struct representation_values; - -// [qty.rep.cpos], customization point objects - -inline namespace unspecified { - -inline constexpr unspecified real = unspecified; -inline constexpr unspecified imag = unspecified; -inline constexpr unspecified modulus = unspecified; - -inline constexpr unspecified magnitude = unspecified; - -} - -// [qty.rep.concepts], concepts - -template<typename T> -concept Representation = see below; - -template<typename T, quantity_character Ch> -concept RepresentationOf = see below; - -// [qty], quantity - -// [qty.like], interoperability - -template<typename T> -struct quantity_like_traits; // not defined - -template<typename T> -concept QuantityLike = see below; - -// [qty.syn], class template quantity - -template<typename T> -concept Quantity = see below; - -template<typename Q, auto QS> -concept QuantityOf = see below; - -template<Reference auto R, RepresentationOf<get_quantity_spec(R)> Rep = double> -class quantity; - -// [qty.delta], construction helper delta - -template<Reference R> -struct delta_; - -template<Reference auto R> -constexpr delta_<decltype(R)> delta{}; - -// [qty.non.mem.conv], non-member conversions - -template<Unit auto ToU, see below> - requires see below -constexpr Quantity auto value_cast(see below q); - -template<Representation ToRep, see below> - requires see below -constexpr quantity<see below, ToRep> value_cast(see below q); - -template<Unit auto ToU, Representation ToRep, see below> - requires see below -constexpr Quantity auto value_cast(see below q); -template<Representation ToRep, Unit auto ToU, see below> - requires see below -constexpr Quantity auto value_cast(see below q); - -template<Quantity ToQ, see below> - requires see below -constexpr Quantity auto value_cast(see below q); - -template<QuantitySpec auto ToQS, see below> - requires see below -constexpr Quantity auto quantity_cast(see below q); - -} - -// [qty.common.type], std​::​common_type specializations - -template<mp_units::Quantity Q1, mp_units::Quantity Q2> - requires see below -struct std::common_type<Q1, Q2>; - -template<mp_units::Quantity Q, mp_units::Representation Value> - requires see below -struct std::common_type<Q, Value>; - -template<mp_units::Quantity Q, mp_units::Representation Value> - requires requires { typename std::common_type<Q, Value>; } -struct std::common_type<Value, Q> : std::common_type<Q, Value> {}; - -namespace mp_units { - -// [qty.pt], quantity point - -// [qty.pt.orig], point origin - -// [qty.pt.orig.concepts], concepts - -template<typename T> -concept PointOrigin = see below; - -template<typename T, auto QS> -concept PointOriginFor = see below; - -// [qty.pt.orig.types], types - -// [qty.abs.pt.orig], absolute - -template<QuantitySpec auto QS> -struct absolute_point_origin; - -// [qty.rel.pt.orig], relative - -template<QuantityPoint auto QP> -struct relative_point_origin; - -// [qty.zeroth.pt.orig], zeroth - -template<QuantitySpec auto QS> -struct zeroth_point_origin_; - -template<QuantitySpec auto QS> -constexpr zeroth_point_origin_<QS> zeroth_point_origin{}; - -// [qty.def.pt.orig], default - -template<Reference R> -consteval PointOriginFor<get_quantity_spec(R{})> auto default_point_origin(R); - -// [qty.pt.like], interoperability - -template<typename T> -struct quantity_point_like_traits; // not defined - -template<typename T> -concept QuantityPointLike = see below; - -// [qty.pt.syn], class template quantity_point - -template<typename T> -concept QuantityPoint = see below; - -template<typename QP, auto V> -concept QuantityPointOf = see below; - -template<Reference auto R, - PointOriginFor<get_quantity_spec(R)> auto PO = default_point_origin(R), - RepresentationOf<get_quantity_spec(R)> Rep = double> -class quantity_point; - -// [qty.point], construction helper point - -template<Reference R> -struct point_; - -template<Reference auto R> -constexpr point_<decltype(R)> point{}; - -// [qty.pt.non.mem.conv], non-member conversions - -template<Unit auto ToU, see below> - requires see below -constexpr QuantityPoint auto value_cast(see below qp); - -template<Representation ToRep, see below> - requires see below -constexpr quantity_point<see below, see below, ToRep> value_cast(see below qp); - -template<Unit auto ToU, Representation ToRep, see below> - requires see below -constexpr QuantityPoint auto value_cast(see below qp); -template<Representation ToRep, Unit auto ToU, see below> - requires see below -constexpr QuantityPoint auto value_cast(see below qp); - -template<Quantity ToQ, see below> - requires see below -constexpr QuantityPoint auto value_cast(see below qp); - -template<QuantityPoint ToQP, see below> - requires see below -constexpr QuantityPoint auto value_cast(see below qp); - -template<QuantitySpec auto ToQS, see below> - requires see below -constexpr QuantityPoint auto quantity_cast(see below qp); - -} -

5.2.3 Module mp_units.systems synopsis [mp.units.systems.syn]

export module mp_units.systems; - -export import mp_units.core; -import std; - -export namespace mp_units { - -// [qty.chrono], std​::​chrono interoperability - -template<typename Rep, typename Period> -struct quantity_like_traits<std::chrono::duration<Rep, Period>>; - -template<typename Clock> -struct chrono_point_origin_; -template<typename Clock> -constexpr chrono_point_origin_<Clock> chrono_point_origin{}; - -template<typename Clock, typename Rep, typename Period> -struct quantity_point_like_traits< - std::chrono::time_point<Clock, std::chrono::duration<Rep, Period>>>; - -} -

5.3 Utilities [qty.utils]

5.3.1 Non-types [qty.utils.non.types]

template<typename T, template<see below> typename U> -consteval bool is-specialization-of(); // exposition only -template<typename T, template<see below> typename U> -consteval bool is-derived-from-specialization-of(); // exposition only -
Returns:
  • For the first signature, -true of T is a specialization of U, and -false otherwise.
  • For the second signature, -true if T has exactly one public base class -that is a specialization of U -and has no other base class that is a specialization of U, and -false otherwise.
Remarks: An implementation provides enough overloads for all arguments to U.

5.3.2 Ratio [qty.ratio]

namespace mp_units { - -struct ratio { // exposition only - std::intmax_t num; - std::intmax_t den; - - consteval ratio(std::intmax_t n, std::intmax_t d = 1); - - friend consteval bool operator==(ratio, ratio) = default; - friend consteval auto operator<=>(ratio lhs, ratio rhs) { return (lhs - rhs).num <=> 0; } - - friend consteval ratio operator-(ratio r) { return {-r.num, r.den}; } - - friend consteval ratio operator+(ratio lhs, ratio rhs) - { - return {lhs.num * rhs.den + lhs.den * rhs.num, lhs.den * rhs.den}; - } - - friend consteval ratio operator-(ratio lhs, ratio rhs) { return lhs + (-rhs); } - - friend consteval ratio operator*(ratio lhs, ratio rhs); - - friend consteval ratio operator/(ratio lhs, ratio rhs) - { - return lhs * ratio{rhs.den, rhs.num}; - } -}; - -consteval bool is-integral(ratio r) { return r.num % r.den == 0; } - -consteval ratio common-ratio(ratio r1, ratio r2); - -} -
ratio represents the rational number .
Unless otherwise specified, -in the following descriptions, -let R(r) be std​::​ratio<N, D>, -where N and D are the values of r.num and r.den.
consteval ratio(std::intmax_t n, std::intmax_t d = 1); -
Let N and D be the values of n and d.
Let R be std​::​ratio<N, D>.
Effects: Equivalent to -R.
Postconditions: num == R​::​num && den == R​::​den is true.
friend consteval ratio operator*(ratio lhs, ratio rhs); -
Let Res be std​::​ratio_multiply<R(lhs), R(rhs)>.
Effects: Equivalent to: -return {Res​::​num, Res​::​den};
consteval ratio common-ratio(ratio r1, ratio r2); -
Let Res be equal to -std::common_type<std::chrono::duration<int, R(r1)>, - std::chrono::duration<int, R(r2)>>::type::period -
Effects: Equivalent to: -return {Res​::​num, Res​::​den};

5.3.3 Symbol text [qty.sym.txt]

namespace mp_units { - -template<std::size_t N, std::size_t M> -class symbol_text { -public: - std::fixed_u8string<N> utf8; // exposition only - std::fixed_string<M> portable; // exposition only - - // constructors - constexpr symbol_text(char portable); - consteval symbol_text(const char (&portable)[N + 1]); - constexpr symbol_text(const std::fixed_string<N>& portable); - consteval symbol_text(const char8_t (&utf8)[N + 1], const char (&portable)[M + 1]); - constexpr symbol_text(const std::fixed_u8string<N>& utf8, - const std::fixed_string<M>& portable); - - // observers - constexpr const auto& utf8() const { return utf8; } - constexpr const auto& portable() const { return portable; } - constexpr bool empty() const { return utf8().empty(); } - - // string operations - template<std::size_t N2, std::size_t M2> - friend constexpr symbol_text<N + N2, M + M2> operator+(const symbol_text& lhs, - const symbol_text<N2, M2>& rhs); - - // comparison - template<std::size_t N2, std::size_t M2> - friend constexpr bool operator==(const symbol_text& lhs, - const symbol_text<N2, M2>& rhs) noexcept; - template<std::size_t N2, std::size_t M2> - friend constexpr auto operator<=>(const symbol_text& lhs, - const symbol_text<N2, M2>& rhs) noexcept; -}; - -symbol_text(char) -> symbol_text<1, 1>; - -template<std::size_t N> -symbol_text(const char (&)[N]) -> symbol_text<N - 1, N - 1>; - -template<std::size_t N> -symbol_text(const std::fixed_string<N>&) -> symbol_text<N, N>; - -template<std::size_t N, std::size_t M> -symbol_text(const char8_t (&)[N], const char (&)[M]) -> symbol_text<N - 1, M - 1>; - -template<std::size_t N, std::size_t M> -symbol_text(const std::fixed_u8string<N>&, const std::fixed_string<M>&) -> symbol_text<N, M>; - -} -
symbol_text represents a symbol text.
utf8 stores its UTF-8 representation, and -portable stores its portable representation.
symbol_text<N, M> is a structural type (N4971, [temp.param]).
In the descriptions that follow, -it is a Precondition that -
  • values of char are in the basic literal character set (N4971, [lex.charset]), and
  • for a parameter of the form const CharT (&txt)[M], -(txt[M - 1] == CharT()) is true.
constexpr symbol_text(char portable); -consteval symbol_text(const char (&portable)[N + 1]); -constexpr symbol_text(const std::fixed_string<N>& portable); -consteval symbol_text(const char8_t (&utf8)[N + 1], const char (&portable)[M + 1]); -constexpr symbol_text(const std::fixed_u8string<N>& utf8, const std::fixed_string<M>& portable); -
For the constructors without a parameter named utf8, -let utf8 be: -std::bit_cast<std::fixed_u8string<N>>(std::basic_fixed_string(portable)) -
Effects: Equivalent to the mem-initializer-list: -utf8{utf8}, portable{portable} -
template<std::size_t N2, std::size_t M2> -friend constexpr symbol_text<N + N2, M + M2> operator+(const symbol_text& lhs, - const symbol_text<N2, M2>& rhs); -
Effects: Equivalent to: -return symbol_text<N + N2, M + M2>(lhs.utf8() + rhs.utf8(), - lhs.portable() + rhs.portable()); -
template<std::size_t N2, std::size_t M2> -friend constexpr bool operator==(const symbol_text& lhs, - const symbol_text<N2, M2>& rhs) noexcept; -template<std::size_t N2, std::size_t M2> -friend constexpr auto operator<=>(const symbol_text& lhs, - const symbol_text<N2, M2>& rhs) noexcept; -
Let @ be the operator.
Effects: Equivalent to: -return std::make_tuple(std::cref(lhs.utf8()), std::cref(lhs.portable())) @ - std::make_tuple(std::cref(rhs.utf8()), std::cref(rhs.portable())); -

5.3.4 Symbolic expressions [qty.sym.expr]

5.3.4.1 General [qty.sym.expr.general]

Subclause [qty.sym.expr] specifies the components -used to maintain ordered, simplified, and readable -argument lists in the names of specializations.
[Example 1: using namespace si::unit_symbols; -int x = kg * km / square(h); // error: cannot construct from - // derived_unit<si​::​kilo_<si​::​gram>, si​::​kilo_<si​::​metre>, per<power<non_si​::​hour, 2>>> -
-The library ensures decltype(kg * km / square(h)) is styled-like as commented in diagnostics, -provided that, in the implementation-defined total order of types, -decltype(kg) is less than decltype(km).
— end example]

5.3.4.2 Concept SymbolicConstant [qty.sym.expr.concepts]

template<typename T> -concept SymbolicConstant = // exposition only - std::is_empty_v<T> && std::is_final_v<T> && std::is_trivially_default_constructible_v<T> && - std::is_trivially_copy_constructible_v<T> && std::is_trivially_move_constructible_v<T> && - std::is_trivially_destructible_v<T>; -
The concept SymbolicConstant -is used to constrain the types -that are used in symbolic expressions.

5.3.4.3 Types [qty.sym.expr.types]

namespace mp_units { - -template<typename T, typename... Ts> -struct per final {}; - -} -
per is used to store arguments with negative exponents.
A specialization of per -represents the product of the inverse of its template arguments.
A program that instantiates a specialization of per -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
namespace mp_units { - -template<typename F, int Num, int... Den> - requires see below -struct power final { - using factor = F; // exposition only - static constexpr ratio exponent{Num, Den...}; // exposition only -}; - -} -
power represents a power (IEC 60050, 102-02-08) -of the form .
[Note 1: 
Den is optional to shorten the type name when Den is 1.
— end note]
-A program that instantiates a specialization of power -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
Let r be ratio{Num, Den...}.
Let is-valid-ratio be -true if r is a valid constant expression, and -false otherwise.
The expression in the requires-clause is equivalent to: -is-valid-ratio && (r > ratio{0}) && (r != ratio{1}) -

5.3.4.4 Algorithms [qty.sym.expr.algos]

template<typename T> -using expr-type = see below; // exposition only -
expr-type<T> denotes -U if T is of the form power<U, Ints...>, and -T otherwise.
template<typename T, typename U> -consteval bool type-less-impl(); // exposition only -
Returns: true if T is less than U -in an implementation-defined total order for types, and -false otherwise.
template<typename Lhs, typename Rhs> -struct type-less : // exposition only - std::bool_constant<is-specialization-of<Rhs, power>() || - type-less-impl<expr-type<Lhs>, expr-type<Rhs>>()> {}; -
type-less meets the requirements of -the Pred parameter of the symbolic expression algorithms below.
template<typename... Ts> -struct type-list {}; // exposition only - -template<typename OneType, typename... Ts> -struct expr-fractions { // exposition only - using num = see below; // exposition only - using den = see below; // exposition only -} -
expr-fractions divides a symbolic expression to numerator and denominator parts.
Let EF be a specialization of expr-fractions.
  • If EF is of the form expr-fractions<OneType, Ts..., per<Us...>>, -then -
    • EF​::​num denotes type-list<Ts...>, and
    • EF​::​den denotes type-list<Us...>.
  • Otherwise, EF is of the form expr-fractions<OneType, Ts...>, and -
    • EF​::​num denotes type-list<Ts...>, and
    • EF​::​den denotes type-list<>.
The symbolic expression algorithms perform operations on symbolic constants.
A symbolic constant is a type that is a model of SymbolicConstant.
[Example 1: 
The dimension dim_length, the quantity time, and the unit one are symbolic constants.
— end example]
-The algorithms also support -powers with a symbolic constant base and a rational exponent, -products thereof, and -fractions thereof.
template<template<typename...> typename To, typename OneType, - template<typename, typename> typename Pred = type-less, typename Lhs, typename Rhs> -consteval auto expr-multiply(Lhs, Rhs); // exposition only - -template<template<typename...> typename To, typename OneType, - template<typename, typename> typename Pred = type-less, typename Lhs, typename Rhs> -consteval auto expr-divide(Lhs lhs, Rhs rhs); // exposition only - -template<template<typename...> typename To, typename OneType, typename T> -consteval auto expr-invert(T); // exposition only - -template<std::intmax_t Num, std::intmax_t Den, template<typename...> typename To, - typename OneType, template<typename, typename> typename Pred = type-less, typename T> - requires(Den != 0) -consteval auto expr-pow(T); // exposition only -
Mandates:
  • OneType is the neutral element (IEC 60050, 102-01-19) of the operation, and
  • Pred is a Cpp17BinaryTypeTrait (N4971, [meta.rqmts]) -with a base characteristic of std​::​bool_constant<B>.
    Pred<T, U> implements a total order for types; -B is true if T is ordered before U, and false otherwise.
Effects:
First, inputs to the operations are obtained from the types of the function parameters.
If the type of a function parameter is: -
  • A specialization of To, -then its input is the product of its template arguments, and -the following also apply.
  • A specialization of per, -then its input is the product of the inverse of its template arguments, and -the following also apply.
  • A specialization of the form power<F, Num>, -then its input is , or -a specialization of the form power<F, Num, Den>, -then its input is , and -the following also applies.
  • Otherwise, the input is the symbolic constant itself.
[Example 2: 
Item by item, this algorithm step goes from the C++ parameter type -decltype(km / square(h)), -styled in diagnostics like -derived_unit<si​::​kilo_<si​::​metre>, per<power<non_si​::​hour, 2>>, -
  • to decltype(km) ×per<power<decltype(h), 2> (product of To's arguments),
  • to (product of inverse of per's arguments),
  • to (powers as powers),
  • to where and (symbolic substitution) -in the mathematical domain.
— end example]
Then, the operation takes place: -
  • expr-multiply multiplies its inputs,
  • expr-divide divides the input of its first parameter by the input of its second parameter,
  • expr-invert divides 1 by its input, and
  • expr-pow raises its input to the .
Finally, let r be the result of the operation simplified as follows: -
  • All terms are part of the same fraction (if any).
  • There is at most a single term with a given symbolic constant.
  • There are no negative exponents.
  • 1 is only present as r and as a numerator with a denominator not equal to 1.
[Example 3: 
Item by item:

(single fraction)
(unique symbolic constants)
(positive exponents)
(non-redundant 1s)
— end example]
Returns: r is mapped to the return type: -
  • If , returns OneType{}.
  • Otherwise, if r is a symbolic constant, returns r.
  • Otherwise, first applies the following mappings to the terms of r: -
    • is mapped to power<x, n, d>, and - is mapped to power<x, n>, and
    • 1 is mapped to OneType{}.
  • Then, a denominator x of r (if any) is mapped to per<x>.
  • Then, sorts r without per (if any) and -the template arguments of per (if any) -according to Pred.
  • Finally, returns To<r>{}, where per (if any) is the last argument.
Remarks: A valid template argument list for To and per -is formed by interspersing commas between each mapped term.
If a mapping to std​::​intmax_t is not representable, -the program is ill-formed.
expr-map maps the contents of one symbolic expression to another resulting in a different type list.
template<template<typename> typename Proj, template<typename...> typename To, typename OneType, - template<typename, typename> typename Pred = type-less, typename T> -consteval auto expr-map(T); // exposition only -
Let -
  • expr-type-map<U> be -power<Proj<F>, Ints...> if U is of the form power<F, Ints...>, and -Proj<U> otherwise,
  • map-power(u) be -pow<Ints...>(F{}) if decltype(u) is of the form power<F, Ints...>, and -u otherwise, and
  • Nums and Dens -be packs denoting the template arguments of -T​::​nums and T​::​dens, respectively.
Returns: (OneType{} * ... * map-power(expr-type-map<Nums>{})) / -(OneType{} * ... * map-power(expr-type-map<Dens>{})) -

5.4 Reference [qty.ref]

5.4.1 General [qty.ref.general]

Subclause [qty.ref] specifies the components -for describing the reference of a quantity (IEC 60050, 112-01-01).

5.4.2 Dimension [qty.dim]

5.4.2.1 General [qty.dim.general]

Subclause [qty.dim] specifies the components -for defining the dimension of a quantity (IEC 60050, 112-01-11).

5.4.2.2 Concepts [qty.dim.concepts]

template<typename T> -concept Dimension = SymbolicConstant<T> && std::derived_from<T, dimension-interface>; - -template<typename T> -concept BaseDimension = // exposition only - Dimension<T> && (is-derived-from-specialization-of<T, base_dimension>()); - -template<typename T, auto D> -concept DimensionOf = Dimension<T> && Dimension<decltype(D)> && (T{} == D); -

5.4.2.3 Types [qty.dim.types]

namespace mp_units { - -template<symbol_text Symbol> -struct base_dimension : dimension-interface { - static constexpr auto symbol = Symbol; // exposition only -}; - -} -
base_dimension is used -to define the dimension of a base quantity (IEC 60050, 112-01-08).
Symbol is its symbolic representation.
[Example 1: inline constexpr struct dim_length final : base_dimension<"L"> {} dim_length; - — end example]
namespace mp_units { - -template<typename... Expr> -struct derived-dimension-impl // exposition only - : expr-fractions<struct dimension_one, Expr...> {}; - -template<SymbolicConstant... Expr> -struct derived_dimension final : dimension-interface, derived-dimension-impl<Expr...> {}; - -} -
derived_dimension is used by the library -to represent the dimension of a derived quantity (IEC 60050, 112-01-10).
[Example 2: constexpr auto dim_acceleration = isq::speed.dimension / isq::dim_time; -int x = dim_acceleration; // error: cannot construct from - // derived_dimension<isq​::​dim_length, per<power<isq​::​dim_time, 2>>> - — end example]
-A program that instantiates a specialization of derived_dimension -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
namespace mp_units { - -struct dimension_one final : dimension-interface, derived-dimension-impl<> {}; - -} -
dimension_one represents the dimension of a quantity of dimension one (IEC 60050, 112-01-13).

5.4.2.4 Operations [qty.dim.ops]

namespace mp_units { - -struct dimension-interface { // exposition only - template<Dimension Lhs, Dimension Rhs> - friend consteval Dimension auto operator*(Lhs, Rhs); - - template<Dimension Lhs, Dimension Rhs> - friend consteval Dimension auto operator/(Lhs, Rhs); - - template<Dimension Lhs, Dimension Rhs> - friend consteval bool operator==(Lhs, Rhs); -}; - -} -
template<Dimension Lhs, Dimension Rhs> -friend consteval Dimension auto operator*(Lhs, Rhs); -
Returns: expr-multiply<derived_dimension, struct dimension_one>(Lhs{}, Rhs{}).
template<Dimension Lhs, Dimension Rhs> -friend consteval Dimension auto operator/(Lhs, Rhs); -
Returns: expr-divide<derived_dimension, struct dimension_one>(Lhs{}, Rhs{}).
template<Dimension Lhs, Dimension Rhs> -friend consteval bool operator==(Lhs, Rhs); -
Returns: std​::​is_same_v<Lhs, Rhs>.
consteval Dimension auto inverse(Dimension auto d); -
Returns: dimension_one / d.
template<std::intmax_t Num, std::intmax_t Den = 1, Dimension D> - requires(Den != 0) -consteval Dimension auto pow(D d); -
Returns: expr-pow<Num, Den, derived_dimension, struct dimension_one>(d).
consteval Dimension auto sqrt(Dimension auto d); -
Returns: pow<1, 2>(d).
consteval Dimension auto cbrt(Dimension auto d); -
Returns: pow<1, 3>(d).

5.4.2.5 Symbol formatting [qty.dim.sym.fmt]

template<typename CharT = char, std::output_iterator<CharT> Out, Dimension D> -constexpr Out dimension_symbol_to(Out out, D d, const dimension_symbol_formatting& fmt = {}); -
Effects: TBD.
Returns: TBD.
template<dimension_symbol_formatting fmt = {}, typename CharT = char, Dimension D> -consteval std::string_view dimension_symbol(D); -
Effects: Equivalent to: -TBD. -

5.4.3 Quantity specification [qty.spec]

5.4.3.1 General [qty.spec.general]

Subclause [qty.spec] specifies the components -for defining a quantity (IEC 60050, 112-01-01).

5.4.3.2 Concepts [qty.spec.concepts]

template<typename T> -concept QuantitySpec = SymbolicConstant<T> && std::derived_from<T, quantity-spec-interface>; - -template<typename T> -concept QuantityKindSpec = // exposition only - QuantitySpec<T> && is-specialization-of<T, kind_of_>(); - -template<typename T> -concept NamedQuantitySpec = // exposition only - QuantitySpec<T> && is-derived-from-specialization-of<T, quantity_spec>() && - (!QuantityKindSpec<T>); - -template<typename T> -concept DerivedQuantitySpec = // exposition only - QuantitySpec<T> && - (is-specialization-of<T, derived_quantity_spec>() || - (QuantityKindSpec<T> && - is-specialization-of<decltype(auto(T::quantity-spec)), derived_quantity_spec>())); - -template<auto Child, auto Parent> -concept ChildQuantitySpecOf = (is-child-of(Child, Parent)); // exposition only - -template<auto To, auto From> -concept NestedQuantityKindSpecOf = // exposition only - QuantitySpec<decltype(From)> && QuantitySpec<decltype(To)> && - (get_kind(From) != get_kind(To)) && ChildQuantitySpecOf<To, get_kind(From).quantity-spec>; - -template<auto From, auto To> -concept QuantitySpecConvertibleTo = // exposition only - QuantitySpec<decltype(From)> && QuantitySpec<decltype(To)> && implicitly_convertible(From, To); - -template<auto From, auto To> -concept QuantitySpecExplicitlyConvertibleTo = // exposition only - QuantitySpec<decltype(From)> && QuantitySpec<decltype(To)> && explicitly_convertible(From, To); - -template<auto From, auto To> -concept QuantitySpecCastableTo = // exposition only - QuantitySpec<decltype(From)> && QuantitySpec<decltype(To)> && castable(From, To); - -template<typename T, auto QS> -concept QuantitySpecOf = - QuantitySpec<T> && QuantitySpec<decltype(QS)> && QuantitySpecConvertibleTo<T{}, QS> && - !NestedQuantityKindSpecOf<T{}, QS> && - (QuantityKindSpec<T> || !NestedQuantityKindSpecOf<QS, T{}>); - -template<typename T> -concept QSProperty = (!QuantitySpec<T>); // exposition only -

5.4.3.3 Types [qty.spec.types]

5.4.3.3.1 Named [named.qty]

namespace mp_units { - -struct is_kind {}; - -template<BaseDimension auto Dim, QSProperty auto... Args> -struct quantity_spec<Dim, Args...> : quantity-spec-interface { - using base-type = quantity_spec; - static constexpr BaseDimension auto dimension = Dim; - static constexpr quantity_character character = see below; -}; - -template<DerivedQuantitySpec auto Eq, QSProperty auto... Args> -struct quantity_spec<Eq, Args...> : quantity-spec-interface { - using base-type = quantity_spec; - static constexpr auto equation = Eq; - static constexpr Dimension auto dimension = Eq.dimension; - static constexpr quantity_character character = see below; -}; - -template<NamedQuantitySpec auto QS, QSProperty auto... Args> -struct quantity_spec<QS, Args...> : quantity-spec-interface { - using base-type = quantity_spec; - static constexpr auto parent = QS; - static constexpr auto equation = parent.equation; // exposition only, present only - // if the qualified-id parent.equation is valid and denotes an object - static constexpr Dimension auto dimension = parent.dimension; - static constexpr quantity_character character = see below; -}; - -template<NamedQuantitySpec auto QS, DerivedQuantitySpec auto Eq, QSProperty auto... Args> - requires QuantitySpecExplicitlyConvertibleTo<Eq, QS> -struct quantity_spec<QS, Eq, Args...> : quantity-spec-interface { - using base-type = quantity_spec; - static constexpr auto parent = QS; - static constexpr auto equation = Eq; - static constexpr Dimension auto dimension = parent.dimension; - static constexpr quantity_character character = see below; -}; - -} -
A named quantity is a type that models NamedQuantitySpec.
A specialization of quantity_spec is used as a base type when defining a named quantity.
In the following descriptions, let Q be a named quantity defined with an alluded signature.
The identifier of Q represents its quantity name (IEC 60050, 112-01-02).
Let Ch be an enumerator value of quantity_character.
The possible arguments to quantity_spec are -
  • ,
  • ,
  • , and
  • .
If the first argument is a base quantity dimension, -then Q is that base quantity (IEC 60050, 112-01-08).
If an argument is a quantity calculus (IEC 60050, 112-01-30) C, -then Q is implicitly convertible from C.
If the first argument is a named quantity, -then Q is of its kind (IEC 60050, 112-01-04).
The member character represents -the set of the numerical value of Q ([qty.char.traits]) -and is equal to -
  • Ch if specified,
  • otherwise, quantity_character​::​real_scalar for the first signature, and
  • otherwise, (BC).character, -where BC is the argument preceding Ch in the signatures above.
is_kind specifies Q to start a new hierarchy tree of a kind.
Optional arguments may appear in any order.
[Example 1: // The first signature defines a base quantity. -inline constexpr struct length final : quantity_spec<dim_length> { -} length; // Length is a base quantity. - -// The second signature defines a derived quantity. -inline constexpr struct area final : quantity_spec<pow<2>(length)> { -} area; // An area equals length by length. - -// The third and fourth signatures add a leaf to a hierarchy of kinds. -inline constexpr struct width final : quantity_spec<length> { -} width; // Width is a kind of length. - -// The fourth signature also refines the calculus required for implicit conversions. -inline constexpr struct angular_measure final : - quantity_spec<dimensionless, arc_length / radius, is_kind> { -} angular_measure; // Requires an arc length per radius, not just any quantity of dimension one. - — end example]

5.4.3.3.2 Derived [derived.qty]

namespace mp_units { - -template<NamedQuantitySpec Q> -using to-dimension = decltype(auto(Q::dimension)); // exposition only - -template<typename... Expr> -struct derived-quantity-spec-impl : // exposition only - quantity-spec-interface, - expr-fractions<struct dimensionless, Expr...> { - using base-type = derived-quantity-spec-impl; - using base = expr-fractions<struct dimensionless, Expr...>; - - static constexpr Dimension auto dimension = - expr-map<to-dimension, derived_dimension, struct dimension_one>(base{}); - static constexpr quantity_character character = see below; -}; - -template<SymbolicConstant... Expr> -struct derived_quantity_spec final : derived-quantity-spec-impl<Expr...> {}; - -} -
derived_quantity_spec is used by the library -to represent the result of a quantity calculus not equal to a named quantity.
[Example 1: constexpr auto area = pow<2>(isq::length); -int x = area; // error: cannot construct from derived_quantity_spec<power<isq​::​length, 2>> - — end example]
-A program that instantiates a specialization of derived_quantity_spec -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
Let -
  • Nums and Dens -be packs denoting the template arguments of -base​::​nums and base​::​dens, respectively,
  • QUANTITY-CHARACTER-OF(Pack) be -std::max({quantity_character::real_scalar, expr-type<Pack>::character...}) - -and
  • num_char be QUANTITY-CHARACTER-OF(Nums) and -den_char be QUANTITY-CHARACTER-OF(Dens).
-The member character is equal to -quantity_character​::​real_scalar if num_char == den_char is true, and -std​::​max(num_char, den_char) otherwise.

5.4.3.3.3 Base quantity of dimension one [dimless.qty]

namespace mp_units { - -struct dimensionless final : quantity_spec<derived_quantity_spec<>> {}; - -} -
dimensionless represents the base quantity of dimension one (IEC 60050, 112-01-13).

5.4.3.3.4 Kind of [kind.of.qty]

namespace mp_units { - -template<QuantitySpec Q> - requires(!QuantityKindSpec<Q>) && (get-kind-tree-root(Q{}) == Q{}) -struct kind_of_ final : Q::base-type { - using base-type = kind_of_; // exposition only - static constexpr auto quantity-spec = Q{}; // exposition only -}; - -} -
kind_of<Q> represents a kind of quantity (IEC 60050, 112-01-04) Q.

5.4.3.4 Utilities [qty.spec.utils]

template<QuantitySpec auto... From, QuantitySpec Q> -consteval QuantitySpec auto clone-kind-of(Q q); // exposition only -
Effects: Equivalent to: -if constexpr ((... && QuantityKindSpec<decltype(From)>)) - return kind_of<Q{}>; -else - return q; -
template<QuantitySpec Q> -consteval auto remove-kind(Q q); // exposition only -
Effects: Equivalent to: -if constexpr (QuantityKindSpec<Q>) - return Q::quantity-spec; -else - return q; -
template<QuantitySpec QS, Unit U> - requires(!AssociatedUnit<U>) || UnitOf<U, QS{}> -consteval Reference auto make-reference(QS, U u); // exposition only -
Effects: Equivalent to: -if constexpr (requires { requires get_quantity_spec(U{}) == QS{}; }) - return u; -else - return reference<QS, U>{}; -

5.4.3.5 Operations [qty.spec.ops]

namespace mp_units { - -struct quantity-spec-interface { // exposition only - template<QuantitySpec Lhs, QuantitySpec Rhs> - friend consteval QuantitySpec auto operator*(Lhs lhs, Rhs rhs); - - template<QuantitySpec Lhs, QuantitySpec Rhs> - friend consteval QuantitySpec auto operator/(Lhs lhs, Rhs rhs); - - template<typename Self, UnitOf<Self{}> U> - consteval Reference auto operator[](this Self self, U u); - - template<typename Self, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>> - requires QuantitySpecExplicitlyConvertibleTo<Q::quantity_spec, Self{}> - constexpr Quantity auto operator()(this Self self, FwdQ&& q); - - template<QuantitySpec Lhs, QuantitySpec Rhs> - friend consteval bool operator==(Lhs, Rhs); -}; - -} -
template<QuantitySpec Lhs, QuantitySpec Rhs> -friend consteval QuantitySpec auto operator*(Lhs lhs, Rhs rhs); -
Returns: clone-kind-of<Lhs{}, Rhs{}>(expr-multiply<derived_quantity_spec, struct dimensionless>( - remove-kind(lhs), remove-kind(rhs))) -
template<QuantitySpec Lhs, QuantitySpec Rhs> -friend consteval QuantitySpec auto operator/(Lhs lhs, Rhs rhs); -
Returns: clone-kind-of<Lhs{}, Rhs{}>(expr-divide<derived_quantity_spec, struct dimensionless>( - remove-kind(lhs), remove-kind(rhs))) -
template<typename Self, UnitOf<Self{}> U> -consteval Reference auto operator[](this Self self, U u); -
Returns: make-reference(self, u).
template<typename Self, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>> - requires QuantitySpecExplicitlyConvertibleTo<Q::quantity_spec, Self{}> -constexpr Quantity auto operator()(this Self self, FwdQ&& q); -
Returns: quantity{std::forward<FwdQ>(q).numerical-value, make-reference(self, Q::unit)} -
template<QuantitySpec Lhs, QuantitySpec Rhs> -friend consteval bool operator==(Lhs, Rhs); -
Returns: std​::​is_same_v<Lhs, Rhs>.
consteval QuantitySpec auto inverse(QuantitySpec auto q); -
Returns: dimensionless / q.
template<std::intmax_t Num, std::intmax_t Den = 1, QuantitySpec Q> - requires(Den != 0) -consteval QuantitySpec auto pow(Q q); -
Returns: clone-kind-of<Q{}>( - expr-pow<Num, Den, derived_quantity_spec, struct dimensionless>(remove-kind(q))); -
consteval QuantitySpec auto sqrt(QuantitySpec auto q); -
Returns: pow<1, 2>(q).
consteval QuantitySpec auto cbrt(QuantitySpec auto q); -
Returns: pow<1, 3>(q).

5.4.3.6 Hierarchy algorithms [qty.spec.hier.algos]

5.4.3.6.1 Conversion [qty.spec.conv]

consteval bool implicitly_convertible(QuantitySpec auto from, QuantitySpec auto to); -
Returns: TBD.
consteval bool explicitly_convertible(QuantitySpec auto from, QuantitySpec auto to); -
Returns: TBD.
consteval bool castable(QuantitySpec auto from, QuantitySpec auto to); -
Returns: TBD.
consteval bool interconvertible(QuantitySpec auto qs1, QuantitySpec auto qs2); -
Returns: implicitly_convertible(qs1, qs2) && implicitly_convertible(qs2, qs1).

5.4.3.6.2 Get kind [qty.get.kind]

template<QuantitySpec Q> -consteval QuantitySpec auto get-kind-tree-root(Q q); // exposition only -
Returns:
  • If QuantityKindSpec<Q> is true, -returns remove-kind(q).
  • Otherwise, if -is-derived-from-specialization-of<Q, quantity_spec>() -is true, and -the specialization of Q​::​quantity_spec has a template argument equal to is_kind, -returns q.
  • Otherwise, if Q​::​parent is a valid expression, -returns get-kind-tree-root(Q​::​parent).
  • Otherwise, if DerivedQuantitySpec<Q> is true, -returns -expr-map<to-kind, derived_quantity_spec, struct dimensionless>(q) - -where to-kind is defined as follows: -template<QuantitySpec Q> -using to-kind = decltype(get-kind-tree-root(Q{})); // exposition only -
  • Otherwise, returns q.
template<QuantitySpec Q> -consteval QuantityKindSpec auto get_kind(Q); -
Returns: kind_of<get-kind-tree-root(Q{})>.

5.4.3.6.3 Get common quantity specification [get.common.qty.spec]

consteval QuantitySpec auto get_common_quantity_spec(QuantitySpec auto... qs) - requires see below; -
Let -
  • q1 be qs...[0],
  • q2 be qs...[1],
  • Q1 be decltype(q1),
  • Q2 be decltype(q2), and
  • rest be a pack denoting the elements of qs without q1 and q2.
Effects: Equivalent to: -if constexpr (sizeof...(qs) == 1) - return q1; -else if constexpr (sizeof...(qs) == 2) { - using QQ1 = decltype(remove-kind(q1)); - using QQ2 = decltype(remove-kind(q2)); - - if constexpr (std::is_same_v<Q1, Q2>) - return q1; - else if constexpr (NestedQuantityKindSpecOf<Q1{}, Q2{}>) - return QQ1{}; - else if constexpr (NestedQuantityKindSpecOf<Q2{}, Q1{}>) - return QQ2{}; - else if constexpr ((QuantityKindSpec<Q1> && !QuantityKindSpec<Q2>) || - (DerivedQuantitySpec<QQ1> && NamedQuantitySpec<QQ2> && - implicitly_convertible(Q1{}, Q2{}))) - return q2; - else if constexpr ((!QuantityKindSpec<Q1> && QuantityKindSpec<Q2>) || - (NamedQuantitySpec<QQ1> && DerivedQuantitySpec<QQ2> && - implicitly_convertible(Q2{}, Q1{}))) - return q1; - else if constexpr (constexpr auto common_base = get-common-base<Q1{}, Q2{}>()) - return *common_base; - else if constexpr (implicitly_convertible(Q1{}, Q2{})) - return q2; - else if constexpr (implicitly_convertible(Q2{}, Q1{})) - return q1; - else if constexpr (implicitly_convertible(get-kind-tree-root(Q1{}), - get-kind-tree-root(Q2{}))) - return get-kind-tree-root(q2); - else - return get-kind-tree-root(q1); -} else - return get_common_quantity_spec(get_common_quantity_spec(q1, q2), rest...); -
Remarks: The expression in the requires-clause is equivalent to: -(sizeof...(qs) != 0 && - (sizeof...(qs) == 1 || - (sizeof...(qs) == 2 && - (QuantitySpecConvertibleTo<get-kind-tree-root(Q1{}), get-kind-tree-root(Q2{})> || - QuantitySpecConvertibleTo<get-kind-tree-root(Q2{}), get-kind-tree-root(Q1{})>)) || - requires { get_common_quantity_spec(get_common_quantity_spec(q1, q2), rest...); })) -

5.4.3.6.4 Get common base [qty.get.common.base]

In this subclause and [qty.is.child.of], -let the kind of quantity (IEC 60050, 112-01-04) hierarchy of q be the tuple -, -where par is parent.
template<QuantitySpec auto A, QuantitySpec auto B> -consteval auto get-common-base(); // exposition only -
Let -
  • be the number of elements in h(A),
  • be the number of elements in h(B),
  • s be ,
  • A be a tuple of the last s elements of h(A), and
  • B be a tuple of the last s elements of h(B).
Effects: Looks for x, the first pair-wise equal element in A and B.
Returns: std​::​optional(x), if x is found, and std​::​optional<unspecified>() otherwise.

5.4.3.6.5 Is child of [qty.is.child.of]

template<QuantitySpec Child, QuantitySpec Parent> -consteval bool is-child-of(Child ch, Parent p); // exposition only -
Returns: If h(p) has more elements than h(ch), returns false.
Otherwise, let C be a tuple of the last s elements of h(ch), -where s is the number of elements in h(p).
Returns == p.

5.4.4 Unit [qty.unit]

5.4.4.1 General [qty.unit.general]

Subclause [qty.unit] specifies the components -for defining a unit of measurement (IEC 60050, 112-01-14).

5.4.4.2 Magnitude [qty.unit.mag]

5.4.4.2.1 General [qty.unit.mag.general]

Subclause [qty.unit.mag] specifies the components -used to represent the numerical value (IEC 60050, 112-01-29) of a unit -with support for powers (IEC 60050, 102-02-08) of real numbers (IEC 60050, 102-02-05).

5.4.4.2.2 Concepts [qty.unit.mag.concepts]

template<typename T> -concept MagConstant = SymbolicConstant<T> && is-derived-from-specialization-of<T, mag_constant>(); - -template<typename T> -concept UnitMagnitude = (is-specialization-of<T, unit-magnitude>()); - -template<typename T> -concept MagArg = std::integral<T> || MagConstant<T>; // exposition only -

5.4.4.2.3 Types [qty.unit.mag.types]

namespace mp_units { - -template<symbol_text Symbol, long double Value> - requires(Value > 0) -struct mag_constant { - static constexpr auto symbol = Symbol; // exposition only - static constexpr long double value = Value; // exposition only -}; - -} -
A specialization of mag_constant represents a real number (IEC 60050, 102-02-05).
Symbol is its symbol, and -Value is (an approximation of) its value.
namespace mp_units { - -template<auto... Ms> -struct unit-magnitude { // exposition only - // [qty.unit.mag.ops], operations - - template<UnitMagnitude M> - friend consteval UnitMagnitude auto operator*(unit-magnitude lhs, M rhs); - - friend consteval auto operator/(unit-magnitude lhs, UnitMagnitude auto rhs); - - template<UnitMagnitude Rhs> - friend consteval bool operator==(unit-magnitude, Rhs); - - template<int Num, int Den = 1> - friend consteval auto pow(unit-magnitude); // exposition only - - // [qty.unit.mag.utils], utilities - - friend consteval bool is-positive-integral-power(unit-magnitude); // exposition only - - template<auto... Ms2> - friend consteval auto common-magnitude(unit-magnitude, // exposition only - unit-magnitude<Ms2...>); -}; - -} -
A specialization of unit-magnitude -represents the product of its template arguments.
For the purposes of specifying the implementation-defined limits, -let the representation of the terms of unit-magnitude be the structure -struct { - ratio exp; - base-type base; -}; - -representing the number , -where base-type is a model of MagArg.
  • There is a single term for each base-type.
  • exp.num is not expanded into base.
    [Note 1: 
    is not permitted.
    — end note]
  • exp.den can reduce the base.
    [Note 2: 
    is permitted.
    — end note]
  • If the result of an operation on std​::​intmax_t values is undefined, -the behavior is -implementation-defined.

5.4.4.2.4 Operations [qty.unit.mag.ops]

template<UnitMagnitude M> -friend consteval UnitMagnitude auto operator*(unit-magnitude lhs, M rhs); -
Returns:
  • If sizeof...(Ms) == 0 is true, returns rhs.
  • Otherwise, if std​::​is_same_v<M, unit-magnitude<>>, returns lhs.
  • Otherwise, returns an unspecified value equal to lhs ×rhs.
friend consteval auto operator/(unit-magnitude lhs, UnitMagnitude auto rhs); -
Returns: lhs * pow<-1>(rhs).
template<UnitMagnitude Rhs> -friend consteval bool operator==(unit-magnitude, Rhs); -
Returns: std​::​is_same_v<unit-magnitude, Rhs>.
template<int Num, int Den = 1> -friend consteval auto pow(unit-magnitude base); // exposition only -
Returns:
  • If Num == 0 is true, returns unit-magnitude<>{}.
  • Otherwise, returns an unspecified value equal to .
template<MagArg auto V> -constexpr UnitMagnitude auto mag = see below; -
Constraints: V is greater than 0.
Effects: If MagConstant<decltype(V)> is satisfied, -initializes mag with unit-magnitude<V>{}.
Otherwise, initializes mag with -an unspecified value equal to V.
template<std::intmax_t N, std::intmax_t D> - requires(N > 0) -constexpr UnitMagnitude auto mag_ratio = see below; -
Effects: Initializes mag_ratio with -an unspecified value equal to .
template<MagArg auto Base, int Num, int Den = 1> -constexpr UnitMagnitude auto mag_power = pow<Num, Den>(mag<Base>); -
Constraints: Base is greater than 0.

5.4.4.2.5 Utilities [qty.unit.mag.utils]

friend consteval bool is-positive-integral-power(unit-magnitude x); // exposition only -
Returns: false if x has a negative or rational exponent, and -true otherwise.
template<auto... Ms2> -friend consteval auto common-magnitude(unit-magnitude, unit-magnitude<Ms2...>); // exposition only -
Returns: The largest magnitude C -such that each input magnitude is expressible -by only positive powers relative to C.

5.4.4.3 Traits [qty.unit.traits]

template<Unit auto U> -constexpr bool space_before_unit_symbol = true; -
The formatting functions ([qty.unit.sym.fmt]) use space_before_unit_symbol -to determine whether there is a space -between the numerical value and the unit symbol.
Remarks: Pursuant to N4971, [namespace.std] ([spec.ext]), -users may specialize space_before_unit_symbol -for cv-unqualified program-defined types.
Such specializations shall be usable in constant expressions (N4971, [expr.const]) -and have type const bool.

5.4.4.4 Concepts [qty.unit.concepts]

template<typename T> -concept Unit = SymbolicConstant<T> && std::derived_from<T, unit-interface>; - -template<typename T> -concept PrefixableUnit = Unit<T> && is-derived-from-specialization-of<T, named_unit>(); - -template<typename T> -concept AssociatedUnit = Unit<U> && has-associated-quantity(U{}); - -template<typename U, auto QS> -concept UnitOf = AssociatedUnit<U> && QuantitySpec<decltype(QS)> && - QuantitySpecConvertibleTo<get_quantity_spec(U{}), QS> && - (get_kind(QS) == get_kind(get_quantity_spec(U{})) || - !NestedQuantityKindSpecOf<get_quantity_spec(U{}), QS>); - -template<auto From, auto To> -concept UnitConvertibleTo = // exposition only - Unit<decltype(From)> && Unit<decltype(To)> && (convertible(From, To)); - -template<typename U, auto FromU, auto QS> -concept UnitCompatibleWith = // exposition only - Unit<U> && Unit<decltype(FromU)> && QuantitySpec<decltype(QS)> && - (!AssociatedUnit<U> || UnitOf<U, QS>) && UnitConvertibleTo<FromU, U{}>; - -template<typename T> -concept OffsetUnit = Unit<T> && requires { T::point-origin; }; // exposition only - -template<typename From, typename To> -concept PotentiallyConvertibleTo = // exposition only - Unit<From> && Unit<To> && - ((AssociatedUnit<From> && AssociatedUnit<To> && - implicitly_convertible(get_quantity_spec(From{}), get_quantity_spec(To{}))) || - (!AssociatedUnit<From> && !AssociatedUnit<To>)); -

5.4.4.5 Types [qty.unit.types]

5.4.4.5.1 Canonical [qty.canon.unit]

namespace mp_units { - -template<UnitMagnitude M, Unit U> -struct canonical-unit { // exposition only - M mag; - U reference_unit; -}; - -} -
canonical-unit represents a unit expressed in terms of base units (IEC 60050, 112-01-18).
[Note 1: 
Other types representing units are equal only if they have the same type.
canonical-unit is used to implement binary relations other than equality.
— end note]
reference_unit is simplified ([qty.sym.expr.algos]).
consteval auto get-canonical-unit(Unit auto u); // exposition only -
Returns: The instantiation of canonical-unit for u.

5.4.4.5.2 Scaled [qty.scaled.unit]

namespace mp_units { - -template<UnitMagnitude auto M, Unit U> - requires(M != unit-magnitude<>{} && M != mag<1>) -struct scaled_unit final : unit-interface { - using base-type = scaled_unit; // exposition only - static constexpr UnitMagnitude auto mag = M; // exposition only - static constexpr U reference-unit{}; // exposition only - static constexpr auto point-origin = U::point_origin; // exposition only, present only - // if the qualified-id U​::​point_origin is valid and denotes an object -}; - -} -
scaled_unit<M, U> is used by the library -to represent the unit M ×U.

5.4.4.5.3 Named [qty.named.unit]

namespace mp_units { - -template<symbol_text Symbol, QuantityKindSpec auto QS> - requires(!Symbol.empty()) && BaseDimension<decltype(auto(QS.dimension))> -struct named_unit<Symbol, QS> : unit-interface { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto quantity-spec = QS; // exposition only -}; - -template<symbol_text Symbol, QuantityKindSpec auto QS, PointOrigin auto PO> - requires(!Symbol.empty()) && BaseDimension<decltype(auto(QS.dimension))> -struct named_unit<Symbol, QS, PO> : unit-interface { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto quantity-spec = QS; // exposition only - static constexpr auto point-origin = PO; // exposition only -}; - -template<symbol_text Symbol> - requires(!Symbol.empty()) -struct named_unit<Symbol> : unit-interface { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only -}; - -template<symbol_text Symbol, Unit auto U> - requires(!Symbol.empty()) -struct named_unit<Symbol, U> : decltype(U)::base-type { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only -}; - -template<symbol_text Symbol, Unit auto U, PointOrigin auto PO> - requires(!Symbol.empty()) -struct named_unit<Symbol, U, PO> : decltype(U)::base-type { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto point-origin = PO; // exposition only -}; - -template<symbol_text Symbol, AssociatedUnit auto U, QuantityKindSpec auto QS> - requires(!Symbol.empty()) && (QS.dimension == get-associated-quantity(U).dimension) -struct named_unit<Symbol, U, QS> : decltype(U)::base-type { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto quantity-spec = QS; // exposition only -}; - -template<symbol_text Symbol, AssociatedUnit auto U, QuantityKindSpec auto QS, - PointOrigin auto PO> - requires(!Symbol.empty()) && (QS.dimension == get-associated-quantity(U).dimension) -struct named_unit<Symbol, U, QS, PO> : decltype(U)::base-type { - using base-type = named_unit; // exposition only - static constexpr auto symbol = Symbol; // exposition only - static constexpr auto quantity-spec = QS; // exposition only - static constexpr auto point-origin = PO; // exposition only -}; - -} -
A named unit is a type that models PrefixableUnit.
A specialization of named_unit is used as a base type when defining a named unit.
In the following descriptions, let U be a named unit defined with an alluded signature.
The identifier of U represents -its unit name (IEC 60050, 112-01-15) -or special unit name (IEC 60050, 112-01-16).
Symbol is its unit symbol (IEC 60050, 112-01-17).
The possible arguments to named_unit are -
  • ,
  • ,
  • , and
  • .
The first signature defines the unit of a base quantity -without a unit prefix (IEC 60050, 112-01-26).
The second signature defines a unit -that can be reused by several base quantities.
The third and fourth signatures with a unit expression argument E -define U as implicitly convertible from E.
The first and fourth signatures with a kind of quantity (IEC 60050, 112-01-04) Q -also restrict U to Q.
A point origin argument specifies the default point origin of U ([qty.pt.syn]).
[Example 1: // The first signature defines a base unit restricted to a kind of base quantity. -inline constexpr struct second final : named_unit<"s", kind_of<time>> { -} second; - -// The third and fourth signatures give a name to the unit argument. -inline constexpr struct minute final : named_unit<"min", mag<60> * second> { -} minute; // . - -// The fourth signature also further restricts the kind of quantity. -inline constexpr struct hertz final : named_unit<"Hz", inverse(second), kind_of<frequency>> { -} hertz; // Hz can't measure becquerel, activity, - // or any other quantity with dimension - // that isn't a kind of frequency. - — end example]

5.4.4.5.4 Prefixed [qty.prefixed.unit]

namespace mp_units { - -template<symbol_text Symbol, UnitMagnitude auto M, PrefixableUnit auto U> - requires(!Symbol.empty()) -struct prefixed_unit : decltype(M * U)::base-type { - using base-type = prefixed_unit; // exposition only - static constexpr auto symbol = Symbol + U.symbol; // exposition only -}; - -} -
prefixed_unit<Symbol, M, U> represents the unit U with a unit prefix (IEC 60050, 112-01-26).
Symbol is the symbol of the unit prefix.
M is the factor of the unit prefix.
A specialization of prefixed_unit is used as a base type when defining a unit prefix.
[Example 1: template<PrefixableUnit auto U> -struct kilo_ : prefixed_unit<"k", mag_power<10, 3>, U> {}; - -template<PrefixableUnit auto U> -constexpr kilo_<U> kilo; - -inline constexpr auto kilogram = kilo<si::gram>; - — end example]

5.4.4.5.5 Common [qty.common.unit]

namespace mp_units { - -template<Unit U1, Unit U2, Unit... Rest> -struct common_unit final : decltype(get-common-scaled-unit(U1{}, U2{}, Rest{}...))::base-type -{ - using base-type = common_unit; // exposition only - static constexpr auto common-unit = // exposition only - get-common-scaled-unit(U1{}, U2{}, Rest{}...); -}; - -} -
common_unit is used by the library -to encapsulate a conversion factor between units (IEC 60050, 112-01-33) -common to the operands of quantity addition.
[Example 1: 
The result of 1 * km + 1 * mi -has a common unit -encapsulated by common_unit<mi, km>.
— end example]
-A program that instantiates a specialization of common_unit -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.
template<Unit U1, Unit U2, Unit... Rest> -consteval Unit auto get-common-scaled-unit(U1, U2, Rest... rest) // exposition only - requires see below; -
Effects: Equivalent to: -constexpr auto res = [] { - constexpr auto canonical_lhs = get-canonical-unit(U1{}); - constexpr auto canonical_rhs = get-canonical-unit(U2{}); - constexpr auto common_mag = common-magnitude(canonical_lhs.mag, canonical_rhs.mag); - if constexpr (common_mag == mag<1>) - return canonical_lhs.reference_unit; - else - return scaled_unit<common_mag, decltype(auto(canonical_lhs.reference_unit))>{}; -}(); -if constexpr (sizeof...(rest) == 0) - return res; -else - return get-common-scaled-unit(res, rest...); -
Remarks: The expression in the requires-clause is equivalent to: -(convertible(U1{}, U2{}) && (sizeof...(Rest) == 0 || requires { - get-common-scaled-unit(get-common-scaled-unit(u1, u2), rest...); - })) -

5.4.4.5.6 Derived [qty.derived.unit]

namespace mp_units { - -template<typename... Expr> -struct derived-unit-impl : // exposition only - unit-interface, - expr-fractions<struct one, Expr...> { - using base-type = derived-unit-impl; // exposition only -}; - -template<SymbolicConstant... Expr> -struct derived_unit final : derived-unit-impl<Expr...> {}; - -} -
derived_unit is used by the library -to represent a derived unit (IEC 60050, 112-01-19).
[Example 1: using namespace si::unit_symbols; -int x = m * m; // error: cannot construct from derived_unit<power<si​::​metre, 2>> -int y = m * s; // error: cannot construct from derived_unit<si​::​metre, si​::​second> -int z = m / s; // error: cannot construct from derived_unit<si​::​metre, per<si​::​second>> - — end example]
-A program that instantiates a specialization of derived_unit -that is not a possible result of the library specifications -is ill-formed, no diagnostic required.

5.4.4.5.7 One [qty.unit.one]

namespace mp_units { - -struct one final : derived-unit-impl<> {}; - -} -
one represents the base unit (IEC 60050, 112-01-18) of a quantity of dimension one (IEC 60050, 112-01-13).

5.4.4.6 Operations [qty.unit.ops]

namespace mp_units { - -struct unit-interface { // exposition only - template<UnitMagnitude M, Unit U> - friend consteval Unit auto operator*(M, U u); - - friend consteval Unit auto operator*(Unit auto, UnitMagnitude auto) = delete; - - template<UnitMagnitude M, Unit U> - friend consteval Unit auto operator/(M mag, U u); - - template<Unit Lhs, Unit Rhs> - friend consteval Unit auto operator*(Lhs lhs, Rhs rhs); - - template<Unit Lhs, Unit Rhs> - friend consteval Unit auto operator/(Lhs lhs, Rhs rhs); - - // [qty.unit.cmp], comparison - - template<Unit Lhs, Unit Rhs> - friend consteval bool operator==(Lhs, Rhs); - - template<Unit Lhs, Unit Rhs> - friend consteval bool equivalent(Lhs lhs, Rhs rhs); -}; - -} -
template<UnitMagnitude M, Unit U> -friend consteval Unit auto operator*(M, U u); -
Effects: Equivalent to: -if constexpr (std::is_same_v<M, decltype(auto(mag<1>))>) - return u; -else if constexpr (is-specialization-of<U, scaled_unit>()) { - if constexpr (M{} * U::mag == mag<1>) - return U::reference-unit; - else - return scaled_unit<M{} * U::mag, decltype(auto(U::reference-unit))>{}; -} else - return scaled_unit<M{}, U>{}; -
friend consteval Unit auto operator*(Unit auto, UnitMagnitude auto) = delete; -
Recommended practice: Suggest swapping the operands.
template<UnitMagnitude M, Unit U> -friend consteval Unit auto operator/(M mag, U u); -
Returns: mag * inverse(u).
template<Unit Lhs, Unit Rhs> -friend consteval Unit auto operator*(Lhs lhs, Rhs rhs); -
Returns: expr-multiply<derived_unit, struct one>(lhs, rhs).
template<Unit Lhs, Unit Rhs> -friend consteval Unit auto operator/(Lhs lhs, Rhs rhs); -
Returns: expr-divide<derived_unit, struct one>(lhs, rhs).
consteval Unit auto inverse(Unit auto u); -
Returns: one / u.
template<std::intmax_t Num, std::intmax_t Den = 1, Unit U> - requires(Den != 0) -consteval Unit auto pow(U u); -
Returns: expr-pow<Num, Den, derived_unit, struct one>(u).
consteval Unit auto sqrt(Unit auto u); -
Returns: pow<1, 2>(u).
consteval Unit auto cbrt(Unit auto u); -
Returns: pow<1, 3>(u).
consteval Unit auto square(Unit auto u); -
Returns: pow<2>(u).
consteval Unit auto cubic(Unit auto u); -
Returns: pow<3>(u).

5.4.4.7 Comparison [qty.unit.cmp]

template<Unit Lhs, Unit Rhs> -friend consteval bool operator==(Lhs, Rhs); -
Returns: std​::​is_same_v<Lhs, Rhs>.
template<Unit Lhs, Unit Rhs> -friend consteval bool equivalent(Lhs lhs, Rhs rhs); -
Effects: Equivalent to: -const auto lhs_canonical = get-canonical-unit(lhs); -const auto rhs_canonical = get-canonical-unit(rhs); -return lhs_canonical.mag == rhs_canonical.mag && - lhs_canonical.reference_unit == rhs_canonical.reference_unit; -
template<Unit From, Unit To> -consteval bool convertible(From from, To to); -
Effects: Equivalent to: -if constexpr (std::is_same_v<From, To>) - return true; -else if constexpr (PotentiallyConvertibleTo<From, To>) - return std::is_same_v<decltype(get-canonical-unit(from).reference_unit), - decltype(get-canonical-unit(to).reference_unit)>; -else - return false; -

5.4.4.8 Observers [qty.unit.obs]

consteval QuantitySpec auto get_quantity_spec(AssociatedUnit auto u); -
Returns: kind_of<get-associated-quantity(u)>.
consteval Unit auto get_unit(AssociatedUnit auto u); -
Returns: u.
consteval Unit auto get_common_unit(Unit auto... us) - requires see below; -
Let -
  • u1 be us...[0],
  • u2 be us...[1],
  • U1 be decltype(u1),
  • U2 be decltype(u2), and
  • rest be a pack denoting the elements of us without u1 and u2.
Effects: Equivalent to: -if constexpr (sizeof...(us) == 1) - return u1; -else if constexpr (sizeof...(us) == 2) { - if constexpr (is-derived-from-specialization-of<U1, common_unit>()) { - return TBD.; - } else if constexpr (is-derived-from-specialization-of<U2, common_unit>()) - return get_common_unit(u2, u1); - else if constexpr (std::is_same_v<U1, U2>) - return u1; - else if constexpr (equivalent(U1{}, U2{})) { - if constexpr (std::derived_from<U1, typename U2::base-type>) - return u1; - else if constexpr (std::derived_from<U2, typename U1::base-type>) - return u2; - else - return std::conditional_t<type-less-impl<U1, U2>(), U1, U2>{}; - } else { - constexpr auto canonical_lhs = get-canonical-unit(U1{}); - constexpr auto canonical_rhs = get-canonical-unit(U2{}); - - if constexpr (is-positive-integral-power(canonical_lhs.mag / canonical_rhs.mag)) - return u2; - else if constexpr (is-positive-integral-power(canonical_rhs.mag / canonical_lhs.mag)) - return u1; - else { - if constexpr (type-less<U1, U2>{}) - return common_unit<U1, U2>{}; - else - return common_unit<U2, U1>{}; - } - } -} else - return get_common_unit(get_common_unit(u1, u2), rest...); -
Remarks: The expression in the requires-clause is equivalent to: -(sizeof...(us) != 0 && (sizeof...(us) == 1 || // - (sizeof...(us) == 2 && convertible(U1{}, U2{})) || - requires { get_common_unit(get_common_unit(u1, u2), rest...); })) -

5.4.4.9 Associated quantity [assoc.qty]

template<Unit U> -consteval bool has-associated-quantity(U); // exposition only -
Returns:
  • If U​::​quantity-spec is a valid expression, -returns true.
  • Otherwise, if U​::​reference-unit is a valid expression, -returns -has-associated-quantity(U::reference-unit) -
  • Otherwise, if -is-derived-from-specialization-of<U, expr-fractions>() -is true, -let Nums and Dens -be packs denoting the template arguments of -U​::​nums and U​::​dens, respectively.
    Returns -(... && has-associated-quantity(expr-type<Nums>{})) && - (... && has-associated-quantity(expr-type<Dens>{})) -
  • Otherwise, returns false.
template<AssociatedUnit U> -consteval auto get-associated-quantity(U u); // exposition only -
Returns:
  • If U is of the form common_unit<Us...>, -returns -get_common_quantity_spec(get-associated-quantity(Us{})...) -
  • Otherwise, if U​::​quantity-spec is a valid expression, -returns -remove-kind(U::quantity-spec) -
  • Otherwise, if U​::​reference-unit is a valid expression, -returns -get-associated-quantity(U::reference-unit) -
  • Otherwise, if -is-derived-from-specialization-of<U, expr-fractions>() -is true, -returns -expr-map<to-quantity-spec, derived_quantity_spec, struct dimensionless>(u) - -where to-quantity-spec is defined as follows: -template<AssociatedUnit U> -using to-quantity-spec = decltype(get-associated-quantity(U{})); // exposition only -

5.4.4.10 Symbol formatting [qty.unit.sym.fmt]

template<typename CharT = char, std::output_iterator<CharT> Out, Unit U> -constexpr Out unit_symbol_to(Out out, U u, const unit_symbol_formatting& fmt = {}); -
Effects: TBD.
Returns: TBD.
template<unit_symbol_formatting fmt = {}, typename CharT = char, Unit U> -consteval std::string_view unit_symbol(U); -
Effects: Equivalent to: -TBD. -

5.4.5 Concepts [qty.ref.concepts]

template<typename T> -concept Reference = AssociatedUnit<T> || (is-specialization-of<T, reference>()); -
A type T that satisfies Reference -represents the reference of a quantity (IEC 60050, 112-01-01).
template<typename T, auto QS> -concept ReferenceOf = Reference<T> && QuantitySpecOf<decltype(get_quantity_spec(T{})), QS>; -

5.4.6 Class template reference [qty.ref.syn]

namespace mp_units { - -template<QuantitySpec auto Q, Unit auto U> -using reference-t = reference<decltype(Q), decltype(U)>; // exposition only - -template<QuantitySpec Q, Unit U> -struct reference { - // [qty.ref.ops], operations - - template<typename Q2, typename U2> - friend consteval auto operator*(reference, reference<Q2, U2>) - -> reference-t<Q{} * Q2{}, U{} * U2{}>; - - template<AssociatedUnit U2> - friend consteval auto operator*(reference, U2) - -> reference-t<Q{} * get_quantity_spec(U2{}), U{} * U2{}>; - - template<AssociatedUnit U1> - friend consteval auto operator*(U1, reference) - -> reference-t<get_quantity_spec(U1{}) * Q{}, U1{} * U{}>; - - template<typename Q2, typename U2> - friend consteval auto operator/(reference, reference<Q2, U2>) - -> reference-t<Q{} / Q2{}, U{} / U2{}>; - - template<AssociatedUnit U2> - friend consteval auto operator/(reference, U2) - -> reference-t<Q{} / get_quantity_spec(U2{}), U{} / U2{}>; - - template<AssociatedUnit U1> - friend consteval auto operator/(U1, reference) - -> reference-t<get_quantity_spec(U1{}) / Q{}, U1{} / U{}>; - - friend consteval auto inverse(reference) -> reference-t<inverse(Q{}), inverse(U{})>; - - template<std::intmax_t Num, std::intmax_t Den = 1> - requires(Den != 0) - friend consteval auto pow(reference) -> reference-t<pow<Num, Den>(Q{}), pow<Num, Den>(U{})>; - friend consteval auto sqrt(reference) -> reference-t<sqrt(Q{}), sqrt(U{})>; - friend consteval auto cbrt(reference) -> reference-t<cbrt(Q{}), cbrt(U{})>; - - // [qty.ref.cmp], comparison - - template<typename Q2, typename U2> - friend consteval bool operator==(reference, reference<Q2, U2>); - - template<AssociatedUnit U2> - friend consteval bool operator==(reference, U2 u2); - - template<typename Q2, typename U2> - friend consteval bool convertible(reference, reference<Q2, U2>); - - template<AssociatedUnit U2> - friend consteval bool convertible(reference, U2 u2); - - template<AssociatedUnit U1> - friend consteval bool convertible(U1 u1, reference); -}; - -} -
reference<Q, U> represents the reference of a quantity (IEC 60050, 112-01-01).
The unit of measurement U (IEC 60050, 112-01-14) -is used to measure a value of the quantity Q (IEC 60050, 112-01-28).
[Note 1: 
reference is typically implicitly instantiated -when specifying that a unit measures a more specific quantity.
[Example 1: using namespace si::unit_symbols; -auto x = 1 * m; // measures a length -auto y = 1 * isq::width[m]; // measures a width -auto z = 1 * isq::diameter[m]; // measures a diameter - — end example]
— end note]

5.4.7 Operations [qty.ref.ops]

Each member function with a trailing-return-type -of -> reference-t<T...> -returns {}.
template<typename FwdRep, Reference R, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> - requires(!OffsetUnit<decltype(get_unit(R{}))>) -constexpr quantity<R{}, Rep> operator*(FwdRep&& lhs, R r); -
Effects: Equivalent to: -return quantity{std​::​forward<FwdRep>(lhs), r};
template<typename FwdRep, Reference R, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> - requires(!OffsetUnit<decltype(get_unit(R{}))>) -constexpr Quantity auto operator/(FwdRep&& lhs, R); -
Effects: Equivalent to: -return quantity{std​::​forward<FwdRep>(lhs), inverse(R{})};
template<typename FwdQ, Reference R, Quantity Q = std::remove_cvref_t<FwdQ>> -constexpr Quantity auto operator*(FwdQ&& q, R); -template<typename FwdQ, Reference R, Quantity Q = std::remove_cvref_t<FwdQ>> -constexpr Quantity auto operator/(FwdQ&& q, R); -
Let @ be the operator.
Effects: Equivalent to: -return quantity{std::forward<FwdQ>(q).numerical-value, Q::reference @ R{}}; -
template<Reference R, typename Rep> - requires RepresentationOf<std::remove_cvref_t<Rep>, get_quantity_spec(R{})> -constexpr auto operator*(R, Rep&&) = delete; - -template<Reference R, typename Rep> - requires RepresentationOf<std::remove_cvref_t<Rep>, get_quantity_spec(R{})> -constexpr auto operator/(R, Rep&&) = delete; - -template<Reference R, typename Q> - requires Quantity<std::remove_cvref_t<Q>> -constexpr auto operator*(R, Q&&) = delete; - -template<Reference R, typename Q> - requires Quantity<std::remove_cvref_t<Q>> -constexpr auto operator/(R, Q&&) = delete; -
Recommended practice: Suggest swapping the operands.

5.4.8 Comparison [qty.ref.cmp]

template<typename Q2, typename U2> -friend consteval bool operator==(reference, reference<Q2, U2>); -
Returns: Q{} == Q2{} && U{} == U2{}.
template<AssociatedUnit U2> -friend consteval bool operator==(reference, U2 u2); -
Returns: Q{} == get_quantity_spec(u2) && U{} == u2.
template<typename Q2, typename U2> -friend consteval bool convertible(reference, reference<Q2, U2>); -
Returns: implicitly_convertible(Q{}, Q2{}) && convertible(U{}, U2{}).
template<AssociatedUnit U2> -friend consteval bool convertible(reference, U2 u2); -
Returns: implicitly_convertible(Q{}, get_quantity_spec(u2)) && convertible(U{}, u2).
template<AssociatedUnit U1> -friend consteval bool convertible(U1 u1, reference); -
Returns: implicitly_convertible(get_quantity_spec(u1), Q{}) && convertible(u1, U{}).

5.4.9 Observers [qty.ref.obs]

template<typename Q, typename U> -consteval QuantitySpec auto get_quantity_spec(reference<Q, U>); -
Returns: Q{}.
template<typename Q, typename U> -consteval Unit auto get_unit(reference<Q, U>); -
Returns: U{}.
consteval AssociatedUnit auto get_common_reference(AssociatedUnit auto u1, - AssociatedUnit auto u2, - AssociatedUnit auto... rest) - requires see below; -
Returns: get_common_unit(u1, u2, rest...).
Remarks: The expression in the requires-clause is equivalent to: -requires { - get_common_quantity_spec(get_quantity_spec(u1), get_quantity_spec(u2), - get_quantity_spec(rest)...); - { get_common_unit(u1, u2, rest...) } -> AssociatedUnit; -} -
template<Reference R1, Reference R2, Reference... Rest> -consteval Reference auto get_common_reference(R1 r1, R2 r2, Rest... rest) - requires see below; -
Returns: reference-t<get_common_quantity_spec(get_quantity_spec(R1{}), get_quantity_spec(R2{}), - get_quantity_spec(rest)...), - get_common_unit(get_unit(R1{}), get_unit(R2{}), get_unit(rest)...)>{}; -
Remarks: The expression in the requires-clause is equivalent to: -requires { - get_common_quantity_spec(get_quantity_spec(r1), get_quantity_spec(r2), - get_quantity_spec(rest)...); - get_common_unit(get_unit(r1), get_unit(r2), get_unit(rest)...); -} -

5.5 Representation [qty.rep]

5.5.1 General [qty.rep.general]

Subclause [qty.rep] specifies the components -used to constrain the numerical value of a quantity (IEC 60050, 112-01-29).

5.5.2 Traits [qty.rep.traits]

5.5.2.1 Floating-point [qty.fp.traits]

template<typename T> -struct actual-value-type : cond-value-type<T> {}; // see N4971, [readable.traits] - -template<typename T> - requires(!std::is_pointer_v<T> && !std::is_array_v<T>) && - requires { typename std::indirectly_readable_traits<T>::value_type; } -struct actual-value-type<T> : std::indirectly_readable_traits<T> {}; - -template<typename T> -using actual-value-type-t = actual-value-type<T>::value_type; - -template<typename Rep> -constexpr bool treat_as_floating_point = - std::chrono::treat_as_floating_point_v<actual-value-type-t<Rep>>; -
quantity and quantity_point use treat_as_floating_point -to help determine whether implicit conversions are allowed among them.
Remarks: Pursuant to N4971, [namespace.std] ([spec.ext]), -users may specialize treat_as_floating_point -for cv-unqualified program-defined types.
Such specializations shall be usable in constant expressions (N4971, [expr.const]) -and have type const bool.

5.5.2.2 Quantity character [qty.char.traits]

template<typename T> -constexpr bool disable_scalar = false; -template<typename T> -constexpr bool disable_complex = false; -template<typename T> -constexpr bool disable_vector = false; -
Some quantities are defined as having a numerical value (IEC 60050, 112-01-29) of a specific set (IEC 60050, 102-01-02).
The representation concepts use these traits -to help determine the sets T represents.
Remarks: Pursuant to N4971, [namespace.std] ([spec.ext]), -users may specialize these templates -for cv-unqualified program-defined types.
Such specializations shall be usable in constant expressions (N4971, [expr.const]) -and have type const bool.
[Note 1: 
These templates prevent use of representation types with the library -that satisfy but do not in fact model their corresponding concept.
— end note]

5.5.2.3 Values [qty.val.traits]

quantity and quantity_point use representation_values -to construct special values of its representation type.
namespace mp_units { - -template<typename Rep> -struct representation_values : std::chrono::duration_values<Rep> { - static constexpr Rep one() noexcept; -}; - -} -
The requirements on std​::​chrono​::​duration_values<Rep> (N4971, [time.traits.duration.values]) -also apply to representation_values<Rep>.
static constexpr Rep one() noexcept; -
Returns: Rep(1).
Remarks: The value returned shall be the neutral element for multiplication (IEC 60050, 102-01-19).

5.5.3 Customization point objects [qty.rep.cpos]

5.5.3.2 mp_units​::​real [qty.real.cpo]

The name mp_units​::​real denotes a customization point object (N4971, [customization.point.object]).
Given a subexpression E with type T, -let t be an lvalue that denotes the reified object for E.
Then: -
  • If T does not model WeaklyRegular, -mp_units​::​real(E) is ill-formed.
  • If auto(t.real()) is a valid expression whose type models Scalar, -mp_units​::​real(E) is expression-equivalent to auto(t.real()).
  • Otherwise, if T is a class or enumeration type and -auto(real(t)) is a valid expression whose type models Scalar -where the meaning of real is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​real(E) is expression-equivalent to that expression.
  • Otherwise, mp_units​::​real(E) is ill-formed.

5.5.3.3 mp_units​::​imag [qty.imag.cpo]

The name mp_units​::​imag denotes a customization point object (N4971, [customization.point.object]).
Given a subexpression E with type T, -let t be an lvalue that denotes the reified object for E.
Then: -
  • If T does not model WeaklyRegular, -mp_units​::​imag(E) is ill-formed.
  • If auto(t.imag()) is a valid expression whose type models Scalar, -mp_units​::​imag(E) is expression-equivalent to auto(t.imag()).
  • Otherwise, if T is a class or enumeration type and -auto(imag(t)) is a valid expression whose type models Scalar -where the meaning of imag is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​imag(E) is expression-equivalent to that expression.
  • Otherwise, mp_units​::​imag(E) is ill-formed.

5.5.3.4 mp_units​::​modulus [qty.modulus.cpo]

The name mp_units​::​modulus denotes a customization point object (N4971, [customization.point.object]).
Given a subexpression E with type T, -let t be an lvalue that denotes the reified object for E.
Then: -
  • If T does not model WeaklyRegular, -mp_units​::​modulus(E) is ill-formed.
  • If auto(t.modulus()) is a valid expression whose type models Scalar, -mp_units​::​modulus(E) is expression-equivalent to auto(t.modulus()).
  • Otherwise, if T is a class or enumeration type and -auto(modulus(t)) is a valid expression whose type models Scalar -where the meaning of modulus is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​modulus(E) is expression-equivalent to that expression.
  • If auto(t.abs()) is a valid expression whose type models Scalar, -mp_units​::​modulus(E) is expression-equivalent to auto(t.abs()).
  • Otherwise, if T is a class or enumeration type and -auto(abs(t)) is a valid expression whose type models Scalar -where the meaning of abs is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​modulus(E) is expression-equivalent to that expression.
  • Otherwise, mp_units​::​modulus(E) is ill-formed.

5.5.3.5 mp_units​::​magnitude [qty.mag.cpo]

The name mp_units​::​magnitude denotes a customization point object (N4971, [customization.point.object]).
Given a subexpression E with type T, -let t be an lvalue that denotes the reified object for E.
Then: -
  • If T does not model WeaklyRegular, -mp_units​::​magnitude(E) is ill-formed.
  • If auto(t.magnitude()) is a valid expression whose type models Scalar, -mp_units​::​magnitude(E) is expression-equivalent to auto(t.magnitude()).
  • Otherwise, if T is a class or enumeration type and -auto(magnitude(t)) is a valid expression whose type models Scalar -where the meaning of magnitude is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​magnitude(E) is expression-equivalent to that expression.
  • Otherwise, if auto(t.abs()) is a valid expression whose type models Scalar, -mp_units​::​magnitude(​E) is expression-equivalent to auto(t.abs()).
  • Otherwise, if T is a class or enumeration type and -auto(abs(t)) is a valid expression whose type models Scalar -where the meaning of magnitude is established as-if by performing argument-dependent lookup only (N4971, [basic.lookup.argdep]), -then mp_units​::​magnitude(E) is expression-equivalent to that expression.
  • Otherwise, mp_units​::​magnitude(E) is ill-formed.

5.5.4 Concepts [qty.rep.concepts]

template<typename T> -concept WeaklyRegular = std::copyable<T> && std::equality_comparable<T>; // exposition only - -template<typename T> -concept Scalar = (!disable_scalar<T>) && WeaklyRegular<T> && requires(T a, T b) { // exposition only - // scalar operations - { -a } -> std::common_with<T>; - { a + b } -> std::common_with<T>; - { a - b } -> std::common_with<T>; - { a * b } -> std::common_with<T>; - { a / b } -> std::common_with<T>; -}; -
TBD.
template<typename T> -using value-type-t = actual-value-type-t<T>; // exposition only, see [qty.fp.traits] - -template<typename T> -concept Complex = // exposition only - (!disable_complex<T>) && WeaklyRegular<T> && Scalar<value-type-t<T>> && - std::constructible_from<T, value-type-t<T>, value-type-t<T>> && - requires(T a, T b, value-type-t<T> s) { - // complex operations - { -a } -> std::common_with<T>; - { a + b } -> std::common_with<T>; - { a - b } -> std::common_with<T>; - { a * b } -> std::common_with<T>; - { a / b } -> std::common_with<T>; - { a * s } -> std::common_with<T>; - { s * a } -> std::common_with<T>; - { a / s } -> std::common_with<T>; - ::mp_units::real(a); - ::mp_units::imag(a); - ::mp_units::modulus(a); - }; -
TBD.
template<typename T> -concept Vector = // exposition only - (!disable_vector<T>) && WeaklyRegular<T> && Scalar<value-type-t<T>> && - requires(T a, T b, value-type-t<T> s) { - // vector operations - { -a } -> std::common_with<T>; - { a + b } -> std::common_with<T>; - { a - b } -> std::common_with<T>; - { a * s } -> std::common_with<T>; - { s * a } -> std::common_with<T>; - { a / s } -> std::common_with<T>; - ::mp_units::magnitude(a); - }; -
TBD.
template<typename T> -using scaling-factor-type-t = // exposition only - std::conditional_t<treat_as_floating_point<T>, long double, std::intmax_t>; - -template<typename T> -concept ScalarRepresentation = // exposition only - (!is-specialization-of<T, quantity>()) && Scalar<T> && - requires(T a, T b, scaling-factor-type-t<T> f) { - // scaling - { a * f } -> std::common_with<T>; - { f * a } -> std::common_with<T>; - { a / f } -> std::common_with<T>; - }; -
TBD.
template<typename T> -concept ComplexRepresentation = // exposition only - (!is-specialization-of<T, quantity>()) && Complex<T> && - requires(T a, T b, scaling-factor-type-t<T> f) { - // scaling - { a * T(f) } -> std::common_with<T>; - { T(f) * a } -> std::common_with<T>; - { a / T(f) } -> std::common_with<T>; - }; -
TBD.
template<typename T> -concept VectorRepresentation = // exposition only - (!is-specialization-of<T, quantity>()) && Vector<T>; -
TBD.
template<typename T> -concept Representation = ScalarRepresentation<T> || ComplexRepresentation<T> || - VectorRepresentation<T>; -
A type T models Representation if -it represents the numerical value of a quantity (IEC 60050, 112-01-29).
template<typename T, quantity_character Ch> -concept IsOfCharacter = (Ch == quantity_character::real_scalar && Scalar<T>) || // exposition only - (Ch == quantity_character::complex_scalar && Complex<T>) || - (Ch == quantity_character::vector && Vector<T>); - -template<typename T, auto V> -concept RepresentationOf = - Representation<T> && ((QuantitySpec<decltype(V)> && - (QuantityKindSpec<decltype(V)> || IsOfCharacter<T, V.character>)) || - (std::same_as<quantity_character, decltype(V)> && IsOfCharacter<T, V>)); -
A type T models RepresentationOf<V> if -T models Representation and -
  • V is a kind of quantity, or
  • if V is a quantity, then T represents a value of its character, or
  • if V is a quantity character, then T represents a value of V.

5.6 Quantity [qty]

5.6.1 General [qty.general]

Subclause [qty] describes the class template quantity -that represents the value of a quantity (IEC 60050, 112-01-28) -that is an element of a vector space (IEC 60050, 102-03-01,102-03-04).

5.6.2 Interoperability [qty.like]

The interfaces specified in this subclause and subclause [qty.pt.like] -are used by quantity and quantity_point -to specify conversions with other types representing quantities.
[Note 1: 
[qty.chrono] implements them for std​::​chrono​::​duration and std​::​chrono​::​time_point.
— end note]
template<typename T, template<typename> typename Traits> -concept qty-like-impl = requires(const T& qty, const Traits<T>::rep& num) { // exposition only - { Traits<T>::to_numerical_value(qty) } -> std::same_as<typename Traits<T>::rep>; - { Traits<T>::from_numerical_value(num) } -> std::same_as<T>; - requires std::same_as<decltype(Traits<T>::explicit_import), const bool>; - requires std::same_as<decltype(Traits<T>::explicit_export), const bool>; - typename std::bool_constant<Traits<T>::explicit_import>; - typename std::bool_constant<Traits<T>::explicit_export>; -}; - -template<typename T> -concept QuantityLike = !Quantity<T> && qty-like-impl<T, quantity_like_traits> && requires { - typename quantity<quantity_like_traits<T>::reference, typename quantity_like_traits<T>::rep>; -}; -
In the following descriptions, let -
  • Traits be quantity_like_traits or quantity_point_like_traits,
  • Q be a type for which Traits<Q> is specialized,
  • qty be an lvalue of type const Q, and
  • num be an lvalue of type const Traits<Q>​::​rep.
Q models qty-like-impl<Traits> if and only if: -
  • Traits<Q>​::​to_numerical_value(qty) returns the numerical value (IEC 60050, 112-01-29) of qty.
  • Traits<Q>​::​from_numerical_value(num) returns a Q with numerical value num.
  • If Traits is quantity_point_like_traits, -both numerical values are offset from Traits<Q>​::​point_origin.
If the following expression is true, the specified conversion will be explicit.
  • Traits<Q>​::​explicit_import for the conversion from Q to this library's type.
  • Traits<Q>​::​explicit_export for the conversion from this library's type to Q.

5.6.3 Class template quantity [qty.syn]

namespace mp_units { - -template<typename T> -concept Quantity = (is-derived-from-specialization-of<T, quantity>()); // exposition only - -template<typename Q, auto QS> -concept QuantityOf = // exposition only - Quantity<Q> && QuantitySpecOf<decltype(auto(Q::quantity_spec)), QS>; - -template<Unit UFrom, Unit UTo> -consteval bool integral-conversion-factor(UFrom from, UTo to) // exposition only -{ - return is-integral(get-canonical-unit(from).mag / get-canonical-unit(to).mag); -} - -template<typename T> -concept IsFloatingPoint = treat_as_floating_point<T>; // exposition only - -template<typename FromRep, typename ToRep, auto FromUnit = one, auto ToUnit = one> -concept ValuePreservingTo = // exposition only - Representation<std::remove_cvref_t<FromRep>> && Representation<ToRep> && - Unit<decltype(FromUnit)> && Unit<decltype(ToUnit)> && std::assignable_from<ToRep&, FromRep> && - (IsFloatingPoint<ToRep> || (!IsFloatingPoint<std::remove_cvref_t<FromRep>> && - (integral-conversion-factor(FromUnit, ToUnit)))); - -template<typename QFrom, typename QTo> -concept QuantityConvertibleTo = // exposition only - Quantity<QFrom> && Quantity<QTo> && - QuantitySpecConvertibleTo<QFrom::quantity_spec, QTo::quantity_spec> && - UnitConvertibleTo<QFrom::unit, QTo::unit> && - ValuePreservingTo<typename QFrom::rep, typename QTo::rep, QFrom::unit, QTo::unit> && - requires(QFrom q) { sudo-cast<QTo>(q); }; // see [qty.non.mem.conv] - -template<auto QS, typename Func, typename T, typename U> -concept InvokeResultOf = // exposition only - QuantitySpec<decltype(QS)> && std::regular_invocable<Func, T, U> && - RepresentationOf<std::invoke_result_t<Func, T, U>, QS>; - -template<typename Func, typename Q1, typename Q2, - auto QS = std::invoke_result_t<Func, decltype(auto(Q1::quantity_spec)), - decltype(auto(Q2::quantity_spec))>{}> -concept InvocableQuantities = // exposition only - QuantitySpec<decltype(QS)> && Quantity<Q1> && Quantity<Q2> && - InvokeResultOf<QS, Func, typename Q1::rep, typename Q2::rep>; - -template<auto R1, auto R2> -concept HaveCommonReference = requires { get_common_reference(R1, R2); }; // exposition only - -template<typename Func, Quantity Q1, Quantity Q2> -using common-quantity-for = // exposition only - quantity<get_common_reference(Q1::reference, Q2::reference), - std::invoke_result_t<Func, typename Q1::rep, typename Q2::rep>>; - -template<typename Func, typename Q1, typename Q2> -concept CommonlyInvocableQuantities = // exposition only - Quantity<Q1> && Quantity<Q2> && HaveCommonReference<Q1::reference, Q2::reference> && - std::convertible_to<Q1, common-quantity-for<Func, Q1, Q2>> && - std::convertible_to<Q2, common-quantity-for<Func, Q1, Q2>> && - InvocableQuantities<Func, Q1, Q2, - get_common_quantity_spec(Q1::quantity_spec, Q2::quantity_spec)>; - -template<auto R1, auto R2, typename Rep1, typename Rep2> -concept SameValueAs = // exposition only - (equivalent(get_unit(R1), get_unit(R2))) && std::convertible_to<Rep1, Rep2>; - -template<typename T> -using quantity-like-type = // exposition only - quantity<quantity_like_traits<T>::reference, typename quantity_like_traits<T>::rep>; - -template<typename T, typename U, typename TT = std::remove_reference_t<T>> -concept Mutable = (!std::is_const_v<TT>) && std::derived_from<TT, U>; // exposition only - -template<Reference auto R, RepresentationOf<get_quantity_spec(R)> Rep = double> -class quantity { -public: - Rep numerical-value; // exposition only - - // member types and values - static constexpr Reference auto reference = R; - static constexpr QuantitySpec auto quantity_spec = get_quantity_spec(reference); - static constexpr Dimension auto dimension = quantity_spec.dimension; - static constexpr Unit auto unit = get_unit(reference); - using rep = Rep; - - // [qty.static], static member functions - static constexpr quantity zero() noexcept - requires see below; - static constexpr quantity one() noexcept - requires see below; - static constexpr quantity min() noexcept - requires see below; - static constexpr quantity max() noexcept - requires see below; - - // [qty.cons], constructors and assignment - - quantity() = default; - quantity(const quantity&) = default; - quantity(quantity&&) = default; - ~quantity() = default; - - template<typename FwdValue, Reference R2> - requires SameValueAs<R2{}, R, std::remove_cvref_t<FwdValue>, Rep> - constexpr quantity(FwdValue&& v, R2); - - template<typename FwdValue, Reference R2, typename Value = std::remove_cvref_t<FwdValue>> - requires(!SameValueAs<R2{}, R, Value, Rep>) && - QuantityConvertibleTo<quantity<R2{}, Value>, quantity> - constexpr quantity(FwdValue&& v, R2); - - template<ValuePreservingTo<Rep> FwdValue> - requires(unit == ::mp_units::one) - constexpr quantity(FwdValue&& v); - - template<QuantityConvertibleTo<quantity> Q> - constexpr explicit(see below) quantity(const Q& q); - - template<QuantityLike Q> - requires QuantityConvertibleTo<quantity-like-type<Q>, quantity> - constexpr explicit(see below) quantity(const Q& q); - - quantity& operator=(const quantity&) = default; - quantity& operator=(quantity&&) = default; - - template<ValuePreservingTo<Rep> FwdValue> - requires(unit == ::mp_units::one) - constexpr quantity& operator=(FwdValue&& v); - - // [qty.conv], conversions - - template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires QuantityConvertibleTo<quantity, quantity<make-reference(quantity_spec, ToU{}), Rep>> - constexpr QuantityOf<quantity_spec> auto in(ToU) const; - - template<RepresentationOf<quantity_spec> ToRep> - requires QuantityConvertibleTo<quantity, quantity<reference, ToRep>> - constexpr QuantityOf<quantity_spec> auto in() const; - - template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires QuantityConvertibleTo<quantity, - quantity<make-reference(quantity_spec, ToU{}), ToRep>> - constexpr QuantityOf<quantity_spec> auto in(ToU) const; - - template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires requires(const quantity q) { value_cast<ToU{}>(q); } - constexpr QuantityOf<quantity_spec> auto force_in(ToU) const; - - template<RepresentationOf<quantity_spec> ToRep> - requires requires(const quantity q) { value_cast<ToRep>(q); } - constexpr QuantityOf<quantity_spec> auto force_in() const; - - template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires requires(const quantity q) { value_cast<ToU{}, ToRep>(q); } - constexpr QuantityOf<quantity_spec> auto force_in(ToU) const; - - // [qty.obs], numerical value observers - - template<Unit U> - requires(equivalent(U{}, unit)) - constexpr rep& numerical_value_ref_in(U) & noexcept; - template<Unit U> - requires(equivalent(U{}, unit)) - constexpr const rep& numerical_value_ref_in(U) const & noexcept; - template<Unit U> - requires(equivalent(U{}, unit)) - void numerical_value_ref_in(U) const && = delete; - - template<UnitCompatibleWith<unit, quantity_spec> U> - requires QuantityConvertibleTo<quantity, quantity<make-reference(quantity_spec, U{}), Rep>> - constexpr rep numerical_value_in(U) const noexcept; - - template<UnitCompatibleWith<unit, quantity_spec> U> - requires requires(const quantity q) { value_cast<U{}>(q); } - constexpr rep force_numerical_value_in(U) const noexcept; - - // [qty.conv.ops], conversion operations - - template<typename V_, std::constructible_from<Rep> Value = std::remove_cvref_t<V_>> - requires(unit == ::mp_units::one) - explicit operator V_() const & noexcept; - - template<typename Q_, QuantityLike Q = std::remove_cvref_t<Q_>> - requires QuantityConvertibleTo<quantity, quantity-like-type<Q>> - constexpr explicit(see below) operator Q_() const noexcept(see below); - - // [qty.unary.ops], unary operations - - constexpr QuantityOf<quantity_spec> auto operator+() const - requires see below; - constexpr QuantityOf<quantity_spec> auto operator-() const - requires see below; - - template<Mutable<quantity> Q> - friend constexpr decltype(auto) operator++(Q&& q) - requires see below; - template<Mutable<quantity> Q> - friend constexpr decltype(auto) operator--(Q&& q) - requires see below; - - constexpr QuantityOf<quantity_spec> auto operator++(int) - requires see below; - constexpr QuantityOf<quantity_spec> auto operator--(int) - requires see below; - - // [qty.assign.ops], compound assignment operations - - template<Mutable<quantity> Q, auto R2, typename Rep2> - requires see below - friend constexpr decltype(auto) operator+=(Q&& lhs, const quantity<R2, Rep2>& rhs); - template<Mutable<quantity> Q, auto R2, typename Rep2> - requires see below - friend constexpr decltype(auto) operator-=(Q&& lhs, const quantity<R2, Rep2>& rhs); - template<Mutable<quantity> Q, auto R2, typename Rep2> - requires see below - friend constexpr decltype(auto) operator%=(Q&& lhs, const quantity<R2, Rep2>& rhs); - - template<Mutable<quantity> Q, ValuePreservingTo<Rep> Value> - requires see below - friend constexpr decltype(auto) operator*=(Q&& lhs, const Value& rhs); - template<Mutable<quantity> Q, ValuePreservingTo<Rep> Value> - requires see below - friend constexpr decltype(auto) operator/=(Q&& lhs, const Value& rhs); - - template<Mutable<quantity> Q, QuantityOf<dimensionless> Q2> - requires see below - friend constexpr decltype(auto) operator*=(Q&& lhs, const Q2& rhs); - template<Mutable<quantity> Q, QuantityOf<dimensionless> Q2> - requires see below - friend constexpr decltype(auto) operator/=(Q&& lhs, const Q2& rhs); - - // [qty.arith.ops], arithmetic operations - - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires CommonlyInvocableQuantities<std::plus<>, quantity, quantity<R2, Rep2>> - friend constexpr Quantity auto operator+(const Q& lhs, const quantity<R2, Rep2>& rhs); - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires CommonlyInvocableQuantities<std::minus<>, quantity, quantity<R2, Rep2>> - friend constexpr Quantity auto operator-(const Q& lhs, const quantity<R2, Rep2>& rhs); - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires(!treat_as_floating_point<Rep>) && (!treat_as_floating_point<Rep2>) && - CommonlyInvocableQuantities<std::modulus<>, quantity, quantity<R2, Rep2>> - friend constexpr Quantity auto operator%(const Q& lhs, const quantity<R2, Rep2>& rhs); - - template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::plus<>, Rep, const Value&> - friend constexpr Quantity auto operator+(const Q& lhs, const Value& rhs); - template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::minus<>, Rep, const Value&> - friend constexpr Quantity auto operator-(const Q& lhs, const Value& rhs); - template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::modulus<>, Rep, const Value&> - friend constexpr Quantity auto operator%(const Q& lhs, const Value& rhs); - - template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::plus<>, Rep, const Value&> - friend constexpr Quantity auto operator+(const Value& lhs, const Q& rhs); - template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::minus<>, Rep, const Value&> - friend constexpr Quantity auto operator-(const Value& lhs, const Q& rhs); - template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::modulus<>, Rep, const Value&> - friend constexpr Quantity auto operator%(const Value& lhs, const Q& rhs); - - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires InvocableQuantities<std::multiplies<>, quantity, quantity<R2, Rep2>> - friend constexpr Quantity auto operator*(const Q& lhs, const quantity<R2, Rep2>& rhs); - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires InvocableQuantities<std::divides<>, quantity, quantity<R2, Rep2>> - friend constexpr Quantity auto operator/(const Q& lhs, const quantity<R2, Rep2>& rhs); - - template<std::derived_from<quantity> Q, typename Value> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::multiplies<>, Rep, const Value&> - friend constexpr QuantityOf<quantity_spec> auto operator*(const Q& lhs, const Value& rhs); - template<std::derived_from<quantity> Q, typename Value> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::divides<>, Rep, const Value&> - friend constexpr QuantityOf<quantity_spec> auto operator/(const Q& lhs, const Value& rhs); - - template<typename Value, std::derived_from<quantity> Q> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::multiplies<>, const Value&, Rep> - friend constexpr QuantityOf<quantity_spec> auto operator*(const Value& lhs, const Q& rhs); - template<typename Value, std::derived_from<quantity> Q> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::divides<>, const Value&, Rep> - friend constexpr Quantity auto operator/(const Value&, const Q&); - - // [qty.cmp], comparison - - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires see below - friend constexpr bool operator==(const Q& lhs, const quantity<R2, Rep2>& rhs); - template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires see below - friend constexpr auto operator<=>(const Q& lhs, const quantity<R2, Rep2>& rhs); - - template<std::derived_from<quantity> Q, Representation Value> - requires see below - friend constexpr bool operator==(const Q& lhs, const Value& rhs); - template<std::derived_from<quantity> Q, Representation Value> - requires see below - friend constexpr auto operator<=>(const Q& lhs, const Value& rhs); - - // [qty.val.cmp], value comparison - friend constexpr bool is_eq_zero(const quantity& q) requires see below; - friend constexpr bool is_neq_zero(const quantity& q) requires see below; - friend constexpr bool is_lt_zero(const quantity& q) requires see below; - friend constexpr bool is_gt_zero(const quantity& q) requires see below; - friend constexpr bool is_lteq_zero(const quantity& q) requires see below; - friend constexpr bool is_gteq_zero(const quantity& q) requires see below; -}; - -template<Representation Value, Reference R> -quantity(Value, R) -> quantity<R{}, Value>; - -template<Representation Value> -quantity(Value) -> quantity<one, Value>; - -template<QuantityLike Q> -explicit(quantity_like_traits<Q>::explicit_import) quantity(Q) - -> quantity<quantity_like_traits<Q>::reference, typename quantity_like_traits<Q>::rep>; - -} -
quantity<R, Rep> is a structural type (N4971, [temp.param]) -if Rep is a structural type.

5.6.4 Static member functions [qty.static]

static constexpr quantity zero() noexcept - requires see below; -static constexpr quantity one() noexcept - requires see below; -static constexpr quantity min() noexcept - requires see below; -static constexpr quantity max() noexcept - requires see below; -
Let F be one of zero, one, min, and max.
Returns: {representation_values<rep>​::​F(), R}.
Remarks: The expression in the requires-clause is equivalent to: -requires { representation_values<rep>::F(); } -

5.6.5 Constructors and assignment [qty.cons]

template<typename FwdValue, Reference R2> - requires SameValueAs<R2{}, R, std::remove_cvref_t<FwdValue>, Rep> -constexpr quantity(FwdValue&& v, R2); - -template<ValuePreservingTo<Rep> FwdValue> - requires(unit == ::mp_units::one) -constexpr quantity(FwdValue&& v); -
Effects: Initializes numerical-value with std​::​forward<FwdValue>(v).
template<typename FwdValue, Reference R2, typename Value = std::remove_cvref_t<FwdValue>> - requires(!SameValueAs<R2{}, R, Value, Rep>) && - QuantityConvertibleTo<quantity<R2{}, Value>, quantity> -constexpr quantity(FwdValue&& v, R2); -
Effects: Equivalent to -quantity(quantity<R2{}, Value>{std​::​forward<FwdValue>(v), R2{}}).
template<QuantityConvertibleTo<quantity> Q> -constexpr explicit(!std::convertible_to<typename Q::rep, Rep>) quantity(const Q& q); -
Effects: Equivalent to sudo-cast<quantity>(q) ([qty.non.mem.conv]).
template<QuantityLike Q> - requires QuantityConvertibleTo<quantity-like-type<Q>, quantity> -constexpr explicit(see below) quantity(const Q& q); -
Effects: Equivalent to: -quantity(::mp_units::quantity{quantity_like_traits<Q>::to_numerical_value(q), - quantity_like_traits<Q>::reference}) -
Remarks: The expression inside explicit is equivalent to: -quantity_like_traits<Q>::explicit_import || - !std::convertible_to<typename quantity_like_traits<Q>::rep, Rep> -
template<ValuePreservingTo<Rep> FwdValue> - requires(unit == ::mp_units::one) -constexpr quantity& operator=(FwdValue&& v); -
Effects: Equivalent to numerical-value = std​::​forward<FwdValue>(v).
Returns: *this.

5.6.6 Conversions [qty.conv]

template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires QuantityConvertibleTo<quantity, quantity<make-reference(quantity_spec, ToU{}), Rep>> -constexpr QuantityOf<quantity_spec> auto in(ToU) const; -
Effects: Equivalent to: -return quantity<make-reference(quantity_spec, ToU{}), Rep>{*this};
template<RepresentationOf<quantity_spec> ToRep> - requires QuantityConvertibleTo<quantity, quantity<reference, ToRep>> -constexpr QuantityOf<quantity_spec> auto in() const; -
Effects: Equivalent to: -return quantity<reference, ToRep>{*this};
template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires QuantityConvertibleTo<quantity, - quantity<make-reference(quantity_spec, ToU{}), ToRep>> -constexpr QuantityOf<quantity_spec> auto in(ToU) const; -
Effects: Equivalent to: -return quantity<make-reference(quantity_spec, ToU{}), ToRep>{*this}; -
template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires requires(const quantity q) { value_cast<ToU{}>(q); } -constexpr QuantityOf<quantity_spec> auto force_in(ToU) const; -
Effects: Equivalent to: -return value_cast<ToU{}>(*this);
template<RepresentationOf<quantity_spec> ToRep> - requires requires(const quantity q) { value_cast<ToRep>(q); } -constexpr QuantityOf<quantity_spec> auto force_in() const; -
Effects: Equivalent to: -return value_cast<ToRep>(*this);
template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires requires(const quantity q) { value_cast<ToU{}, ToRep>(q); } -constexpr QuantityOf<quantity_spec> auto force_in(ToU) const; -
Effects: Equivalent to: -return value_cast<ToU{}, ToRep>(*this);

5.6.7 Numerical value observers [qty.obs]

template<Unit U> - requires(equivalent(U{}, unit)) -constexpr rep& numerical_value_ref_in(U) & noexcept; -template<Unit U> - requires(equivalent(U{}, unit)) -constexpr const rep& numerical_value_ref_in(U) const & noexcept; -
Returns: numerical-value.
template<UnitCompatibleWith<unit, quantity_spec> U> - requires QuantityConvertibleTo<quantity, quantity<make-reference(quantity_spec, U{}), Rep>> -constexpr rep numerical_value_in(U) const noexcept; -
Effects: Equivalent to: -return (*this).in(U{}).numerical-value;
template<UnitCompatibleWith<unit, quantity_spec> U> - requires requires(const quantity q) { value_cast<U{}>(q); } -constexpr rep force_numerical_value_in(U) const noexcept; -
Effects: Equivalent to: -return (*this).force_in(U{}).numerical-value;

5.6.8 Conversion operations [qty.conv.ops]

template<typename V_, std::constructible_from<Rep> Value = std::remove_cvref_t<V_>> - requires(unit == ::mp_units::one) -explicit operator V_() const & noexcept; -
Returns: numerical-value.
template<typename Q_, QuantityLike Q = std::remove_cvref_t<Q_>> - requires QuantityConvertibleTo<quantity, quantity-like-type<Q>> -constexpr explicit(see below) operator Q_() const noexcept(see below); -
Effects: Equivalent to: -return quantity_like_traits<Q>::from_numerical_value( - numerical_value_in(get_unit(quantity_like_traits<Q>::reference))); -
Remarks: The expression inside explicit is equivalent to: -quantity_like_traits<Q>::explicit_export || - !std::convertible_to<Rep, typename quantity_like_traits<Q>::rep> -
-The exception specification is equivalent to: -noexcept(quantity_like_traits<Q>::from_numerical_value(numerical-value)) && - std::is_nothrow_copy_constructible_v<rep> -

5.6.9 Unary operations [qty.unary.ops]

In the following descriptions, -let @ be the operator.
constexpr QuantityOf<quantity_spec> auto operator+() const - requires see below; -constexpr QuantityOf<quantity_spec> auto operator-() const - requires see below; -
Effects: Equivalent to: -return ​::​mp_units​::​quantity{@numerical-value, reference};
Remarks: The expression in the requires-clause is equivalent to: -requires(const rep v) { - { @v } -> std::common_with<rep>; -} -
template<Mutable<quantity> Q> -friend constexpr decltype(auto) operator++(Q&& q) - requires see below; -template<Mutable<quantity> Q> -friend constexpr decltype(auto) operator--(Q&& q) - requires see below; -
Effects: Equivalent to -@q.numerical-value.
Returns: std​::​forward<Q>(q).
Remarks: The expression in the requires-clause is equivalent to: -requires(rep& v) { - { @v } -> std::same_as<rep&>; -} -
constexpr QuantityOf<quantity_spec> auto operator++(int) - requires see below; -constexpr QuantityOf<quantity_spec> auto operator--(int) - requires see below; -
Effects: Equivalent to: -return ​::​mp_units​::​quantity{numerical-value@, reference};
Remarks: The expression in the requires-clause is equivalent to: -requires(rep& v) { - { v@ } -> std::common_with<rep>; -} -

5.6.10 Compound assignment operations [qty.assign.ops]

In the following descriptions, -let @ be the operator.
template<Mutable<quantity> Q, auto R2, typename Rep2> - requires see below -friend constexpr decltype(auto) operator+=(Q&& lhs, const quantity<R2, Rep2>& rhs); -template<Mutable<quantity> Q, auto R2, typename Rep2> - requires see below -friend constexpr decltype(auto) operator-=(Q&& lhs, const quantity<R2, Rep2>& rhs); -template<Mutable<quantity> Q, auto R2, typename Rep2> - requires see below -friend constexpr decltype(auto) operator%=(Q&& lhs, const quantity<R2, Rep2>& rhs); -
Preconditions: If @ is %=, then is_neq_zero(rhs) is true.
Effects: Equivalent to -lhs.numerical-value @ rhs.in(lhs.unit).numerical-value.
Returns: std​::​forward<Q>(lhs).
Remarks: Let C be -
  • (!treat_as_floating_point<rep>) if @ is %=, and
  • true otherwise.
-The expression in the requires-clause is equivalent to: -QuantityConvertibleTo<quantity<R2, Rep2>, quantity> && C && -requires(rep& a, const Rep2 b) { - { a @ b } -> std::same_as<rep&>; -} -
Recommended practice: If equivalent(unit, get_unit(rhs.reference)) is true, -then the expression rhs.in(lhs.unit) is replaced with rhs.
template<Mutable<quantity> Q, ValuePreservingTo<Rep> Value> - requires see below -friend constexpr decltype(auto) operator*=(Q&& lhs, const Value& rhs); -template<Mutable<quantity> Q, ValuePreservingTo<Rep> Value> - requires see below -friend constexpr decltype(auto) operator/=(Q&& lhs, const Value& rhs); -
Preconditions: If @ is /=, then rhs != representation_values<Value>​::​zero() is true.
Effects: Equivalent to -lhs.numerical-value @ rhs.
Returns: std​::​forward<Q>(lhs).
Remarks: The expression in the requires-clause is equivalent to: -(!Quantity<Value>) && requires(rep& a, const Value b) { - { a @ b } -> std::same_as<rep&>; -} -
template<Mutable<quantity> Q, QuantityOf<dimensionless> Q2> - requires see below -friend constexpr decltype(auto) operator*=(Q&& lhs, const Q2& rhs); -template<Mutable<quantity> Q, QuantityOf<dimensionless> Q2> - requires see below -friend constexpr decltype(auto) operator/=(Q&& lhs, const Q2& rhs); -
Effects: Equivalent to: -return std​::​forward<Q>(lhs) @ rhs.numerical-value;
Remarks: The expression in the requires-clause is equivalent to: -(Q2::unit == ::mp_units::one) && ValuePreservingTo<typename Q2::rep, Rep> && -requires(rep& a, const Q2::rep b) { - { a @ b } -> std::same_as<rep&>; -} -

5.6.11 Arithmetic operations [qty.arith.ops]

In the following descriptions, -let @ be the operator.
template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires CommonlyInvocableQuantities<std::plus<>, quantity, quantity<R2, Rep2>> -friend constexpr Quantity auto operator+(const Q& lhs, const quantity<R2, Rep2>& rhs); -template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires CommonlyInvocableQuantities<std::minus<>, quantity, quantity<R2, Rep2>> -friend constexpr Quantity auto operator-(const Q& lhs, const quantity<R2, Rep2>& rhs); -template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires(!treat_as_floating_point<Rep>) && (!treat_as_floating_point<Rep2>) && - CommonlyInvocableQuantities<std::modulus<>, quantity, quantity<R2, Rep2>> -friend constexpr Quantity auto operator%(const Q& lhs, const quantity<R2, Rep2>& rhs); -
Let F be the first argument to CommonlyInvocableQuantities.
Preconditions: If @ is %, then is_neq_zero(rhs) is true.
Effects: Equivalent to: -using ret = common-quantity-for<F, quantity, quantity<R2, Rep2>>; -const ret ret_lhs(lhs); -const ret ret_rhs(rhs); -return ::mp_units::quantity{ - ret_lhs.numerical_value_ref_in(ret::unit) @ ret_rhs.numerical_value_ref_in(ret::unit), - ret::reference}; -
template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::plus<>, Rep, const Value&> -friend constexpr Quantity auto operator+(const Q& lhs, const Value& rhs); -template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::minus<>, Rep, const Value&> -friend constexpr Quantity auto operator-(const Q& lhs, const Value& rhs); -template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::modulus<>, Rep, const Value&> -friend constexpr Quantity auto operator%(const Q& lhs, const Value& rhs); -
Effects: Equivalent to: -return lhs @ ​::​mp_units​::​quantity{rhs};
template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::plus<>, Rep, const Value&> -friend constexpr Quantity auto operator+(const Value& lhs, const Q& rhs); -template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::minus<>, Rep, const Value&> -friend constexpr Quantity auto operator-(const Value& lhs, const Q& rhs); -template<std::derived_from<quantity> Q, Representation Value> - requires(Q::unit == ::mp_units::one) && - InvokeResultOf<quantity_spec, std::modulus<>, Rep, const Value&> -friend constexpr Quantity auto operator%(const Value& lhs, const Q& rhs); -
Effects: Equivalent to: -return ​::​mp_units​::​quantity{lhs} @ rhs;
template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires InvocableQuantities<std::multiplies<>, quantity, quantity<R2, Rep2>> -friend constexpr Quantity auto operator*(const Q& lhs, const quantity<R2, Rep2>& rhs); -template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires InvocableQuantities<std::divides<>, quantity, quantity<R2, Rep2>> -friend constexpr Quantity auto operator/(const Q& lhs, const quantity<R2, Rep2>& rhs); -
Preconditions: If @ is /, then is_neq_zero(rhs) is true.
Effects: Equivalent to: -return ::mp_units::quantity{ - lhs.numerical_value_ref_in(unit) @ rhs.numerical_value_ref_in(rhs.unit), R @ R2}; -
template<std::derived_from<quantity> Q, typename Value> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::multiplies<>, Rep, const Value&> -friend constexpr QuantityOf<quantity_spec> auto operator*(const Q& lhs, const Value& rhs); -template<std::derived_from<quantity> Q, typename Value> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::divides<>, Rep, const Value&> -friend constexpr QuantityOf<quantity_spec> auto operator/(const Q& lhs, const Value& rhs); -
Preconditions: If @ is /, then rhs != representation_values<Value>​::​zero() is true.
Effects: Equivalent to: -return ::mp_units::quantity{lhs.numerical_value_ref_in(unit) @ rhs, R}; -
template<typename Value, std::derived_from<quantity> Q> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::multiplies<>, const Value&, Rep> -friend constexpr QuantityOf<quantity_spec> auto operator*(const Value& lhs, const Q& rhs); -template<typename Value, std::derived_from<quantity> Q> - requires(!Quantity<Value>) && (!Reference<Value>) && - InvokeResultOf<quantity_spec, std::divides<>, const Value&, Rep> -friend constexpr Quantity auto operator/(const Value& lhs, const Q& rhs); -
Preconditions: If @ is /, then is_neq_zero(rhs) is true.
Effects: Equivalent to: -return ::mp_units::quantity{lhs @ rhs.numerical_value_ref_in(unit), ::mp_units::one @ R}; -

5.6.12 Comparison [qty.cmp]

In the following descriptions, -let @ be the operator.
template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires see below -friend constexpr bool operator==(const Q& lhs, const quantity<R2, Rep2>& rhs); -template<std::derived_from<quantity> Q, auto R2, typename Rep2> - requires see below -friend constexpr auto operator<=>(const Q& lhs, const quantity<R2, Rep2>& rhs); -
Let C be -std​::​equality_comparable if @ is ==, and -std​::​three_way_comparable if @ is <=>.
Effects: Equivalent to: -using ct = std::common_type_t<quantity, quantity<R2, Rep2>>; -const ct ct_lhs(lhs); -const ct ct_rhs(rhs); -return ct_lhs.numerical_value_ref_in(ct::unit) @ ct_rhs.numerical_value_ref_in(ct::unit); -
Remarks: The expression in the requires-clause is equivalent to: -requires { - typename std::common_type_t<quantity, quantity<R2, Rep2>>; -} && C<typename std::common_type_t<quantity, quantity<R2, Rep2>>::rep> -
template<std::derived_from<quantity> Q, Representation Value> - requires see below -friend constexpr bool operator==(const Q& lhs, const Value& rhs); -template<std::derived_from<quantity> Q, Representation Value> - requires see below -friend constexpr auto operator<=>(const Q& lhs, const Value& rhs); -
Let C be -std​::​equality_comparable_with if @ is ==, and -std​::​three_way_comparable_with if @ is <=>.
Returns: lhs.numerical_value_ref_in(unit) @ rhs.
Remarks: The expression in the requires-clause is equivalent to: -(Q::unit == ::mp_units::one) && C<Rep, Value> -

5.6.13 Value comparison [qty.val.cmp]

friend constexpr bool is_eq_zero(const quantity& q) requires see below; -friend constexpr bool is_neq_zero(const quantity& q) requires see below; -friend constexpr bool is_lt_zero(const quantity& q) requires see below; -friend constexpr bool is_gt_zero(const quantity& q) requires see below; -friend constexpr bool is_lteq_zero(const quantity& q) requires see below; -friend constexpr bool is_gteq_zero(const quantity& q) requires see below; -
Let is_F_zero be the function name.
Returns:
Remarks: Let C be -std​::​equality_comparable_with if F is eq or neq, and -std​::​three_way_comparable_with otherwise.
The expression in the requires-clause is equivalent to: -requires { - { T::zero() } -> C<quantity>; -} -

5.6.14 Construction helper delta [qty.delta]

namespace mp_units { - -template<Reference R> -struct delta_ { - template<typename FwdRep, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> - constexpr quantity<R{}, Rep> operator()(FwdRep&& lhs) const; -}; - -} -
template<typename FwdRep, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> -constexpr quantity<R{}, Rep> operator()(FwdRep&& lhs) const; -
Effects: Equivalent to: -return quantity{std​::​forward<FwdRep>(lhs), R{}};

5.6.15 Non-member conversions [qty.non.mem.conv]

template<Quantity To, typename FwdFrom, Quantity From = std::remove_cvref_t<FwdFrom>> - requires see below -constexpr To sudo-cast(FwdFrom&& q); // exposition only -
Returns: TBD.
value_cast is an explicit cast that allows truncation.
template<Unit auto ToU, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>> - requires(convertible(Q::reference, ToU)) -constexpr Quantity auto value_cast(FwdQ&& q); -
Effects: Equivalent to: -return sudo-cast<quantity<make-reference(Q::quantity_spec, ToU), typename Q::rep>>( - std::forward<FwdQ>(q)); -
template<Representation ToRep, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>> - requires RepresentationOf<ToRep, Q::quantity_spec> && - std::constructible_from<ToRep, typename Q::rep> -constexpr quantity<Q::reference, ToRep> value_cast(FwdQ&& q); -
Effects: Equivalent to: -return sudo-cast<quantity<Q::reference, ToRep>>(std::forward<FwdQ>(q)); -
template<Unit auto ToU, Representation ToRep, typename FwdQ, - Quantity Q = std::remove_cvref_t<FwdQ>> - requires see below -constexpr Quantity auto value_cast(FwdQ&& q); -template<Representation ToRep, Unit auto ToU, typename FwdQ, - Quantity Q = std::remove_cvref_t<FwdQ>> - requires see below -constexpr Quantity auto value_cast(FwdQ&& q); -
Effects: Equivalent to: -return sudo-cast<quantity<make-reference(Q::quantity_spec, ToU), ToRep>>( - std::forward<FwdQ>(q)); -
Remarks: The expression in the requires-clause is equivalent to: -(convertible(Q::reference, ToU)) && RepresentationOf<ToRep, Q::quantity_spec> && -std::constructible_from<ToRep, typename Q::rep> -
template<Quantity ToQ, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>> - requires(convertible(Q::reference, ToQ::unit)) && (ToQ::quantity_spec == Q::quantity_spec) && - std::constructible_from<typename ToQ::rep, typename Q::rep> -constexpr Quantity auto value_cast(FwdQ&& q); -
Effects: Equivalent to: return sudo-cast<ToQ>(std​::​forward<FwdQ>(q));
quantity_cast is an explicit cast that allows converting to more specific quantities.
[Example 1: auto length = isq::length(42 * m); -auto distance = quantity_cast<isq::distance>(length); - — end example]
template<QuantitySpec auto ToQS, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>> - requires QuantitySpecCastableTo<Q::quantity_spec, ToQS> -constexpr Quantity auto quantity_cast(FwdQ&& q); -
Effects: Equivalent to: -return quantity{std::forward<FwdQ>(q).numerical-value, make-reference(ToQS, Q::unit)}; -

5.6.16 std​::​common_type specializations [qty.common.type]

template<mp_units::Quantity Q1, mp_units::Quantity Q2> - requires requires { - { mp_units::get_common_reference(Q1::reference, Q2::reference) } -> mp_units::Reference; - typename std::common_type_t<typename Q1::rep, typename Q2::rep>; - requires mp_units::RepresentationOf<std::common_type_t<typename Q1::rep, typename Q2::rep>, - mp_units::get_common_quantity_spec(Q1::quantity_spec, - Q2::quantity_spec)>; - } -struct std::common_type<Q1, Q2> { - using type = mp_units::quantity<mp_units::get_common_reference(Q1::reference, Q2::reference), - std::common_type_t<typename Q1::rep, typename Q2::rep>>; -}; - -template<mp_units::Quantity Q, mp_units::Representation Value> - requires(Q::unit == mp_units::one) && requires { - typename mp_units::quantity<Q::reference, std::common_type_t<typename Q::rep, Value>>; - } -struct std::common_type<Q, Value> { - using type = mp_units::quantity<Q::reference, std::common_type_t<typename Q::rep, Value>>; -}; -

5.7 Quantity point [qty.pt]

5.7.1 General [qty.pt.general]

Subclause [qty.pt] describes the class template quantity_point -that represents the value of a quantity (IEC 60050, 112-01-28) -that is an element of an affine space (IEC 60050, 102-03-02,102-04-01).

5.7.2 Point origin [qty.pt.orig]

5.7.2.1 General [qty.pt.orig.general]

This subclause specifies the components -for defining the origin of an affine space.
An origin is a point from which measurements (IEC 60050, 112-04-01) take place.

5.7.2.2 Concepts [qty.pt.orig.concepts]

template<typename T> -concept PointOrigin = SymbolicConstant<T> && std::derived_from<T, point-origin-interface>; - -template<typename T, auto QS> -concept PointOriginFor = PointOrigin<T> && QuantitySpecOf<decltype(QS), T::quantity-spec>; - -template<typename T, auto V> -concept SameAbsolutePointOriginAs = // exposition only - PointOrigin<T> && PointOrigin<decltype(V)> && same-absolute-point-origins(T{}, V); -

5.7.2.3 Types [qty.pt.orig.types]

5.7.2.3.1 Absolute [qty.abs.pt.orig]

namespace mp_units { - -template<QuantitySpec auto QS> -struct absolute_point_origin : point-origin-interface { - static constexpr QuantitySpec auto quantity-spec = QS; // exposition only -}; - -} -
An absolute origin is an origin -chosen by convention and not defined in terms of another origin.
A specialization of absolute_point_origin is used as a base type when defining an absolute origin.
QS is the quantity the origin represents.

5.7.2.3.2 Relative [qty.rel.pt.orig]

namespace mp_units { - -template<QuantityPoint auto QP> -struct relative_point_origin : point-origin-interface { - static constexpr QuantityPoint auto quantity-point = QP; // exposition only - static constexpr QuantitySpec auto quantity-spec = see below; // exposition only - static constexpr PointOrigin auto absolute-point-origin = // exposition only - QP.absolute_point_origin; -}; - -} -
A relative origin is an origin -of a subspace (IEC 60050, 102-03-03).
A specialization of relative_point_origin is used as a base type when defining a relative origin O.
O is offset from QP.absolute_point_origin by QP.quantity_from_zero().
The member quantity-spec is equal to -QP.point_origin.quantity-spec if -QuantityKindSpec<decltype(auto(QP.quantity-spec))> - -is satisfied, and -to QP.quantity-spec otherwise.

5.7.2.3.3 Zeroth [qty.zeroth.pt.orig]

namespace mp_units { - -template<QuantitySpec auto QS> -struct zeroth_point_origin_ final : absolute_point_origin<QS> {}; - -} -
zeroth_point_origin_<QS> represents an origin -chosen by convention as the value 0 of the quantity QS.

5.7.2.4 Operations [qty.pt.orig.ops]

namespace mp_units { - -struct point-origin-interface { - template<PointOrigin PO, typename FwdQ, - QuantityOf<PO::quantity-spec> Q = std::remove_cvref_t<FwdQ>> - friend constexpr quantity_point<Q::reference, PO{}, typename Q::rep> operator+(PO, FwdQ&& q); - template<Quantity FwdQ, PointOrigin PO, - QuantityOf<PO::quantity-spec> Q = std::remove_cvref_t<FwdQ>> - friend constexpr quantity_point<Q::reference, PO{}, typename Q::rep> operator+(FwdQ&& q, PO); - - template<PointOrigin PO, Quantity Q> - requires ReferenceOf<decltype(auto(Q::reference)), PO::quantity-spec> - friend constexpr QuantityPoint auto operator-(PO po, const Q& q) - requires requires { -q; }; - - template<PointOrigin PO1, SameAbsolutePointOriginAs<PO1{}> PO2> - requires see below - friend constexpr Quantity auto operator-(PO1 po1, PO2 po2); - - template<PointOrigin PO1, PointOrigin PO2> - friend consteval bool operator==(PO1 po1, PO2 po2); -}; - -} -
template<PointOrigin PO, typename FwdQ, - QuantityOf<PO::quantity-spec> Q = std::remove_cvref_t<FwdQ>> -friend constexpr quantity_point<Q::reference, PO{}, typename Q::rep> operator+(PO, FwdQ&& q); -template<Quantity FwdQ, PointOrigin PO, - QuantityOf<PO::quantity-spec> Q = std::remove_cvref_t<FwdQ>> -friend constexpr quantity_point<Q::reference, PO{}, typename Q::rep> operator+(FwdQ&& q, PO); -
Effects: Equivalent to: -return quantity_point{std​::​forward<FwdQ>(q), PO{}};
template<PointOrigin PO, Quantity Q> - requires ReferenceOf<decltype(auto(Q::reference)), PO::quantity-spec> -friend constexpr QuantityPoint auto operator-(PO po, const Q& q) - requires requires { -q; }; -
Effects: Equivalent to: -return po + -q;
template<PointOrigin PO1, SameAbsolutePointOriginAs<PO1{}> PO2> - requires see below -friend constexpr Quantity auto operator-(PO1 po1, PO2 po2); -
Effects: Equivalent to: -if constexpr (is-derived-from-specialization-of<PO1, absolute_point_origin>()) { - return po1 - po2.quantity-point; -} else if constexpr (is-derived-from-specialization-of<PO2, absolute_point_origin>()) { - return po1.quantity-point - po2; -} else { - return po1.quantity-point - po2.quantity-point; -} -
Remarks: The expression in the requires-clause is equivalent to: -QuantitySpecOf<decltype(auto(PO1::quantity-spec)), PO2::quantity-spec> && - (is-derived-from-specialization-of<PO1, relative_point_origin>() || - is-derived-from-specialization-of<PO2, relative_point_origin>()) -
template<PointOrigin PO1, PointOrigin PO2> -friend consteval bool operator==(PO1 po1, PO2 po2); -
Effects: Equivalent to: -if constexpr (is-derived-from-specialization-of<PO1, absolute_point_origin>() && - is-derived-from-specialization-of<PO2, absolute_point_origin>()) - return std::is_same_v<PO1, PO2> || - (is-specialization-of<PO1, zeroth_point_origin>() && - is-specialization-of<PO2, zeroth_point_origin>() && - interconvertible(po1.quantity-spec, po2.quantity-spec)); -else if constexpr (is-derived-from-specialization-of<PO1, relative_point_origin>() && - is-derived-from-specialization-of<PO2, relative_point_origin>()) - return PO1::quantity-point == PO2::quantity-point; -else if constexpr (is-derived-from-specialization-of<PO1, relative_point_origin>()) - return same-absolute-point-origins(po1, po2) && - is_eq_zero(PO1::quantity-point.quantity_from_zero()); -else if constexpr (is-derived-from-specialization-of<PO2, relative_point_origin>()) - return same-absolute-point-origins(po1, po2) && - is_eq_zero(PO2::quantity-point.quantity_from_zero()); -

5.7.2.5 Utilities [qty.pt.orig.utils]

5.7.2.5.1 Same absolute [qty.same.abs.pt.origs]

template<PointOrigin PO1, PointOrigin PO2> -consteval bool same-absolute-point-origins(PO1 po1, PO2 po2); // exposition only -
Effects: Equivalent to: -if constexpr (is-derived-from-specialization-of<PO1, absolute_point_origin>() && - is-derived-from-specialization-of<PO2, absolute_point_origin>()) - return po1 == po2; -else if constexpr (is-derived-from-specialization-of<PO1, relative_point_origin>() && - is-derived-from-specialization-of<PO2, relative_point_origin>()) - return po1.absolute-point-origin == po2.absolute-point-origin; -else if constexpr (is-derived-from-specialization-of<PO1, relative_point_origin>()) - return po1.absolute-point-origin == po2; -else if constexpr (is-derived-from-specialization-of<PO2, relative_point_origin>()) - return po1 == po2.absolute-point-origin; -else - return false; -

5.7.2.5.2 Default [qty.def.pt.orig]

template<Reference R> -consteval PointOriginFor<get_quantity_spec(R{})> auto default_point_origin(R); -
Effects: Equivalent to: -if constexpr (requires { get_unit(R{}).point-origin; }) - return get_unit(R{}).point-origin; -else - return zeroth_point_origin<get_quantity_spec(R{})>; -

5.7.3 Interoperability [qty.pt.like]

template<typename T> -concept QuantityPointLike = - !QuantityPoint<T> && - qty-like-impl<T, quantity_point_like_traits> && // see [qty.like] - requires { - typename quantity_point<quantity_point_like_traits<T>::reference, - quantity_point_like_traits<T>::point_origin, - typename quantity_point_like_traits<T>::rep>; - }; -

5.7.4 Class template quantity_point [qty.pt.syn]

namespace mp_units { - -template<typename T> -concept QuantityPoint = (is-derived-from-specialization-of<T, quantity_point>()); - -template<typename QP, auto V> -concept QuantityPointOf = - QuantityPoint<QP> && (QuantitySpecOf<decltype(auto(QP::quantity_spec)), V> || - SameAbsolutePointOriginAs<decltype(auto(QP::absolute_point_origin)), V>); - -template<Reference auto R, - PointOriginFor<get_quantity_spec(R)> auto PO = default_point_origin(R), - RepresentationOf<get_quantity_spec(R)> Rep = double> -class quantity_point { -public: - // member types and values - static constexpr Reference auto reference = R; - static constexpr QuantitySpec auto quantity_spec = get_quantity_spec(reference); - static constexpr Dimension auto dimension = quantity_spec.dimension; - static constexpr Unit auto unit = get_unit(reference); - static constexpr PointOrigin auto absolute_point_origin = see below; - static constexpr PointOrigin auto point_origin = PO; - using rep = Rep; - using quantity_type = quantity<reference, Rep>; - - quantity_type quantity-from-origin; // exposition only - - // [qty.pt.static], static member functions - static constexpr quantity_point min() noexcept - requires see below; - static constexpr quantity_point max() noexcept - requires see below; - - // [qty.pt.cons], constructors and assignment - - quantity_point() = default; - quantity_point(const quantity_point&) = default; - quantity_point(quantity_point&&) = default; - ~quantity_point() = default; - - template<typename FwdQ, QuantityOf<quantity_spec> Q = std::remove_cvref_t<FwdQ>> - requires std::constructible_from<quantity_type, FwdQ> && - (point_origin == default_point_origin(R)) && - (implicitly_convertible(Q::quantity_spec, quantity_spec)) - constexpr explicit quantity_point(FwdQ&& q); - - template<typename FwdQ, QuantityOf<quantity_spec> Q = std::remove_cvref_t<FwdQ>> - requires std::constructible_from<quantity_type, FwdQ> - constexpr quantity_point(FwdQ&& q, decltype(PO)); - - template<typename FwdQ, PointOrigin PO2, - QuantityOf<PO2::quantity-spec> Q = std::remove_cvref_t<FwdQ>> - requires std::constructible_from<quantity_type, FwdQ> && SameAbsolutePointOriginAs<PO2, PO> - constexpr quantity_point(FwdQ&& q, PO2); - - template<QuantityPointOf<absolute_point_origin> QP> - requires std::constructible_from<quantity_type, typename QP::quantity_type> - constexpr explicit(!std::convertible_to<typename QP::quantity_type, quantity_type>) - quantity_point(const QP& qp); - - template<QuantityPointLike QP> - requires see below - constexpr explicit(see below) quantity_point(const QP& qp); - - quantity_point& operator=(const quantity_point&) = default; - quantity_point& operator=(quantity_point&&) = default; - - // [qty.pt.conv], conversions - - template<SameAbsolutePointOriginAs<absolute_point_origin> NewPO> - constexpr QuantityPointOf<(NewPO{})> auto point_for(NewPO new_origin) const; - - template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below - constexpr QuantityPointOf<quantity_spec> auto in(ToU) const; - - template<RepresentationOf<quantity_spec> ToRep> - requires see below - constexpr QuantityPointOf<quantity_spec> auto in() const; - - template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below - constexpr QuantityPointOf<quantity_spec> auto in(ToU) const; - - template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below - constexpr QuantityPointOf<quantity_spec> auto force_in(ToU) const; - - template<RepresentationOf<quantity_spec> ToRep> - requires see below - constexpr QuantityPointOf<quantity_spec> auto force_in() const; - - template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below - constexpr QuantityPointOf<quantity_spec> auto force_in(ToU) const; - - // [qty.pt.obs], quantity value observers - - template<PointOrigin PO2> - requires(PO2{} == point_origin) - constexpr quantity_type& quantity_ref_from(PO2) & noexcept; - template<PointOrigin PO2> - requires(PO2{} == point_origin) - constexpr const quantity_type& quantity_ref_from(PO2) const & noexcept; - template<PointOrigin PO2> - requires(PO2{} == point_origin) - void quantity_ref_from(PO2) const && = delete; - - template<PointOrigin PO2> - requires requires(const quantity_point qp) { qp - PO2{}; } - constexpr Quantity auto quantity_from(PO2) const; - - template<QuantityPointOf<absolute_point_origin> QP> - constexpr Quantity auto quantity_from(const QP&) const; - - constexpr Quantity auto quantity_from_zero() const; - - // [qty.pt.conv.ops], conversion operations - template<typename QP_, QuantityPointLike QP = std::remove_cvref_t<QP_>> - requires see below - constexpr explicit(see below) operator QP_() const & noexcept(see below); - template<typename QP_, QuantityPointLike QP = std::remove_cvref_t<QP_>> - requires see below - constexpr explicit(see below) operator QP_() && noexcept(see below); - - // [qty.pt.unary.ops], unary operations - - template<Mutable<quantity_point> QP> - friend constexpr decltype(auto) operator++(QP&& qp) - requires see below; - template<Mutable<quantity_point> QP> - friend constexpr decltype(auto) operator--(QP&& qp) - requires see below; - - constexpr quantity_point operator++(int) - requires see below; - constexpr quantity_point operator--(int) - requires see below; - - // [qty.pt.assign.ops], compound assignment operations - template<Mutable<quantity_point> QP, auto R2, typename Rep2> - requires see below - friend constexpr decltype(auto) operator+=(QP&& qp, const quantity<R2, Rep2>& q); - template<Mutable<quantity_point> QP, auto R2, typename Rep2> - requires see below - friend constexpr decltype(auto) operator-=(QP&& qp, const quantity<R2, Rep2>& q); - - // [qty.pt.arith.ops], arithmetic operations - - template<std::derived_from<quantity_point> QP, auto R2, typename Rep2> - friend constexpr QuantityPoint auto operator+(const QP& qp, const quantity<R2, Rep2>& q) - requires see below; - template<std::derived_from<quantity_point> QP, auto R2, typename Rep2> - friend constexpr QuantityPoint auto operator+(const quantity<R2, Rep2>& q, const QP& qp) - requires see below; - template<std::derived_from<quantity_point> QP, auto R2, typename Rep2> - friend constexpr QuantityPoint auto operator-(const QP& qp, const quantity<R2, Rep2>& q) - requires see below; - - template<std::derived_from<quantity_point> QP, QuantityPointOf<absolute_point_origin> QP2> - friend constexpr Quantity auto operator-(const QP& lhs, const QP2& rhs) - requires see below; - - template<std::derived_from<quantity_point> QP, PointOrigin PO2> - requires see below - friend constexpr Quantity auto operator-(const QP& qp, PO2 po); - template<std::derived_from<quantity_point> QP, PointOrigin PO2> - requires see below - friend constexpr Quantity auto operator-(PO2 po, const QP& qp); - - // [qty.pt.cmp], comparison - template<std::derived_from<quantity_point> QP, QuantityPointOf<absolute_point_origin> QP2> - requires see below - friend constexpr bool operator==(const QP& lhs, const QP2& rhs); - template<std::derived_from<quantity_point> QP, QuantityPointOf<absolute_point_origin> QP2> - requires see below - friend constexpr auto operator<=>(const QP& lhs, const QP2& rhs); -}; - -template<Quantity Q> -explicit quantity_point(Q q) - -> quantity_point<Q::reference, default_point_origin(Q::reference), typename Q::rep>; - -template<Quantity Q, PointOriginFor<Q::quantity_spec> PO> -quantity_point(Q, PO) -> quantity_point<Q::reference, PO{}, typename Q::rep>; - -template<QuantityPointLike QP, typename Traits = quantity_point_like_traits<QP>> -explicit(quantity_point_like_traits<QP>::explicit_import) quantity_point(QP) - -> quantity_point<Traits::reference, Traits::point_origin, typename Traits::rep>; - -} -
quantity_point<R, PO, Rep> is a structural type (N4971, [temp.param]) -if Rep is a structural type.
The member absolute_point_origin is equal to PO if -is-derived-from-specialization-of<decltype(PO), absolute_point_origin>() - -is true, and -to PO.quantity-point.absolute_point_origin otherwise.

5.7.5 Static member functions [qty.pt.static]

static constexpr quantity_point min() noexcept - requires see below; -static constexpr quantity_point max() noexcept - requires see below; -
Let F be one of min and max.
Returns: {quantity_type​::​F(), PO}.
Remarks: The expression in the requires-clause is equivalent to: -requires { quantity_type::F(); } -

5.7.6 Constructors [qty.pt.cons]

template<typename FwdQ, QuantityOf<quantity_spec> Q = std::remove_cvref_t<FwdQ>> - requires std::constructible_from<quantity_type, FwdQ> && - (point_origin == default_point_origin(R)) && - (implicitly_convertible(Q::quantity_spec, quantity_spec)) -constexpr explicit quantity_point(FwdQ&& q); - -template<typename FwdQ, QuantityOf<quantity_spec> Q = std::remove_cvref_t<FwdQ>> - requires std::constructible_from<quantity_type, FwdQ> -constexpr quantity_point(FwdQ&& q, decltype(PO)); -
Effects: Initializes quantity-from-origin with std​::​forward<FwdQ>(q).
template<typename FwdQ, PointOrigin PO2, - QuantityOf<PO2::quantity-spec> Q = std::remove_cvref_t<FwdQ>> - requires std::constructible_from<quantity_type, FwdQ> && SameAbsolutePointOriginAs<PO2, PO> -constexpr quantity_point(FwdQ&& q, PO2); -
Effects: Equivalent to: -quantity_point(quantity_point<Q::reference, PO2{}, typename Q::rep>{std::forward<FwdQ>(q), - PO2{}}) -
template<QuantityPointOf<absolute_point_origin> QP> - requires std::constructible_from<quantity_type, typename QP::quantity_type> -constexpr explicit(!std::convertible_to<typename QP::quantity_type, quantity_type>) - quantity_point(const QP& qp); -
Effects: If point_origin == QP​::​point_origin is true, -initializes quantity-from-origin with qp.quantity_ref_from(point_origin).
Otherwise, initializes quantity-from-origin with qp - point_origin.
template<QuantityPointLike QP> - requires see below -constexpr explicit(see below) quantity_point(const QP& qp); -
Let Traits be quantity_point_like_traits<QP>.
Effects: Initializes quantity-from-origin with -Traits::to_numerical_value(qp), get_unit(Traits::reference) -
Remarks: The expression in the requires-clause is equivalent to: -(Traits::point_origin == point_origin) && - std::convertible_to<quantity<Traits::reference, typename Traits::rep>, quantity_type> -
-The expression inside explicit is equivalent to: -Traits::explicit_import || - !std::convertible_to<quantity<Traits::reference, typename Traits::rep>, quantity_type> -

5.7.7 Conversions [qty.pt.conv]

template<SameAbsolutePointOriginAs<absolute_point_origin> NewPO> -constexpr QuantityPointOf<(NewPO{})> auto point_for(NewPO new_origin) const; -
Effects: Equivalent to: -if constexpr (std::is_same_v<NewPO, decltype(point_origin)>) - return *this; -else - return ::mp_units::quantity_point{*this - new_origin, new_origin}; -
template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below -constexpr QuantityPointOf<quantity_spec> auto in(ToU) const; - -template<RepresentationOf<quantity_spec> ToRep> - requires see below -constexpr QuantityPointOf<quantity_spec> auto in() const; - -template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below -constexpr QuantityPointOf<quantity_spec> auto in(ToU) const; - -template<UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below -constexpr QuantityPointOf<quantity_spec> auto force_in(ToU) const; - -template<RepresentationOf<quantity_spec> ToRep> - requires see below -constexpr QuantityPointOf<quantity_spec> auto force_in() const; - -template<RepresentationOf<quantity_spec> ToRep, - UnitCompatibleWith<unit, quantity_spec> ToU> - requires see below -constexpr QuantityPointOf<quantity_spec> auto force_in(ToU) const; -
Let converted-quantity-expr be an expression denoting -the function call to the corresponding member of quantity_ref_from(point_origin).
Effects: Equivalent to: -return ::mp_units::quantity_point{converted-quantity-expr, point_origin}; -
Remarks: The expression in the requires-clause is equivalent to: -requires { converted-quantity-expr; } -

5.7.8 Quantity value observers [qty.pt.obs]

template<PointOrigin PO2> - requires(PO2{} == point_origin) -constexpr quantity_type& quantity_ref_from(PO2) & noexcept; -template<PointOrigin PO2> - requires(PO2{} == point_origin) -constexpr const quantity_type& quantity_ref_from(PO2) const & noexcept; -
Returns: quantity-from-origin.
template<PointOrigin PO2> - requires requires(const quantity_point qp) { qp - PO2{}; } -constexpr Quantity auto quantity_from(PO2 rhs) const; - -template<QuantityPointOf<absolute_point_origin> QP> -constexpr Quantity auto quantity_from(const QP& rhs) const; -
Effects: Equivalent to: -return *this - rhs;
constexpr Quantity auto quantity_from_zero() const; -
Effects: Equivalent to: -if constexpr (requires { unit.point-origin; }) { - // can lose the input unit - const auto q = quantity_from(unit.point-origin); - if constexpr (requires { q.in(unit); }) - // restore the unit - return q.in(unit); - else - return q; -} else - return quantity_from(absolute_point_origin); -

5.7.9 Conversion operations [qty.pt.conv.ops]

template<typename QP_, QuantityPointLike QP = std::remove_cvref_t<QP_>> - requires see below -constexpr explicit(see below) operator QP_() const & noexcept(see below); -template<typename QP_, QuantityPointLike QP = std::remove_cvref_t<QP_>> - requires see below -constexpr explicit(see below) operator QP_() && noexcept(see below); -
Let Traits be quantity_point_like_traits<QP>.
Let result-expr be -Traits::from_numerical_value(std::move(quantity-from-origin).numerical-value) -
Returns: result-expr.
Remarks: The expression in the requires-clause is equivalent to: -(point_origin == Traits::point_origin) && - std::convertible_to<quantity_type, quantity<Traits::reference, typename Traits::rep>> -
-The expression inside explicit is equivalent to: -Traits::explicit_export || - !std::convertible_to<quantity_type, quantity<Traits::reference, typename Traits::rep>> -
-Let T be -std​::​is_nothrow_copy_constructible_v for the first signature, and -std​::​is_nothrow_move_constructible_v for the second signature.
The exception specification is equivalent to: -noexcept(result-expr) && T<rep> -

5.7.10 Unary operations [qty.pt.unary.ops]

In the following descriptions, -let @ be the operator.
template<Mutable<quantity_point> QP> -friend constexpr decltype(auto) operator++(QP&& qp) - requires see below; -template<Mutable<quantity_point> QP> -friend constexpr decltype(auto) operator--(QP&& qp) - requires see below; -
Effects: Equivalent to -@qp.quantity-from-origin.
Returns: std​::​forward<QP>(qp).
Remarks: The expression in the requires-clause is equivalent to: -requires { @qp.quantity-from-origin; } -
constexpr quantity_point operator++(int) - requires see below; -constexpr quantity_point operator--(int) - requires see below; -
Effects: Equivalent to: -return {quantity-from-origin@, PO};
Remarks: The expression in the requires-clause is equivalent to: -requires { quantity-from-origin@; } -

5.7.11 Compound assignment operations [qty.pt.assign.ops]

template<Mutable<quantity_point> QP, auto R2, typename Rep2> - requires see below -friend constexpr decltype(auto) operator+=(QP&& qp, const quantity<R2, Rep2>& q); -template<Mutable<quantity_point> QP, auto R2, typename Rep2> - requires see below -friend constexpr decltype(auto) operator-=(QP&& qp, const quantity<R2, Rep2>& q); -
Let @ be the operator.
Effects: Equivalent to -qp.quantity-from-origin @ q.
Returns: std​::​forward<QP>(qp).
Remarks: The expression in the requires-clause is equivalent to: -QuantityConvertibleTo<quantity<R2, Rep2>, quantity_type> && - requires { qp.quantity-from-origin @ q; } -

5.7.12 Arithmetic operations [qty.pt.arith.ops]

In the following descriptions, -let @ be the operator.
template<std::derived_from<quantity_point> QP, auto R2, typename Rep2> -friend constexpr QuantityPoint auto operator+(const QP& qp, const quantity<R2, Rep2>& q) - requires see below; -template<std::derived_from<quantity_point> QP, auto R2, typename Rep2> -friend constexpr QuantityPoint auto operator+(const quantity<R2, Rep2>& q, const QP& qp) - requires see below; -template<std::derived_from<quantity_point> QP, auto R2, typename Rep2> -friend constexpr QuantityPoint auto operator-(const QP& qp, const quantity<R2, Rep2>& q) - requires see below; -
Effects: Equivalent to: -if constexpr (is-specialization-of<PO, zeroth_point_origin>()) - return ::mp_units::quantity_point{qp.quantity_ref_from(PO) @ q}; -else - return ::mp_units::quantity_point{qp.quantity_ref_from(PO) @ q, PO}; -
Remarks: The expression in the requires-clause is equivalent to: -ReferenceOf<decltype(R2), PO.quantity-spec> && requires { - qp.quantity_ref_from(PO) @ q; -} -
template<std::derived_from<quantity_point> QP, QuantityPointOf<absolute_point_origin> QP2> -friend constexpr Quantity auto operator-(const QP& lhs, const QP2& rhs) - requires see below; -
Effects: Equivalent to: -return lhs.quantity_ref_from(point_origin) - rhs.quantity_ref_from(QP2::point_origin) + - (lhs.point_origin - rhs.point_origin); -
Remarks: The expression in the requires-clause is equivalent to: -requires { lhs.quantity_ref_from(point_origin) - rhs.quantity_ref_from(QP2::point_origin); } -
Recommended practice: The subtraction of two equal origins is not evaluated.
template<std::derived_from<quantity_point> QP, PointOrigin PO2> - requires see below -friend constexpr Quantity auto operator-(const QP& qp, PO2 po); -template<std::derived_from<quantity_point> QP, PointOrigin PO2> - requires see below -friend constexpr Quantity auto operator-(PO2 po, const QP& qp); -
Effects: For the first signature, -equivalent to: -if constexpr (point_origin == po) - return qp.quantity_ref_from(point_origin); -else if constexpr (is-derived-from-specialization-of<PO2, - ::mp_units::absolute_point_origin>()) { - return qp.quantity_ref_from(point_origin) + (qp.point_origin - qp.absolute_point_origin); -} else { - return qp.quantity_ref_from(point_origin) - - po.quantity-point.quantity_ref_from(po.quantity-point.point_origin) + - (qp.point_origin - po.quantity-point.point_origin); -} -
-For the second signature, -equivalent to: return -(qp - po);
Remarks: The expression in the requires-clause is equivalent to: -QuantityPointOf<quantity_point, PO2{}> && - ReferenceOf<decltype(auto(reference)), PO2::quantity-spec> -
Recommended practice: The subtraction of two equal origins is not evaluated.

5.7.13 Comparison [qty.pt.cmp]

template<std::derived_from<quantity_point> QP, QuantityPointOf<absolute_point_origin> QP2> - requires see below -friend constexpr bool operator==(const QP& lhs, const QP2& rhs); -template<std::derived_from<quantity_point> QP, QuantityPointOf<absolute_point_origin> QP2> - requires see below -friend constexpr auto operator<=>(const QP& lhs, const QP2& rhs); -
Let @ be the operator, and -let C be -std​::​equality_comparable_with if @ is ==, and -std​::​three_way_comparable_with if @ is <=>.
Effects: Equivalent to: -return lhs - lhs.absolute_point_origin @ rhs - rhs.absolute_point_origin; -
Remarks: The expression in the requires-clause is equivalent to: -C<quantity_type, typename QP2::quantity_type> -
Recommended practice: If the origins are equal, instead evaluate -lhs.quantity_ref_from(point_origin) @ rhs.quantity_ref_from(QP2::point_origin) -

5.7.14 Construction helper point [qty.point]

namespace mp_units { - -template<Reference R> -struct point_ { - template<typename FwdRep, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> - constexpr quantity_point<R{}, default_point_origin(R{}), Rep> operator()(FwdRep&& lhs) const; -}; - -} -
template<typename FwdRep, - RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>> -constexpr quantity_point<R{}, default_point_origin(R{}), Rep> operator()(FwdRep&& lhs) const; -
Effects: Equivalent to: -return quantity_point{quantity{std​::​forward<FwdRep>(lhs), R{}}};

5.7.15 Non-member conversions [qty.pt.non.mem.conv]

template<QuantityPoint ToQP, typename FwdFromQP, - QuantityPoint FromQP = std::remove_cvref_t<FwdFromQP>> - requires see below -constexpr QuantityPoint auto sudo-cast(FwdFromQP&& qp); -
Returns: TBD.
value_cast is an explicit cast that allows truncation.
template<Unit auto ToU, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires(convertible(QP::reference, ToU)) -constexpr QuantityPoint auto value_cast(FwdQP&& qp); -
Effects: Equivalent to: -return quantity_point{value_cast<ToU>(std::forward<FwdQP>(qp).quantity-from-origin), - QP::point_origin}; -
template<Representation ToRep, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires RepresentationOf<ToRep, QP::quantity_spec> && - std::constructible_from<ToRep, typename QP::rep> -constexpr quantity_point<QP::reference, QP::point_origin, ToRep> value_cast(FwdQP&& qp); -
Effects: Equivalent to: -return {value_cast<ToRep>(std::forward<FwdQP>(qp).quantity-from-origin), QP::point_origin}; -
template<Unit auto ToU, Representation ToRep, typename FwdQP, - QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires see below -constexpr QuantityPoint auto value_cast(FwdQP&& qp); -template<Representation ToRep, Unit auto ToU, typename FwdQP, - QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires see below -constexpr QuantityPoint auto value_cast(FwdQP&& qp); -
Effects: Equivalent to: -return quantity_point{value_cast<ToU, ToRep>(std::forward<FwdQP>(qp).quantity-from-origin), - QP::point_origin}; -
Remarks: The expression in the requires-clause is equivalent to: -(convertible(QP::reference, ToU)) && RepresentationOf<ToRep, QP::quantity_spec> && -std::constructible_from<ToRep, typename QP::rep> -
template<Quantity ToQ, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires(convertible(QP::reference, ToQ::unit)) && (ToQ::quantity_spec == QP::quantity_spec) && - std::constructible_from<typename ToQ::rep, typename QP::rep> -constexpr QuantityPoint auto value_cast(FwdQP&& qp); -
Effects: Equivalent to: -return quantity_point{value_cast<ToQ>(std::forward<FwdQP>(qp).quantity-from-origin), - QP::point_origin}; -
template<QuantityPoint ToQP, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires(convertible(QP::reference, ToQP::unit)) && - (ToQP::quantity_spec == QP::quantity_spec) && - (same-absolute-point-origins(ToQP::point_origin, QP::point_origin)) && - std::constructible_from<typename ToQP::rep, typename QP::rep> -constexpr QuantityPoint auto value_cast(FwdQP&& qp); -
Effects: Equivalent to: -return sudo-cast<ToQP>(std​::​forward<FwdQP>(qp));
quantity_cast is an explicit cast that allows converting to more specific quantities.
template<QuantitySpec auto ToQS, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>> - requires QuantitySpecCastableTo<QP::quantity_spec, ToQS> -constexpr QuantityPoint auto quantity_cast(FwdQP&& qp); -
Effects: Equivalent to: -return QP{quantity_cast<ToQS>(std::forward<FwdQP>(qp).quantity_from_origin), - QP::point_origin}; -

5.9 std​::​chrono interoperability [qty.chrono]

namespace mp_units { - -template<typename Period> -consteval auto time-unit-from-chrono-period() -{ - using namespace si; - - if constexpr (is_same_v<Period, std::chrono::nanoseconds::period>) - return nano<second>; - else if constexpr (is_same_v<Period, std::chrono::microseconds::period>) - return micro<second>; - else if constexpr (is_same_v<Period, std::chrono::milliseconds::period>) - return milli<second>; - else if constexpr (is_same_v<Period, std::chrono::seconds::period>) - return second; - else if constexpr (is_same_v<Period, std::chrono::minutes::period>) - return minute; - else if constexpr (is_same_v<Period, std::chrono::hours::period>) - return hour; - else if constexpr (is_same_v<Period, std::chrono::days::period>) - return day; - else if constexpr (is_same_v<Period, std::chrono::weeks::period>) - return mag<7> * day; - else - return mag_ratio<Period::num, Period::den> * second; -} - -template<typename Rep, typename Period> -struct quantity_like_traits<std::chrono::duration<Rep, Period>> { - static constexpr auto reference = time-unit-from-chrono-period<Period>(); - static constexpr bool explicit_import = false; - static constexpr bool explicit_export = false; - using rep = Rep; - using T = std::chrono::duration<Rep, Period>; - - static constexpr rep to_numerical_value(const T& q) noexcept( - std::is_nothrow_copy_constructible_v<rep>) - { - return q.count(); - } - - static constexpr T from_numerical_value(const rep& v) noexcept( - std::is_nothrow_copy_constructible_v<rep>) - { - return T(v); - } -}; - -template<typename Clock> -struct chrono_point_origin_ final : absolute_point_origin<isq::time> { - using clock = Clock; -}; - -template<typename Clock, typename Rep, typename Period> -struct quantity_point_like_traits< - std::chrono::time_point<Clock, std::chrono::duration<Rep, Period>>> { - static constexpr auto reference = time-unit-from-chrono-period<Period>(); - static constexpr auto point_origin = chrono_point_origin<Clock>; - static constexpr bool explicit_import = false; - static constexpr bool explicit_export = false; - using rep = Rep; - using T = std::chrono::time_point<Clock, std::chrono::duration<Rep, Period>>; - - static constexpr rep to_numerical_value(const T& tp) noexcept( - std::is_nothrow_copy_constructible_v<rep>) - { - return tp.time_since_epoch().count(); - } - - static constexpr T from_numerical_value(const rep& v) noexcept( - std::is_nothrow_copy_constructible_v<rep>) - { - return T(std::chrono::duration<Rep, Period>(v)); - } -}; - -} -
\ No newline at end of file diff --git a/HEAD/api_reference/gen/quantities.summary.html b/HEAD/api_reference/gen/quantities.summary.html deleted file mode 100644 index ea7dfcd7..00000000 --- a/HEAD/api_reference/gen/quantities.summary.html +++ /dev/null @@ -1,6 +0,0 @@ -[quantities.summary]

5 Quantities and units library [quantities]

5.1 Summary [quantities.summary]

This Clause describes components for dealing with quantities and units, -as summarized in Table 3.
Table 3: Quantities and units library summary [tab:quantities.summary]
Subclause
Module
Utilities
mp_units.core
Reference
Representation
Quantity
Quantity point
Systems
mp_units.systems
std​::​chrono interoperability
-
[Editor's note: -Following the SG16 recommendation at https://lists.isocpp.org/sg16/2024/10/4490.php, -the universal-character-names should be replaced by their UTF-8 code points. -]
\ No newline at end of file diff --git a/HEAD/api_reference/gen/refs.html b/HEAD/api_reference/gen/refs.html deleted file mode 100644 index 27d16e01..00000000 --- a/HEAD/api_reference/gen/refs.html +++ /dev/null @@ -1,9 +0,0 @@ -[refs]

2 References [refs]

The following documents are referred to in the text -in such a way that some or all of their content -constitutes requirements of this document.
For dated references, only the edition cited applies.
For undated references, -the latest edition of the referenced document -(including any amendments) applies.
  • IEC 60050-102:2007/AMD3:2021, -Amendment 3 — International Electrotechnical Vocabulary (IEV) — -Part 102: Mathematics — General concepts and linear algebra
  • IEC 60050-112:2010/AMD2:2020, -Amendment 2 — International Electrotechnical Vocabulary (IEV) — -Part 112: Quantities and units
  • ISO 80000 (all parts), Quantities and units
  • The C++ Standards Committee.
    N4971: Working Draft, Standard for Programming Language C++.
    Edited by Thomas Köppe.
    Available from: https://wg21.link/N4971
  • The C++ Standards Committee.
    P3094R5: std​::​basic_fixed_string.
    Edited by Mateusz Pusz.
  • The C++ Standards Committee.
    SD-8: Standard Library Compatibility.
    Edited by Bryce Lelbach.
    Available from: https://wg21.link/SD8
\ No newline at end of file diff --git a/HEAD/api_reference/gen/scope.html b/HEAD/api_reference/gen/scope.html deleted file mode 100644 index ccbdb5dc..00000000 --- a/HEAD/api_reference/gen/scope.html +++ /dev/null @@ -1 +0,0 @@ -[scope]

1 Scope [scope]

This document describes the contents of the mp-units library.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/spec.cats.html b/HEAD/api_reference/gen/spec.cats.html deleted file mode 100644 index b48b043e..00000000 --- a/HEAD/api_reference/gen/spec.cats.html +++ /dev/null @@ -1,4 +0,0 @@ -[spec.cats]

4 Specification [spec]

4.2 Categories [spec.cats]

Detailed specifications for each of the components in the library are in -[quantities][quantities], -as shown in Table 1.
Table 1: Library categories [tab:lib.cats]
Clause
Category
Quantities library
The quantities library ([quantities]) -describes components for dealing with quantities.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/spec.ext.html b/HEAD/api_reference/gen/spec.ext.html deleted file mode 100644 index 8d3d21bc..00000000 --- a/HEAD/api_reference/gen/spec.ext.html +++ /dev/null @@ -1,6 +0,0 @@ -[spec.ext]

4 Specification [spec]

4.1 External [spec.ext]

The specification of the mp-units library subsumes -N4971, [description], N4971, [requirements], N4971, [concepts.equality], and SD-8, -all assumingly amended for the context of this library.
[Note 1: 
This means that, non exhaustively, -
  • ​::​mp_units2 is a reserved namespace, and
  • std​::​vector<mp_units​::​type> -is a program-defined specialization and a library-defined specialization -from the point of view of the C++ standard library and the mp-units library, respectively.
— end note]
The mp-units library is not part of the C++ implementation.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/spec.html b/HEAD/api_reference/gen/spec.html deleted file mode 100644 index cdc7afff..00000000 --- a/HEAD/api_reference/gen/spec.html +++ /dev/null @@ -1,12 +0,0 @@ -[spec]

4 Specification [spec]

4.1 External [spec.ext]

The specification of the mp-units library subsumes -N4971, [description], N4971, [requirements], N4971, [concepts.equality], and SD-8, -all assumingly amended for the context of this library.
[Note 1: 
This means that, non exhaustively, -
  • ​::​mp_units2 is a reserved namespace, and
  • std​::​vector<mp_units​::​type> -is a program-defined specialization and a library-defined specialization -from the point of view of the C++ standard library and the mp-units library, respectively.
— end note]
The mp-units library is not part of the C++ implementation.

4.2 Categories [spec.cats]

Detailed specifications for each of the components in the library are in -[quantities][quantities], -as shown in Table 1.
Table 1: Library categories [tab:lib.cats]
Clause
Category
Quantities library
The quantities library ([quantities]) -describes components for dealing with quantities.

4.3 Modules [spec.mods]

The mp-units library provides the -mp-units modules, -shown in Table 2.
Table 2: mp-units modules [tab:modules]
mp_units
mp_units.core
mp_units.systems

4.4 Library-wide requirements [spec.reqs]

4.4.1 Reserved names [spec.res.names]

The mp-units library reserves macro names that start with -MP_UNITSdigit-sequence_.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/spec.mods.html b/HEAD/api_reference/gen/spec.mods.html deleted file mode 100644 index d6aba72c..00000000 --- a/HEAD/api_reference/gen/spec.mods.html +++ /dev/null @@ -1,3 +0,0 @@ -[spec.mods]

4 Specification [spec]

4.3 Modules [spec.mods]

The mp-units library provides the -mp-units modules, -shown in Table 2.
Table 2: mp-units modules [tab:modules]
mp_units
mp_units.core
mp_units.systems
\ No newline at end of file diff --git a/HEAD/api_reference/gen/spec.reqs.html b/HEAD/api_reference/gen/spec.reqs.html deleted file mode 100644 index 9d301f64..00000000 --- a/HEAD/api_reference/gen/spec.reqs.html +++ /dev/null @@ -1,2 +0,0 @@ -[spec.reqs]

4 Specification [spec]

4.4 Library-wide requirements [spec.reqs]

4.4.1 Reserved names [spec.res.names]

The mp-units library reserves macro names that start with -MP_UNITSdigit-sequence_.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/spec.res.names.html b/HEAD/api_reference/gen/spec.res.names.html deleted file mode 100644 index 56b3a378..00000000 --- a/HEAD/api_reference/gen/spec.res.names.html +++ /dev/null @@ -1,2 +0,0 @@ -[spec.res.names]

4 Specification [spec]

4.4 Library-wide requirements [spec.reqs]

4.4.1 Reserved names [spec.res.names]

The mp-units library reserves macro names that start with -MP_UNITSdigit-sequence_.
\ No newline at end of file diff --git a/HEAD/api_reference/gen/tab.html b/HEAD/api_reference/gen/tab.html deleted file mode 100644 index 430cedf8..00000000 --- a/HEAD/api_reference/gen/tab.html +++ /dev/null @@ -1 +0,0 @@ -14882: Tables

Tables [tab]

Table 1: Library categories [tab:lib.cats]
Clause
Category
Quantities library
Table 2: mp-units modules [tab:modules]
mp_units
mp_units.core
mp_units.systems
Table 3: Quantities and units library summary [tab:quantities.summary]
Subclause
Module
Utilities
mp_units.core
Reference
Representation
Quantity
Quantity point
Systems
mp_units.systems
std​::​chrono interoperability
\ No newline at end of file diff --git a/HEAD/api_reference/gen/tab:lib.cats.html b/HEAD/api_reference/gen/tab:lib.cats.html deleted file mode 100644 index 8b6ee1e8..00000000 --- a/HEAD/api_reference/gen/tab:lib.cats.html +++ /dev/null @@ -1 +0,0 @@ -[tab:lib.cats]

4 Specification [spec]

4.2 Categories [spec.cats]

Table 1: Library categories [tab:lib.cats]
Clause
Category
Quantities library
\ No newline at end of file diff --git a/HEAD/api_reference/gen/tab:modules.html b/HEAD/api_reference/gen/tab:modules.html deleted file mode 100644 index cf97475b..00000000 --- a/HEAD/api_reference/gen/tab:modules.html +++ /dev/null @@ -1 +0,0 @@ -[tab:modules]

4 Specification [spec]

4.3 Modules [spec.mods]

Table 2: mp-units modules [tab:modules]
mp_units
mp_units.core
mp_units.systems
\ No newline at end of file diff --git a/HEAD/api_reference/gen/tab:quantities.summary.html b/HEAD/api_reference/gen/tab:quantities.summary.html deleted file mode 100644 index 00a3b0ed..00000000 --- a/HEAD/api_reference/gen/tab:quantities.summary.html +++ /dev/null @@ -1 +0,0 @@ -[tab:quantities.summary]

5 Quantities and units library [quantities]

5.1 Summary [quantities.summary]

Table 3: Quantities and units library summary [tab:quantities.summary]
Subclause
Module
Utilities
mp_units.core
Reference
Representation
Quantity
Quantity point
Systems
mp_units.systems
std​::​chrono interoperability
\ No newline at end of file diff --git a/HEAD/api_reference/index.html b/HEAD/api_reference/index.html index 386ae95a..2e630abb 100644 --- a/HEAD/api_reference/index.html +++ b/HEAD/api_reference/index.html @@ -25,7 +25,7 @@ - + @@ -33,7 +33,7 @@ - + @@ -2522,10 +2522,10 @@ iFrameResize({ - + - + diff --git a/HEAD/appendix/glossary/index.html b/HEAD/appendix/glossary/index.html index cb0ce310..3faaec35 100644 --- a/HEAD/appendix/glossary/index.html +++ b/HEAD/appendix/glossary/index.html @@ -25,7 +25,7 @@ - + @@ -33,7 +33,7 @@ - + @@ -3021,10 +3021,10 @@ vector, or tensor character.

- + - + diff --git a/HEAD/appendix/references/index.html b/HEAD/appendix/references/index.html index 50837d0a..90baffbc 100644 --- a/HEAD/appendix/references/index.html +++ b/HEAD/appendix/references/index.html @@ -25,7 +25,7 @@ - + @@ -33,7 +33,7 @@ - + @@ -2482,10 +2482,10 @@ International Bureau of Weights and Measures (20 May 2019), ISBN 978-92-822-2272 - + - + diff --git a/HEAD/assets/images/social/blog/posts/introducing-absolute-quantities.png b/HEAD/assets/images/social/blog/posts/introducing-absolute-quantities.png new file mode 100644 index 0000000000000000000000000000000000000000..3361f87b87ece411b817f624139254756e16869e GIT binary patch literal 39574 zcmeAS@N?(olHy`uVBq!ia0y~yVA;UHz*NS;#=yYf?@%4Xz%VP;)5S5QV$Pepr4=FR z_l|w6HY!y1a+)BZvSWAfoTSqGd3VcSM^As7SG)V}uAJLzbMIq z&;K?r)fZ4qFH$Q``}8+P{Q6bDXO-vjjf&3QsXVgm^!;KE1~Ay5Azv;IW-%~aX<^`o zFsHdSutHeg$_JRhtcIn635;OYflC}4zzl|jOqK`;Yl8`s4ulmU#V7`0>GX~oH-f_M zb7?sweJm)O<=Xn9%W-X~s16PiGb1{PNRxnRj}S&XO;Wu zjI&i4G7m#_dGf@UNAmXu_fNa{PLEa30g~7oShsd?UNtZ84N3A@vD^EjMCbqCbGJSy ze^v@j?;9lKXZx=Iw{d@zDPM89rrh$-#|C?U9sl({Qm@AOzpkBB&doWh`^aNztpcJ=7;FH=>XicZ%uUcckg{xyGu z%BP2|ZC_Rr+%W&{-P8qru&`<9{4D1fv)9hL{d%VWbJdofYp%7?yLR(j z5rh^Cd16oUuQQ9u*FHTdH{*`4@akl>5Ah&FbIkWq};b@-|}kzdYQSWA<{jeSg5}V~LYgcK7>U=l8$X`+Q4r zaVp5pfa-dQOKxw4mF~nI%k1(#9U5|U|D{h|TJPf@22A~~ucbTvaNzl);frgXTK*X< z>D_(0VRDDu!;OcU|6Em4+j8k`Y*dI`nY7f4<#+hktt;7mU;f|XO<8sgAZH!8dZ_tN z$$ggW-hEo@3tk+m|GP-my)XRN&5L&)Y299Pw>%_P{>QpYZyD>#eD~M)2(A9{?it^A z-xrI{PkR&Qm$-7bccUXq#D|FE++JJ025hr3>9u(KE!Fz+-CzNb%Oy(AZb;eM$6a17 zIrWX_`K#xy%!#_cf5VbJr+(kA&C$}_d~QMGwZezH(jqp+&E0wP?$QGa%LEQBj{WdS zKWd9^=+dX6UgtHhOuoPF;_~kDox8#L#bR|wLjB$1y!7(vfvWNH#bLWYZT@{CZDZ@^ zcb3~XD>ePS8_UL%#3E*MYun+QQopY7lurlwl%ege#iF^X%dVNKbQ&()Rp?^9*P?du zZtq6M9!PRrFweD}?ZvsmYcjQ01@2g`+q}q``A#ewPXbGr=&Gm>)fcyg@YZIvIWhk& zIlbcBt_}I#rCDMtCosgPJ`>A6*=MrXsCe_Ue9KSOvv;^T?#ixF_kD5EDfiK#r|(}c zJ{-vk^3VD+ch=l5OAoOsTQEPiRX(=(RxT)8aO$54`)}4;`hDkI(=D}ok`6P6Mg%Qe z+rH`R-&G=e4Xe9fc3&vXlUvz)KEB{qZhN2Tikq_Y!z=$k_4f_iZ?SwXP_4>ehK8Px7x%ZN8NebYAS$MWd*~ z-lmlA8(&s9c9t!BmhtbJ@~@1Cez~?&V&58qqWgi*_MTS@mIWRJl>=$HG8q$jIkYpS zMAt;Sm0q}PzoxicbA>9?ny4;beo%(2E&sm4%h@LRFmq|#dzZP_tpoY%_642yzrEmd zmHMm4x7##zF1+9J+pM4OqG)r}>rIVoORgV3{q@!w-E`YBr<4tH*8AK4RRx~E{EV-i z?bk~G*AZVcWmn&JFTc|If7WWz-CFHQVPe8!EB38T{`&T=@>LzJCtKzpb!Ykeuevtv zRh8|hr>m;g=DI9rsV#YZ!K>6WC?uod*VfL^{bn0~oj$Uzs{UWu-Jc(eL`9}w&F%&H z&&EGyvBF)$Ws7&8ULnrc9;&SKvd>WV>%H~2rqflijC}8(*&Mt~zx+?k|rosGN?mbswuVu6g%@Y<@xQzx;cQjG zoL{!z7Hl~0vH_W?zyd$E2j0IUFM%B9rjfI#r-*(L;uHa z+I{J5Y_!YEwXfO2-km-k_H+S*c1J(QrMJmeFFvlnzGJt@6(+_o-By+#S}G6z*T+5; z<-581#?*spljrT+@;!6=)sp+{%S*0S>Yp_Y@h<&q%JuDfwK?y_3H$xbugteL?X;*p zkyG05JL#X%%GD1UUeCV&E$iw$o}a&Ol|Jq$n_Bnp+MTtlR#K=g}-#@pb0wWEX6Vojtc~ zzhUgGljq+pzVvC9``abYMP8ljpO$@V*56b5dcp0>1gn1X|JC|xz9V){+m`<8i*i?% z)*tw)qP*Orylzj7{hC|L7hNjank}?2{Qr&k#k);x-_|itmR=pWVSk_alqF&}8IyYJ`G-${D5B(px z!TIOW)FO)|yubTjwv~&ASKe3O7rA(OeZ=xLf08^ez1t!a`}djC+@JIKK5bu}`sU_# z-@QNLKYuy8$@bL$`vT|Iwr?_hx^(BQGK<}pYW1ZroVvkWytz1j#?tfC--RW5?v&xn zy!|jI_TR1bQ=M$(XZxP?mD;&yURdv8t-EHmZyUXWng4(Nyv$4f-r2>@HosCp?TG`W zQAb){Ez|n9f$#gSOqbnW%@PT=JqL^yteX4b+WYe%o{_D8YW>eM?f;t_zx4OA=OV8j zY^*Wux2ye^Uy`w)Ol$eEBeDmLwl*cRR1 z_xJyXOQ1OWaasJ+#<~A?+e$`(8h!^>zLUHEbIoh5#s6H}SYEvQIJfk>`sur|Tv-kc zq3(R`ArV1p_4hA}E9&d4tTNx#q?Px5>vb8ut10)Momv>RTdg-`^ULoS;~ML}WnG_Y zwQ|j@#0BfZE*Gx;6Z>;V-Gv8lc-g1M$CTZgl`cEmE#v#?=^4LnG5<=voVfPR}o|=a@%#U5j zSeLirn03lC(bwPp>#QxQZkQh{{w;T<`FiOUQ|sq1I#a&>Qh0gag(-2JQ{56lRpWt` z@8(``edsvvzwO&IrY-)TzTCZWxcN`X`xd=-dd#K?EYsSxHCInKT$nVyBbfEa&8g8L zujVbU=4?d7cP;$fDuLJSNH4u`L;^Hh$t z1+`2Jj&40XY4x4l3)0t^_EmXE@3ku4yiMNn-MgRwRwf;O@dxSaMdCcwuN}8K`F$1t ztBp$U4Rg=doxN2MFr6=B>1nntmn>z4MV{oZ|Fm!JEZ3}ukA+P?y_~-#C%wux9Moq$ zaO&OsE1?S;=h^@Anq+0(AM*U!#CLj!RYA4(|0U~oJ-qAsPLDNI;lQT?-PIDZArV36 zUT9CAG9~oIWY^taPA-c5^!;n#{IHEuGwwu8u2v0;(y>2rf8F)@D_1qO zG*@4kB%2wvN!eH5@BWIyyR$NH)h>RT{r~@c&+|(%j<&IDDKB5K&zqfrfg!<>-{;k; z2MxFCzuHZUUt@Uw-UlfQTKpOF38_u^LEFH4;vx23k`wgK;|q*sq; zHZj+HJ+Nfmu3u|epNTbCDIfSGz&!b})>{jS2kF=6KDG+o_5P2pyN_jBTHI3sH8q_8 z*;#HGuNS_#oR=>qx=2q<&MoS0yuK4tP3fKo|NVJH`P$?5Y+A3>^uIp*4zVW-` zpQis2O?dXJIcl$Y@ZVcU=9N{KXh53UE31>X=)Ihuvck90wY6;d(|O-)kMcZpted*; za>T`diz`F(!otE?k4`P$x&GYIzmvb5pKq2K>$U7<>4D07wsVek*HnM^h&A5w_Wka# zE!mem?C%(Ry%ko{y8C^ukSoLm`-PAHEpS(*eF5P+m ziL0GY?zH*NDp0*T@5RBBv7!&czgq1w{kZmMi232#TW5d%+OMY?JYV-_?92OedfREziS`9hKc&3XQ?_7UsWAH-HKiNz|97UY_*Z;7U~0IST}##tIJkl+U4mxc8mPs zSKeR~Q2Oxd#XCxOe;pJG?*IB{%hyxup9Y-1b?fL2Ct8zB)wM@_MJsjoF%l6+kf4ACR3-|WTTv=DYzu|2+dC)0esE~-BFc9G)S$5$+DJX%## zZxv}o$FIM!+WdKr=@yN-f}l3~x%!`B<-PCM7{<<875doV=dIcjmE8{9+n2ridNX=U zPWrBSJGX52?#rKc=@Zx7--mMU7Wi#iCw0dyHrhqg;GZ(DWi@ACC` z*KhkSb8TvKR5qw#Jx^lov4@SHzHilDzQJYp<)W<>)vNYJY;!+dwruyyKv2kS5Ssn= zNYw6iQKvb-9>4x>ar^R;%S-CdtSfZjeAVtdegE;x35tz%WukQ@zDsX6|NF79%j@*( z{R*HI>#&yh{SB95dAazvm-N#o&kJ7B_q}%YnLSCtue-Q-FH95H4~bd4!0PMg1JAX; z9@@e?HBbJIo?rL884=6(sb;fi;$FoD8vmAbVN?S(i>zVVj_CM`- zX?jpXDG_81gU^HH%`YEn-krm@-o~-iT4mnO?A_Zp{GLo{EQCdYwFee3{+aB<rL0L-F^hw?~St^FJp}4d1{udAC6;xJ%k#C3Su6%(iX)<>ivgJ{o39ExCJKP5;CflP$G- zj+JIVduJpC8!>$K;7MNTJ%KB8Qm#3FoEFcy+k2P%{z|ZKUnK;ce(zXi1Kgu!m{S7Dc-QWx&RDnQ&YYvCyiaRC`LL+;{O>J&SAW(VD8=H%ktkzEnLOsXZz==*5Bk`$Go(f@d z&h`zxcmMpm$DzB8=Y2V_WE~e@f=@s#Y}jXkHruwa+^ z+`5};q5&N{lMs-4vHZ7sSz)$PM;{grgqXUv$){eJER*Iv;0fLk+kV9h}{ z*4!p?tyKHY-8|bfMV_qx(Xqhmf6`&*yRoyPw`9pId)=nKdv_08qv~f+He^`QdSU{@ zUDI`wcb_g;U48EDn%i#WD@t~+-}|tye`j`#dhL#c<(ocr-;M1G&)%`#031dZ#mw@xt*`!8 z#w=&E?%lKx8fgV$+xuQEXgQHkKAo}KtApp-+QnM_Yg;OzVY0%p#wB3tYdgl}yK+m| zkGiw$+|9Gz6*7S6!23?(a$sREhg!g9(C9?6k9+y_hg)Gf-7c?4xO?b|!Iew8i>+2< ziUj+{HbO?o8?ydn=BT^2v+dZ;Q_=C_0>j@*o$kN8nV{hu>e0b-ZR_D%yLR(b%*bxr zntHHaTmd?q!Zo>STfpOjYx|lEdk;68tW4)FpZ*XwV7cPZj=ZyXVwr5N+*r4#>=ZApU=nuCHrD3*o^e4zFTeM&A`w4Tg(}w-)cY8OqKiZmX2k8_sFu=$6 zLp3xsi$SLBDLdm14FJ)g&DRsLsRx`v4fCs!v+u^Xg+p`10;%>s(HC!bM&FHPvpI6Rc>AjhhHmjY zVS#K~QTt77scgEg&J~@v6$|6$?>%}qwL%wabJm1eu`A4(zpP$WH>vdM`MTsa>$GJyqcSgTXP0Wkm?ORv&dH<^E(?VBl*>mVi z-PtDv9b^^-r{lB^@ zF>`01_>>v<*3aznIz4r2eqFEGY>^j_7+znUIeY5F;3t=oO-i8JuN>O_d0Y1Xi#F5c zln53@Q>n*C8cAldX^kZ)O%U}b6tt->CMkP6x*FaBX8cn^2B5x zZ8F^uH*4d?Pubm-+|a=0`B8CE@2y4Aoz%bE{WG3Ss=M4Lp7n0oVZE2T*KLzKckR?& zNxhfWmiJ8epOaMiq71hCcX-qlNuc7>)u^^mOXZ}M%C>f1*UxbMV|LRo5^3i zBzrB2`?W_|qg~97%c`}vbArw<$+-OcZjFKWeBHabRr^=SL316OsL1q}KQpCcE|rI5 zG+3GUmw4V!eJWb@YIo_X0*jbS`;FsfY;%;fbk%#g+tX#kEp?X}_uhZLY_?*-jx%5C z0&SrIFz3V9PkW=LPkK3NUwdgsx##{#CfSD_YquSdTHHSEz1Q{I#oKqT`G0S1l1Snw zzLwWPMqj^v+Pmyq=Vn+KaJnviTJ_HTde0%Lt2b6uynxQ7?kzSqC_Yf7@7wcCXKv5R+`m~K5kb+_@Czo%-Kee1lX2r1AGc&es~ zR((7Eb=i06C;8Wx%+vLG|2@RJY{|=6+r?IGSW@RMY$)6WD zGd(|CvD;i{_XM>T9OB_U%n<&aPnN;^l$!?*5BP4e|vxQPXF+IA6NH@PucOs zLS1zFwAa`8r@h!3868u%Mw@->w3(X?roZ#Jyv3CL%xi%*xH+H*Nqbc_bMMCZ^GhVY zX3J*hEf4)sm)dpA-rhT!KXvyPi}uZ2B?nLMe=#>cW_!kO&yRwRvo2X*-11L`@8!&u zuS3Jmz0fX)dT~Kt+B*9ct+#`G-(G%~eEF>M?b)}|OQ*f{xxQil*$cZrZ`-M|->k?Le9q2U)b_5K?a(DN<-ovf<}FVTTdR|aPIx& z72EV;&ioCLv~=C|bFZq@-#0#IZxvjaa(t7XYH;}etqzm_8@gKuzfQk?_=1D|U87Tb z9;`o9_-Lo@dV|UiS)PxuNxX{Ycr)2+`m_0F@A@2@v0(l?sr!-J|EI6atetoEkFL8( z{b@noJn`lBJei9(#?IC>RNHdxZT~Z|%!k`T{+55t`@83#!(M%%`lk!7WeKOpy(s@w z*;)-vDhW+o?at?YV%H1K6-xPTnE&;|>h>)cvo~+cxcxBa@~<_$M{i%=Qc*oiiuL#E z>ZB>Zw)KTRe-@Y}D7)yy1csl#f2~+^XyKegLbB(yE?jfI8MX8Gim>;#tCVlDevNwV z+1vED^#2jPWnaVN3LjaTR;S4Jz>>HM_cpnUXTGwVE_5%x{ELV8%VlBlZx^1f|C<#x z-%Une<6_g=l~EhM{=fcX)9)Kkk~g1JjLb^>Y~TNO$u+gUeW3D3EXOt}s=h!j8`8c@ z5DI@AR$jPYrT1mly(>p{X{|2+mGD6iLyIQ6?Min_zx=EC>bpq=e9)*;i`u2^d->Xo z-M8o6J-%%Ex;M)=IM@gO{wii?Hal+Ds`W}ue|=vU-?>&u(|*S@d$OQ98U!^yCB=PrEL z{yy{G`}xPqOiF8Y^Dk_5oicCtp8l1!b^D9vhrK&zu+{$xFVtyzAMW%^hr~qXWzFAL zCcn4%Z^G6rnY66^^R&R7>BiPk+7BFYWW1{~5IPae(#O(v(-LpH}<6-<}z= z!ERq}L~}g<>37MOZ(rvJ6?wtG|7QJ+TkCz&WUK!bS(sg){%qmZ($F*Bd*AV7Vb$|C z$4^_$@2vlNKIT^RbiRz#tof`*Q>*Hv7O!8k;^Dqa;3i?g#=}tM~Hvr^dBk zKgs_(nO5xiecHDNPx5}9Ub1f4_uoG^+1{!#IQ^wAupAn2J1%rzHq%(Y;)-hReZyso z{}rYl=Gypf{tegjao28tsr%gJ^;K!{dYx`aD~v(>R^5{wc5z!yr~bWPoR_}$+i^zT zB&&yy#lKwO4*yc>d0$@t*3!4`eY=3GrK)?Uv{X8ry$0`F5M8 z%?WGqGX4*nU-xFSzgjQ;wZ!wkW$V(a%wulTzwj3S*tMI1VZxHYxxyyTAAW4RrE_!Q zvV;D9<$z3VT;AU^h9dF(JMk4a((W;-%ef3_;KTF_JWLR*omF35)*}L7c-W`5i z`t!iGEJ0zd-RC=}x-WKSHd$5NbZ=kX1hc&bji5$n@m2-~hG#eGP5j@VyZ!FdW0PL4 zYv$#>SG2>wmuE&i^Ga;2tNOO--mJ3w64TqlCw+Oh=k2X}lk-cDJKO~o9;%ok zKRs@I`M?v4v(;Z>Y%O-q{!<$(9W8TK_tI)(^W9%04A_G?RzEybWi#o@)5iB(UOG(U z)?#9KU-0)snbcLwh1b6K^Kf3UHs`r?VtIX8VkpR_#|2@H_h#)5?Vo#paa`Z^jhQWV zJIbf*`eJWcXr!1=gD4mbo}?N%JNxs@%C2*VUBxcxJyBu zQir{uKE&Z%w-T>_-z^-UyBQf63YyK+@ywk7RsWYMzM3ZyyZ*S{ z?6g3|s!xaJMg9D)x$F6zb6>^cmZpin>b)8L`f0=pYqtbOhF87?4eNKQx>;V`RzEu; z*LqHFo+ASTL*9h4Jpt>_-&?dl{?h8Weo)<7dU$f_(FNCL?MvH#?{{hYvwYh}+kA_w zRFA&scfS2<6XRMDX}O5^$LqoE;`R3x1kZs=(krt&66%-Vc5AJA#C4^x-zK?d>vC_@`z(Dbs%Kj^dq+X<+iO1J z-@Pv#cyjF1=H2N@Hx?$dR#odQUT?$6DCSds|A=1I$F6;Cw`{(B&HDTIcj-D!j)v5f zr{bp{PRKEPoNN5K>#RNp1H%Ddqt9JmPo43tI{2VmeRFB1+)BN(%3n`Z-re#uVVhWv z?IPCb;H`S9!R-A{S1&p9)8X{-wBQ<-309`vS00oVS}ji&1`PsUaIhDaZ!C_RxwG@N zH@|ZOE5i!&R@JAsHvFFve3@hVTc2`AR|W=#cc0%^-Y)$;qtB~{v$S0E)7IZBqLZfV zQgwTI{;`$j{vAG=?w_|jK2iAAq9~^NQgNxpYKNJXM^EYM1QtfNp3;{2w9)h5zB15c zpOK1#uTs+$BQu}e$A_=#Eu1(h>9CIZB)g{>^Zwc9@7{g7!I33`p`q&Qu{pX`-`fth z-8yr#!o#{xraTbrkcqJYi|YSv@mwEs_x|0bAwohAR`>ZTU)h-HvUL8`aEp+zxP@K+ zd)Ivby7A<7-(beMAJ5M>)7-t_$lcTf3g;_Z85#B*`n~_%g*CkF*|q-{?{wYuwRx%D z8c=}N+Qn>e-hH{~PHdZEnfz>~KX14`ZP&hV{$1e1tM9hR)b2=V-+j74*yedC8^Z@K zQNDJ)il5@OJ9ExQzTf@#L?Lf=R@?E|D~t>bS3rvv{uw4O1`Q^F=prufyRmF@K;r=` z%2|)5?s~H|-t)cwJ+rIg3Y}@tQWfsx%b#6Ui_16?1-Fx$v&3w(T1&*-juK9P}Cs%L1uw^-@IS_ zXj9SBH1Vw03v>SdzMlK5F4b#pzvzSX>kFP(@cQJf(L1~Nij|%Z=fs0u9DD%_=Ew3` zhJ*yITfEcNYEtZqxhs!vt^04Ndvo5h`(^1X_8dw)q`Xdgw(qOk-~sB;``0#tX1RTp znnZ;P9z9mwz9NL(`19763DZDXYUS#0pl;3V)p-?GCcPIfeEaxnrpVedU!^G$!mD0v zU|{`uGxht&K+njXo4CEE%!*yHS8`|6^hqn1T3_0l;y#N@>W9-zo%qeYis^9Rh)sL`)6WkSJ<0V z0sGB1zSBFZ{b!rCv;CS?zst>c%=ewX|M|cC17aqtikqI<*xW1Ft;b)p+;?kCMSj6< z3*D-uq_w}#ozf4x(mOwF*WI+qY9;v#cb|W|q}WRBMB3`o>7bdQa_#RgU&>#*x+~8U zG_t<8!u9?w`4xTJnPZljvYh2^fuFVStD8;-8P7dE5&84zue{W*d;d#!PkZZA zzN&v02k#e9 z?q8}eUt7CNy!!q3r!{DW8_!nD(Enz=Ti>koY`b;lRzbkyd9$B>F+6|8L@UC)H)H*3 zw(Wtdk8Q2*^9v1#SvLQg?1kT-%R%8;G^60yj2nwvm)*6$6)=0{>fn-l-o@vu?EU}6 ztnDuIm3q0aGq&XCfouEQk8j=jHDFuZtc`*4dUqYpT~NtutCTFDW@Q)%|~e!NI<^=C#4x`|2CR za!+f``7H}tx8fgnBlxb+;yGFMt4>T{h_$zg1g+rOH1}oIm(^EiZU0#?_xIXfZMLn~ zyu-hNO8SS}?968Cy|^3{T&4Od-ah}5a{Ssfi}fcTDK~w&;<~rw?1pWhHeb(OR#DKf z9#mm<|5DAo+^A#w<*1f#{Om*3j}jNels~6QGVcV>H(ECjZYI7 zIWyP)fB##p?Bc2Y{$;}r~=~b5e{nx*L?=e!{V|BS_1P?;6JZ-&9TWYl}+FNyZGzhyui4x zb1Gjwe|6#8$6J3MweG4+sa}3~buefoI=_DYBJW@7o|9&|g4$jW^dP-ptMcg&KhB%E z%P;jQZ*qg1vqQtv#H2%hJz^FAmnniO?oXyaxk2X5`Z(RNZP}yBRVywq{Jd5B z){(4_lZ8d)13z!^y`p1s!T-21|Rqhqu`flgvE6cZ*uQ~mobN=dZ z{>;Vka+2#?Jc{p|H`bNaeq1iND=i}$)Hr&Ow)vWT(yM4$pV+yJB46|G+|4tigW>ey zBQ3124oA1W+V$|Hp7pT>Pj*zr-ai$)$cgF8i^{vEiza_eSh;1I=D&EgQqcO)lF9`I zAYYyRaasb@^2w}iWBrx+&G|7ed+pY%W_B_8apo6PYt2~#7c$QJexf4w#`e^`vYS0! zHi+4n9bEan|7yjp=dVniZ-eZdDYs>A%4X01`wBN4D>Jp{U}s?18vd~0#d&$%>+`ic+@;3YMRhyT^r6tpsRlQ%P*d{i$ylwqmcim*?*lGa= zhJvu){m))5s{gxa%Hqm*dPkF&{CQtqreJ*k?$QG(ED>_c_H7H=dUMJC_&clP`kv}J z-#%__+w?Gp+bG_4N$%E$E9O`qE4lI{PWOx^$1;%P@}!r=d9IU` z43}19-1qCJF#6) zLG`BL`Eyrp)y{-0>21yGeR(ScyqvR5^{NTe>g;Zfz14>wRIOQ7Wj6cE#kGe)GaJEg zXS=t*kmP15TybmeW2={Y?rptab09S8Slg@k@bBg2l5z|6=C96=GY{DKurYnVG6Ta0 ztK0oD*Ka&edv)-9_^StoZenv^KG;}e`{SoqZ{@di&>-a9rw3d)HUunQ%{F^?!uIVe z@_2RZclX=vt=+Ly>>xkqhpWrC^A=}aId)(F<=TK{-y(xnA4{xy7WCaGaP6t9&bKlW zjBeXpZ!@01`tdH)%`Op~3=DUcFWBL8-v9Oj#(w|H%=6b@>57#+rK=U{9P{kt!wE&* zUR#sG+vI-KEM>E?^989pG^wb3I-B^X(sITX((TT(wmw|2Y`yJ*ubMNhW<~4FetV>^ z@T9L4sFIp{-8%3f<2l=_ldDx#ii<-Y3fEh*Kr_|ipB zC~6w1IGp_WQ0k(lqxhHHl>+zr85k;BnvZ`1&C6CL-eN1C&U8h4U6}2Su2{)kFZUk3 zwc&rnRQvcnw!ZRb?k@zbT=@U&;H(>me^|N2&T`kXG6A*pm*1^3+3w+9+`THNSY`Kt z4~3Wd#Ir6p>KuN1XX%zM(+!K9n7^E;ygT<*{^LfS*uT%1)_SkB39rs~TL&8W0}XzG zR!A0n7EnDV5g+sOWOvo8$F9~>gCn9=|NdVYqyE!kXV91J``=#HeXqarlj)|U@HV^H zJ>K8zb~&AozZiafcfoV>{HyDI*DU*DWGAJry+5M9CVSzswKwBmrvEnjv?VFL4HSpZ zzk6Q!ZO&`BXWi8odg{xLgZhU%%vKjXf1Xu(tSoogyUugEQ{qFS)>YfbF5Lb+Z*`IQ zyrtHczC1iM_t$6l(_dcvyj%Kx=iIq<_d(OH>s%V1E(As4_5Hh7+*+Bl9JG#@_5UB& z{WeDTRtnnejXIj~tLM z30mT;dy;+JO}W0A*PPiooA33W>CZIw?|8H3``qn6H~g~uwK&bzyO4~G5vY7tE!`T_olsO+1>B{RNRbgH%fmd`ns)LJo9Fs$=}~@*Wa&t=KF5;g`)+t z*ZfK1{rQ?F*RJB*f*-%9YJ!@WpXIH?4HJ)Di`i8akZt>|^sT#iWM`;-_wWG2zrLX1ee?3(lByDU1_p))T5B4gHm2oTtjN9}8L?VFQhn;Q z@E6a%Pq!%D)3#wkb?f1U=Ff9NS6lDD^gw<2>xuf|FE1b6ZBl+YQTOh|Wv;h_zFywN z{Hx@np6&O?Rl4`5)Sc)|>W_w!O@AU;1B^USCtqiRwT?J|=%HNMl z_))>Yz|gQ-FrjkBV^-B&&)&9btxw}!HY>+=%G#yYJ^6cYUFv+9HBZHOeZ=Aa-zMk% zKOeMI=4|n*{*QNOYuYKDDA@h_UgVNHi*EV8w7&Xq4HIaQ@8P$zTw60jo-a$^d;dw? zvE{Cy&|3CgEZoxfWzM|+h0PE3Z}DDT`ZroKZbJRLWrt_&vO4-am5BS7Il1m;$&CVQ&tFwX<7&6otPjowjmw2A9{6Oi|LwVe ztZg4Bnya6^KPzj8Z;bNegFVYNv~;iENKenYX!dyj^x#;t1ydiI8DEpTAf&$U$Gk6B zKiNjj5Bh3lYr3<<;Zo##<4wU$59{pXws`+Gn#0YYEyK6hVy>%3_TiZq!~g%uTzvVs z@um;^Res*cd3EK?&R(87M^DXP{k+WFZjtWp1upf!>*hWzTOPIfd&b;bpe&Q7eBhIT zYN(D}-jQ`zWDe&lIraFfeires+3dFZ^$*vx$I~v~Sa)psk3Ck|#dG^!7kK>tRXO=# znQ)cK`og^{#S9l_Jv_2v_pGvsYkD8Es+MNm7ieMmk(E%C?3~;8Of2)9+jF-^9+&iI z^Q}JdKySg?M~CLv&9jd9T730g^5qMB$F5)h^?lFV(mMO8=12bSU}RtbZQ z#%9|3(CQgXFS7pLHk&s8?v3N$_MCMONlS=bZY(-=TK4OOInKFzDzBu4#(dp*Yh~n; z;LC>gF&hpSNHZ`n9C*dCK}sUsP3ni#pF?jnySz__MkM8=c!vJkZfK_DHYqLF;>ndN z>-1B)TBTXPl6_6f^YUtbU0*-DUm|LU?75duU3OGFYhylVV6|6Ip7B zn)0yj`;zBb-3JeVmQH+N;e8#=_M|{5bw%bbNk5&a+$)>rmhy}GMeQ>7RkoIn-n?p= z{;}N0hk37Wm~=7x>!QuV+1|NU0l(+6uP%Paz4_IhcJtz^&$HOo%Njt7g&&%MvV{7F za|=x!Y>U)B+$=fp{S%hdnRIg*-g)LBTXwy< zTGd6We&2Tab7uQNOKJ`dND1tz7M!KJji}xiW1r_a*P3S)KjtSG#$Q z#q_343kQvNyIwtTbxx(eoK4t+CNI$Xi0{e=m|h)7oBS~L(5Ei1*ITsj%Z2axyS5L~t^S z1+brEVJVYOU&QhG_nH-I6-5#?KIdvqwiTXp3A8btcXsBVi^o~#>w_F8Dv-cf8u02! zMmvN3?v%R`YjP3BXca&LPpEr#~q2- z3G&w_rGNN2Z3&0E9X}{^{T&)uuLR!u=yW(Y=`gdeb)8enhKFXRSLaO4uL(aq!{Do@p{|LwEm`jqa{x7_GgjrX})Igsvo4Gi2X7XNks%(LCIi`V$=k8@wP+Hd|f zD|jx)lUc5<5_!yz`D9L;-%;Bq*x0t*YEo#z4&T>13dBP|YrS^JGl~VcTL%~OY=3!0 z=hBwP<#~B~*3ZiFJ82+yLiPCPr9183c%C-Bvn%VsN@(_BYPnm;laKhp!#J*>;;JQ$D>; z5ftdG8$KBYxNDa!m(DX@RU91LC;K4%`UXB_1OBy z&sjSz?28P0Z=1ElcfVQh*Y}mTUzgmO|IaAw@ow|gU;oPg&DuKeUt;XsKF-Xqa*xlK z_fNZ+B_y~;`R1|Z@*uB<9plhh(0A>v^|Iv3V`6sslG3Z}*1opm%8t37#>H>6?Q%?& z-$JwN29wgK3dhgdt?D*&*ShI9xx7#DZtvvdE^t&W-JBHO=5@NawQ#YO`iZdPI_q3} zHfDBMwyKs|E2wzh=94$yv$CoG>@sb(t!3cB)`s5#2?vF8Hr>mZerr{M1!zwF@Y{D1 zmp7g}zAt&rN4vB&whHZwf6bRar*+|-$>Yl$>+RKV7R(NAW&e47Wv%a~&%NwgZ)dq& zc{!tQ-?REX&qSwYz2r+){wI{|WV&GO=gX%SIWu2bnAx(>jNPbL->mo3eM-X@iIeR=5`yWPn<77A#aT=2KQW9^muxVOD-{rOu#t3N!xuIpZ6ar(!KrJ$*4 z=E=LHvWh>S_*V66(!I9+RF}xg)@@dXTA)1&S8Xre@R(9;Wp?rV_nxAgB5SU^aazuF z?EgKxI{^VQLJwBwzn5Bh&lkH|l}HugkV+`|jMKhM3r^WDzVzhB&yW}9DH`141H!r$l9 z7FPZK)3#=5ezbr~^h>+T0GWUPAFwQttv4;9nfH|qP{PuSsG<1%5| zztTy^%4~n`Sa|1Sqr{|Wfiru_IVC|3FDY3Ro&PLu( z-uSSw>hY~cP~TnduO$xy1H=2Luir5}sQtD?I-ViM$}l%I;r21mQ0O+fQ(<|5D{J1G zxwf%r7^;O_zV_z&AKhc(ChPP;lZ?OGOF`pFZMVPW%C7F!k6G|CoA1T(tD3h86uc!Z z)t9N5@$mH8j_+|y}0%i6T|Qsm}q@|S#-d;B?jc=@mB_xD`i zbGF?y_iSCR-Hf%5Syex6{;i>9;_y~TDzjj>MepldYwpRN?~0Y2wadyixJp$jOI%uR z#Z3ObtABLezkKc58?{?Mc;(I3O*fa!*x&$~YWiHIo)xowb9+o^-{m_r?tPdn?GND zqSJMHtm^(9KH+;e9{6zR{-iJ8-(S~MKK^4$fVP%~-evG+RG!OkyiQ+qj*n0`0PTW2 zd%Nbw-PDS;po#2bIgekz0af4k4*lw6u$g4s%~##s%f6}P@qY2$yL;}(en01wYdz;} z$n7s@%Y*Zppo^R16gzQ2ykIKN(f(DLWe)LkE*#?QI+ zQj~##;X?^aL_z1CMM1V7&q@XV-tzm(;jmJ*sm?oWMp-f&+Z)KHOTvXP-pJ{^E>tCFN=BD$FB$4^2EjxQ83dyE&u8r-)Cz( zAHR85{qD=9p59#_;)`FGmUxvpcAoqFT;}iV^v{PDJi1imTUEI2w9}foD=lYzc%+kS zHR0)`fBv8uhLitiEZ*|CRnPj^tG(`~4_j|qO?tX3dCsedxQ%W$e>d-o4BURP%x%rR z>X5(k|2M|XGoJHqx^KJb%cD2-q&v6%OqdooE79)i>=YTQwK%FcgCJCRb;*T`GR1UIR+p zS=|iWdQ+#yuSu+*z3{)@&DiJr-q_9iU37Q)#N~zO&t6(0{ygKY-Dl>#rq#x#ACKOY z`u|7gt^KU@s{i1nXKm%;FAq(xzql}&we;2MJ%<*GFVDYnVfnKE|57XC+g@kcUp{w5 z=4(~TDm$ah+VyAlB;Eb+PAT@orN+)Rr9Zx}ygjw%{B_Vy%&D{XB>cT{ zRrA%i2j8n+bcbqbex7&qgYDI6&NpBEJrQDST)MaGwZ+m6TlP5l|KH#T+W0ZE^600+ zq!Zb#!q#&^t&FYUqWbTrF0az7(w{+1v@ai~ypy`SbY<{mM((cDXY|+2^NrsffBE{m z>z1;!U+j8#(rSJAA}8j*b6#n$Ul9@<{{H&!{dw2dNB7N$$vnF+dZ)j!xy+Tb%C}$p zCtGW2nytB(dsp;f-sqJN5 z+P<0V%eOnZRi)R`Wc4js8Esoxs;^QhIF&;_xXmY`Jz)82Vp-Zb~+Gzr$^&7Oaw%&*N@=X-T~>6%HiO@eA% zCO9$w33*tcv3!FIyV2*ZA04KN<@sK{a#d3=wtkhKQqy14W!b^JUVXvW#R5UQYG-V4 zVEuVJH11(QT;R%}e(|j16CX$I{l4N^uHB-g)|W!wF)I7tGR<7FQ1;PPZB4hg!b(?k zv?4Y>bmaQB{q*&BiyvJoN)?~-q9ClXY}vDnulE*%cGT~Gd+tNW@pfURKX0UNYC0-g znFjX%uU&Seja~D^{dJo@aiu<;uJJTuo|&A*GS=u|)7rCjsn0^^z4~>}*SX~HhZN`I z|1P(m{_-p5{mrMs3=9m{oElge82mopzOT00|8<0OuHLWf`k+LyP7`!24ez|?dRi^98-MFv%`e>}-hOKYxj#=sHXkPzz7`)`G0K8J% zrf2TQYZqHdr01e!EYHE7#eOR@#-)z*c^B){>37@Le=x3W8JPym+HGF zi}uR!y$lH3*Owx?V#Ai0fBWpZc)39bq13!Bm2dfbZO+=3a0Uj372=?9j<|E;94Dxf zZ@YanCus8u0n=`yeFnd8f~sof`Rh&gf?6mGwAM7TGBg~$YqqPo=3LB=Q@x;K<)Hm@ zt^GUB++7N)c^X0M2oF5U`|~|1cgu;8y^Agt`BrAGOMS%%+RqAFEz)pQ_O$jj%lg?1 zRjn`GiE?1J4Ed;hfmdv#aq*wf>ubhWMq-(P!mf8D(` zn?7+(2e-giaDi5P$el==yzGnDmA%5dG75HET>gFjjP|wt&vP$(8=Jk%$eZ}`FK9^5 z4IIZ0cbW8G32nap;*Xs!XlvBVx=&qRrsiYhEuhZI~We{iXD9N5UbN$^H8PEnr(cMN{ z^i+dYQ+4ra$w=aox z{2(P+%YLo3%No&S+n|RXg)n+R?b$9R}2X zg|mxHpMCyzoSmT|5|lC-5+Vf;{`1@3%f)N3QRw;yhzuycUL6Fv{iyaYsjSa8uCM<3 z{r&Zw%M=(2f@5T~@!cm` zXP&?9=VxHp3{DXTF5R24`DnpxOKJYh;}ak2tvFT#jsOE@P?BcQdHXjWyb5INzW+7{UYj@>UScBGtrv)m0+IoA+#NZ{Rnlpc8{fw*KRWaS`l-8Ztb%|h?tk4Dr zd_@mvHYg!`)$Y>;l3-IUx;0xs$(VtGz%eEaySv1U~6*W3G?x{~jwRCi^Z`_k4Ycp;A+?AG5^Cy93ib2b^K#9`6MGAC?N%3y;;QiNn zr`}PCDeP?$5qhxvQy14$v8k^>)t}7Ci=cLF`DMkw+pL}6)p&sRX21A9ufNO}tWY<&+Npk6$oexZ0+L?c1qcx z)Wj_EB7M3upXk&nuQT!{_N9ntrN1g%d%xbtd)xAt+wV$ht>5r1o9o)s?6xS)6I&@}sMy89H(~x=_g2-^Q>XMV-s`z@U;g@;uk2G}10KEG^l+ig z- zqWg7?1Lxyj{}!J_20esXIu(@{%j(s293RB z?^)Q}H0M>af7LqBl<50En|$3jar>-1eHS$M`+VcvlFKK`vV;V4R=i!5yYkoV@2^eL zA20N>|NZUV#9a&gPe*;-oZ>!<&EE3wn(v>VeDB-5rbbT=x=Hx;@ARkQ+OLlJYv0Y= z>?yo!`-QvD%Rq-Tq-?&ruWiyMuG;NI;HAfAvIb%r5pO@AIaAz!Rc`i^U&X5h=hfJK zXnXC*;P6$VG4;ZPZy&4P`~kP=HUA!MVSRN>@GWR<6KHP&f9*yu?(I9vUq1n@0y`Yt zzN&uqF~6<;J)BoJPyc#tudvnYfB*k2;}?Htvh&dY>t=Q_^}BaW*Lyc#MP51l>s1cU z4_8(HPA>8MukzOO{8eN7HJ97D%Xj@b^mNa?PSCRDSJNaypYKz0W&%|Jp!Hj)%a*;q zxIQfV-m}AMA)NVFYz?D8y8u7~!o~4xrP^P1a#w@S0{Hqqe*5e7_t$|o$qTPqQ*UQB zJ5TzqWBu+W)0LY3&V7~a@w?(|UB(jO?f1XXzMUsDV!?dxzCtrlf?BnFxkc^9npHD4IDiJ(etmm4 zahbhb{O*2GD-YD#)04e$YD)K1dT%f9DHExPJIe|emz;j-`gp1R4-rq3UK1g*td z))JmBbz$2^P^)s^?&>Lzl;`}`*4h*7(Xc*lcUnW3z46g0`r6C6K5Ty7XDGY%?b2@0 zBD!VYV&xY(Gk^Kaoc#5cDf1k@^?sm(_oDuu5&4=Ssr&NC`{lkd6?1>*cI^2ZBO@#I z<9Gdi^NrnM|7tgBK2MgP?fc#L%_2+w{%~dCxXT~(K&fRKD7Cy5NVt0F$GfvzeztO# z2JT-{WqD7&ecRPl%a>otv}!TddpUoJ{5#pD0h9G_=)bre)ID#;ienF-v1m+GWSsT+ zf`x5qq5sdDvHykMO_Nxf>hF7L{;@KXt@pWqZ@bd=T>rv~bDYb*MNj?wTP5o=w|G{J zd9l9F!-FE+Z7+^$|2lR3N%5Tv-#&sDqfL`& zDF6KAbK~|HekO*jeumdNpr!ej-^(vvaiO8gHm_*1ThyN?N2-2n@7=#XcK#i+JE`%j zcB#5$o;&>b)t~EcUR+=RC4{!}oTQ-Ct&h{cUtC=;v*5Y@`(&^B`k7Zk@83!NcVf#d zmsYlnWAVpcTnm(a^>)UFd5UizZ+)|V@)bM9MfdtDkI(4)_3E79*H5gA^&UyFzP#>! zKJ<3Q^_q8W>_1;FXFrw|bY4vF<^9>FQ;G|HA{KxK*4IhTd$TE-$E$Dk^{?|2Vqr1V zV0i7H*~2vRIhXxF3(l6-Ph90Wxg+84p9c}HZ9D!o-A%LJ7}lm;nk%^U|2@My7nrty zl1}!q_+zVzi@&dx{XE?>7IZpE>8r;NHSgXjd-ync^UJfZ*cQ2I$ zox=BS?uDbd$Jd_(?c_S}#G-t9qp``B;=Ax!G_)#__{RqsC8wQWy*cU>*4yl3U@Sx<^5oe^($U52 z&)nazK+np&|B3!fu_HTgY&}+z8?`?8cmnUdI!Jlk@cGX7<>K7Ci(}MPk6M}cs%YWFwdKDY}D1~kx8L!+J$)kBv2bS7pW3Ud3TK>qdBr81FYE1>Sqj&Ay{`q|U;FoOx2x|h zbr*?yE7$Kiv~agw+&c4TIV(#7Lmn1n3>-5{LhbNVu-+9a~8Z;XNTM{>I{?`6JU*#{;JJ0#w2Cc~1 z7qu_^b&%22iNPxIyZeQdny>B-?a_NV|H&2Bde9++p8vys72T9u{@TcU{{5B|4!hdKm0?=Sf|R^RM0hZO!++ zH#&7MzyFs~xz@4cm+Fx!af9BE_)8AiDOkZ8{ zc0^YhW$m%kkRBby~7x8!@i+?r0?p7(h- zmsT!W7J(GMj(S*QTE# z`R8t~vXthRv^&?~ckJJ*Cq2wFf4=&BBIIxS!M@GwcnkI{a0%aQ7_aYl|HYM!>*RuV z&z;s*W?;4}AztuIGFI75Ad1csbbI@kT;N5@D+%1V1(HhPEPq{|84Q5 zzWKE#Pgh!*_g@K6cjue6G;qWI%d;i_y#2j(*T1{2p>5&IL5G>{jo-fdezN_wtRtF! z884nc@)vu1X~KTL^=5mlLaY21>iu}GAGJmI>dNG=S)z|atSiLwE#xbHfs*1ojt%E7 z*k1gxi@}svdi}Z6_W4G4mVtKKU(eLk(Y*fSd3t7eRNulf&`EnM^%>VbK6KUi<(vKQ z`Pjr~{;f;xde~~IEyMS>{G*<8uF6X9&$Gnkzi$3*A<75ZgC+i_c-^PfGns;?f{u}> zNZj_2+ud_la*q39=Vytv<-O*1yEL}12$>vb^3Cej)M<;m<7cKr=1no+M0KLo7<{o`XNeFcm0L4 z@AV5`Rp>mqXHaqY=Yh$fh<>JUz{+{^3W3A9Ved`trariS);%OB?M-*j{JY0jY9?*{ zdOiPo#%IUJhv#d{@ZJ6R&}g|BlYDr$>|7~xBeUKo0b%0C^R4}pTizBo`)F11){6n> zj~?gtDmi+~KZSVJwUk$&pny;H!yxSWTWBC#>XKLKD&YnM-%G?uga4w?S!F$dRp`uISr@y~g zc=GNQ-HSKkne}BSJPF;MZCWB+y)9tE{*4!1Us|?SW%qsNzPQgMdGSKik5a6^vjd8f zb#J`7b7lFi4L6q*&zbS*LPV9xdcttg!LFLCd~l~$l~=y>~So~E1qv-{xzT07HV@ zGJ#!zD}}{Z)#c5}D>mDoW0z8~`i0xUe_4{jpO2oMXOevQ`fYWW7iY8Cch&kX&+82A zGTI@0{^A`a(22Ek`~SYp|IJe`m?a~ZQX#^$=49Grw-O_}T`yjXR==*vS)Kja?YT=OpE>2=*w{^^Y2 zMQJS4t*Oab3&y+h#MYdgDSKzydoT0UUoS4kB)=9g?dLPxW7aKs z>sY&V-sUR(#p@Gt`PAc5D9_jUqkIV=F4em}Cn+RHHpu5Of z#qzwbf?6NN ze;sAZ7X5p*rQp%ljkh})E}YpHTsLMY6i~ppzh87oXgz ze`4kF*JWowp81zL`|Xvz&BpOIRjNltk+C*Z;nCLU2UV4&U5zhpG?VQ?n$cS9SkVm9%rqy^*6XX88X8 zvW@==Q|*0Y=PnAbySJv*Pp2(!vu9%Cv2Bs(wY5z5TrKvU!zp~YDQ2^&&8u)_^+S^7 zTzo732M2Z>Otz9yH*;_JU7*L-^ZD54M)g=wIJh>1Ha}p9|NH#e!d*-DXZuaKcVegP zgskm)o|Uc6;d|`jZ?dX_&LD2QwzEmv4;qq6=@Q{MIbvS?e`laHH!OTLfK`0*K&_NT3aAruG1AKzArCg_KEY?Z^)?~O?|pY|4vJ>;RBm| z8~KV$phO$<#wnuL?cl#z-%sp}F^~>dFjE8<(cYn_YO#lSH?ftazCg`C1Sw9cl zh~hn7zDzCr&4i~u^F?a{-I)`<*uFZGF8!*l*sx*qMo>%QK#Y&#nnRbTf4g?!+eg3c z_LE{4fJT-J{~OAl)C;LAT)FBL%e);6+O5p{*Elb|_Bg*Fs;}hH`iyfPXZ5aZ&DXzD z9DM!tJkGga+Yjc(+J)4mJZCvuRWQfR?(gJJ-KSUWop0Q)dEoq=TW{^m4%aK{Xs=%} zo!eoD*!hPyr%nq!asI&X!!ysDUEzJ6wBVi8p`Qm%U2kS!C>BhZyD+<319XJ?@>_a$ zCoWUpAG*2B8Wx2x~E7JD>&bUpC8>e2nWCp+@$@;l%Cf1kf=NxgQg;fk%G zqw`L7sCmA+t`;VL&j_?kVg0S&b7DT+JmK^%v9WH`?;Ad|S3Nls&-OZ7!Y*d@jx%?@ zUfB~^S2%Ow(Z_G?%vjlftZLBL`r1@%n9$c&Vz=QDIQ&^6(kuQn$@$HFA@?h3>b&{e z_8rv!BrTa_V{-DG`M%=B&>}AHulLs924PWQu@x6%XJzGFUnX@+G0t;i;xd`XOS*rl zzI;>%T5W$X>;2@iJr_RswQPLYxGeYj9D&T5*Kf8w&JlgfyXn)JO8?5u$v=;F@$#Eo zQQH?d0d$J)3Z*$+UP@!7D$-;XwSXQHt|F%38T#ni#JyXw6i6sOGQ4 z(5@xIizkEjjm~!87Jhu0px@V>0^l+4h_0ts}&(AI6?EUh3nzG&sw&jmvcxJSJKKSxZ zA-K3+eQ91&1pDLeqx%f2xo@wYuVi`eMhBbct=Vz^7uWHni@vxzbN1Dr`uAT=3V-&p zVA{w10bZAGtn*#{_vWuD$!))li?^?3%$1hTd+c*|!@RG*jd{0A-n2Y;VbQaBdEv7@ z>X+_~u6#e;O8X($R>!li9)lVW^V$l_RxJfD9XoTk9OPs=&EtcQSB&*qj~Ft_GTPPd)cy{Vt95 z2K$;9ukRMi_!^>JmMSstlz`xy^_;e|b}v)lzO~_gMTGU8&V;3Qm8YxQiwzUx&arQO zd_3Yxpws-Ll3o`UyFZ{DEx;x`&i)6HjrS|?Ew^rK7&UVwdc|gk4y|{Zz z#qQ$6+bu(I21v*UWcd4hA?&=j+#qM4; z+;ODcoAt*{QK=Wp_bdup{(DDGg7)Fuy4$gT+rwiSGN{@tN*)RQw6#JIo58&)`eD}lLqT+vKtqgP5mWt`y#k68Ii;olwP(p z=eo)wzvEv%Z+(^!GJDSd37~_j9_s5HwmOpS)c*|By}NvT?WvRBrx-7u7xUDktg&qQ z(-m6}_KM}nT#T##moc+@)hg-yiuWd8iZ`0CKK*>=)yTgaD`DN&XB(ewH#09t6LW2t zAKTmXcdk|3g86qZ#7};8`0itC>$_$q7yQlVT|QT^yEQs^_1~KdlaF0f%$R;*#kp)V z3EO8kYc}TeKQsf6=r}E!RN{ABP3r2+8;?Ft`tsB$JBM*@)tw*37tHKpbd!5~Z&_Sz zt&O(2du{5WR|SrL?yK&e!=-Y6XWfRR!@a#r)_ATymiX(XezNK7gN4iTj6 zdG_n!$t)qkH(w0Tzs{{G-+Sv*+jqX_N$*3apEq8;`B(DiFP|IDK_kFt92>sctEP%- zX&UdVJJI2H?7HNnCG{~k!_O{qnv?ZftAEaQU)#xZW*`3lq}7(kcdB(}6>t4bW2-1- zl>_06cVEfnU3sjxCw7JGY3+3%pWCmuUUB7(lXLB@+MHh>rY+?9uvt1w-4nEa_j%jF zw%eeI$epu$>Sva>HXr8-iOT!4x8n1OZ+^1*DbHE{p6nFNcAIMT@#m#u4_+(?etY`F z<(|^tyxX&-MAyi_m(Hya@d>R`bIk@dl1;QCK*x*yK2dSho#pDz_{~1CxiwWj1r6)t z_LnsTAD6ym7q`9d-Gh+Zw?2Tqem>y-{PeFUrR8TYpU=PNAt-zEF|7%HbKYd1^u52r zyQSvUeYh|sZ&z*4>-`4OppzuN{64;-`QSzS>HIlstIxen`cbj_Qc>0(jmXXV!8cit zEj#k(>!Nv|NX)jzcJ@rjR8^>I;gpxth!F`zN6UvK&zwmGf2;9&o^;JwDy zUh_J|zrS=|zj+WE7PoM1`zGG)yQ^!`OZ`p0{h51tW9Pp8=~HT6CGrKX6TV#R4qmPO zx&CJTzvH}qTVLN_wo%N^?&8admix-&@7Cs}>(&-c5>onKzXh~)cGk}W7R%jF&&a*^ zOxepiPbXp85>VslvG^B*E6dV@ww#X7zW3=~=8NY^{tx=jZ~paYZU5QH=h^QSfbuFk z<2B7|Z;kg|{Q%li4{Fhr-tS1LuPu4KA?p5qt$k(J>n`RA39b>XpAFhRKl!gtvE`rI z+Al|1ZNI#Hdw5Qi^OMD`*4ck5BP(0?#pUHhMZXU-toq*On7;O}kDb}ec$!;e8ZZDs&ju#+VkNf=hj(%H?%d~PS2mUL~w48zwDVa+Sj6sd)sr?Jvo!t z0biTVj#!)hqw4piiFJEU6wKb>V86Heal%jQo#!q*dYkzxb8hkL>0f-hu7T!O;?+vm zevQB1%v@7?_d`l<-9x6opI6m|vTe94wAkeBzKdL+%#9b6#rp!iZFc1~^R9~L*XF?H9vtp&?D(w-8fzB+ z>TPuA-NBQ0uWZa*BKNzhbgFXKEcf;os}AOtT>s&hB@?&(rE#O5kG8Rv&INzafmQwU zuE*a0v(5i>*|O|-w{@SoPm8=r5AS{v06M$`wDqFum1|(;&VRP~za!s&zqRHpxYf(F zDZ5>Db!Ewlyvq8{vgJ?beEnyb*jV*`*+HxAyEp1CmgRf-d+P6VRr}ZcNwWQW*lKTu zYrOMc@1XnFHs1Pih;`P!XAPh;sCn5pO_^Anbj0KF2L;e62duTirpvsImy0XafftXL z)P1ZApRx7dggmLlnyBEMiUpwAxM#U`YcjLHWq&@HBdf15asFNRz=e!i(=T{5-#(fd zb3M(^_u`sv+n4F}x?xW@F|IY)kegh)-N-eXKUI7CijaL}vz45grbq~{0-5n|n)20c z`(HnPDs@xy;7iSw=i~3W_s_c@Yrn?l;-9tdpbLJCin>CA;ucp9(P&&SSB|9Wt?{A|#?C#Yx$C})XS z{^Q&B+N!6o82$dT<`%6N1Fakn>U##de?nAby0*>K0q6XZ-dS&-``kFR1DXduO+5ujI~Cx;j($ zukTMf#B_D5>y&eE@A-uD=f1w;(IkI;$qR?Hy0!0qpE^Ig^y&h$SJNVX%jWuh+IX|B zzIJBr*L#bnN!O}+!j`8i+kls+o6ORF>vJ|R(Q{|8azE(Oi*+C8uKIKH*yc67n~Y7} z`RjLj>Bn9@|Dn*Ii~GxE`L-<=<=eIt?&>%8eRI+2{auTQ>-#oeSi3u3?wr;I>-{;G z=N}LK``dQ5n&3guGB*%@CiYAPmKkd2U1iU&&zV_{sDx&f>o!BH^d?G%jAYU$g$}-}nFDn9sevcjv>>;x~3?zAvY)(A<0G z{#VfI-{bq^f?xjzElcIkKX*O9ety!-{db;=Pk*_}Tr48(?do9ANuigI?k;()ab33} z_P*C??JXJ6tB#edy?tm?`l_>1^7{YxcpkPgDfHxs5(ga%T#~V%@0ry6P07pl*KH3A z=gV9CqH4yY=UMkY+^pXQ&*Xr%xab})wOF$H-i-BEtNV97{Sm6EyZ*w`_2-JKD^%y+uzl6{U#ApwIyktF zdR=_|d1UQ}XUCtNe9oM|Q;vnfqMzY454+Ll((mfpcVgYPf@a!0_kT5QeLh>XI(zH4 zt26h-Z4B?P+j@&tRMNcqu%hj=C-JxKV)uCS*Y7;_q^oE5^UI>YPCaN^@in(RsxNN# z)}wb*XMl!6r%ru8Z|%0?ZZFe+KO=8dD4fb@V{WLtIr zBYjt)3lN>AJM)k#wb zU9Wn7>P7Qse!aI?>hGKLrSpV7ec^vyax;6s)^*-s?|Z*XcOSF2_x^b_we;QVrIOO6 z5BER2_WE7@O;%N__w$RtteIobLos9G-qRqJgGtEHZb^2L5X=L9-# z{j&4im8*kIp4|i;f3YOhy7&LnTW?%7y1h=9nr!y~-9n(Lf7bAC(u3Ec)uw;)?O#UB zvpoE9f6O-byYheb-CHIvYZbPDJ8s@;>Hm8pjKouYXTXxgS6KChJ$@*d>P^UQk_s=JKq)Grtz? zSv6&9_=|=5VVMtvFTYyaH)#_WXo-H6z0uYz5m3*U8DO;UNX(szoNSS zjB%~uJ=>Q%rT(5dZ}ooZ&Zzm1W*s#S-pu{=g81qwHSe#37Ib;{f$ooZJa6_=PyKTj zqr_`A#%?wb7LK2@_T%~Um;MFMOZVSwZ0f#OZsw|fAF0lXGsD+N--}(s9ry45_ayN4 zh3jr%bsO9M=C=LYol-vc_om+#|06dfg}42(u?n5O|J!P_oe8>ACT-%{`~7tpXmrT- z(^IX(i(~FAU9!e$d+mmh=X*`APx*efe)^lR_wLKGR!bkU2K8H}6mML<>D2R?+7+LZ zttT&^2VKx(z3-jg0b%I=lR(hAo%zR0FP-q?Y-?+JE;8-a+nv#0`z58PPAvY#r#)Zy zCTRJ%a{c{V@i$ER`2zc=U5v^+)VfDS_RJakxBttRJ(SI%TOUpUZ5#>?U%sOz zcEjXl>+i0Anf?9soIc-@yB|{KUbhZh*jVTHb!vFXs+Ft1zy2G)eRqxR{9h$|7PwsB zvlo1f<8Spc(4~#Md-GLZf)1mcx7&C9xm#-{Z=bYh?2)-&g$Jd1G?q z)6Zu__x#*A7oHDS%=DeU|9RWeCAQH{DI1QJXD@Sn`{>Hb$R$F_PNI@R3ia{wQ>TQ! zh=|+xP4?{7UA4ze@;@hnPRvr)i&=Gfaq1SeFB$9Va+9vwDLR2xXi7a$Zd^JsC?X|*0uMVCtpNIubf8Kyj zY+SR)iB^Z_aHvvZ0_pUjA$TkVUPX9X0^ z*|n`B==F{d!sj>d2VLm)RCMmYTXVMm?3nh>qxhy(e(6;ct%&Dk`Rf`_7QVWp6Lfa5 zbKU|BB z16t+2F!?9w(iQJ*%QJ7y`g?2gyy%tl1EGh|_U(l%KD@i8{gLVWxou^7-&DeW*%;3@ zx8Js^;?>Us(d*b58NesCFPIkrImy~);#T!1pcU{83=0l|7PW)c?hej-f>AD*Wmv(d zJbHsMD6){Qb6^;~u6b}L;ZfI(=GoCa3l0HlZF4&9nskWi>5n&6mUg@2zWcs;^sXp? z`+V#@_uKKiJU}NaPW$$w{vwZ+nDx0z{nhVkH_N+r zpW6JV#0DfKxvt>DQQuE~9FTdW5ezn!sX7+O1|MSAuhu+A!R9@bH=}DZf z-)>u-3+H`B=f*b7kG;;5yZZBQl~vxKHIBBhYH9C}&~*R&~B8lJam47|nvX2(taeo|AXG%~j!?)kHcw|@L#owUS$&rXN= zdiO$K+JPGPr*9qp9s2#x^=Dfj^X-Z2-Mt~-+w;=LCL!O7#A!?I-?OV7&-~{6SVZW- z>Q7wlc2PTmgTt4A4ya#QxOsL+GecNPWp zR_9Hd_Rholt=;|{t2O;%?=EfH?-!I)vA}L;?u@AWU#EKMSj_^RXOSRS&cKkRXz}34 z{TeRsQ+H!L&*n+p{P%ss+im>Q!noG^-I_aXar?dqP0uVb(M8<9)vn%nZ|Z#e-@XI& zzgsvCmtNg!%fP@OW#*P}bu#F>^5Q&k(29n&j}L{01up!mdHl<b(Rwkj9?sB2&zYdp3dB!;d+~PX?U1N?2#Tsdo3 z)&6<^3-|sj^VGj9;(wH5fGx7C)UDsc>#eVYU z^XU!qW6k?>)_ea_Us=4_gZ0+QN%;M>J{P$!n^}B~c=hR*$>YMgKmSNqzMb=A)$^TZU&GW5)k64v zUoI=WI}3E%WS{tyjF;z3{wDu&)4f+$Wl;3${l{nDr)B*8=kxdPqTRD51x$u`rt|4q$Q31KA=t6Q{^VFzw0jfK4xV{LjBphB@v6~|J-@& zc>ODp3zOBpWau4FzwSK=c0}~b*vTCUcTM+!WY$gFn7FFIVvD(L_~q+z7eI@>dgd(h z%I*30Z&mSO%afCq*uLEP>;0rz%h%NH%ju8%`4Ri|34razM zTaO;jtG}L~3xB=iLvY^K?1J4Epe=S`y@$V?x$<@Dt=_k{eB$p~Iz4p!zyEOPg88w` zlOLNHSo&S(@x3-9y*?~0u5fMk#+ysFuajOf+kKn;+iy?QdQ1Kv(ff7yf!V1utN$E5 z#RIw;`p31zT_p~yFX#31@&5Q*UifvwHmQ%_=TC_a`TJ!KpRe+l@7`5cUwxk$9P#V- zmGi-K{|H4qT(R@nu5I>HH=j?hahdSU#w2d;Z1;I()!j1!wsvq{O=XUHJ#%Gfd+Sxh z$2$!^+01#lboH;7^NOwKmqq_>;jpz)bqeRn(QW7XljIvV{dlR?;`OrOHs?!Cm&EP? zE!J@IznQ9UW)l!xrJ7ZA-sSG!lSO-tii@Y_o_~48Wqqu%!@qt1?JrzEo;Eq<-0Stb z{@KUw`Td>Y^`kn^P__u?+sCyZ)t^5tp3a$bN?T^Xefn~{>FW8XS1JX7#)$XIplp3e1S+cGanuibk6 zh|aYooiEGY=U%=x>&m?&YQ3Fqz1xnd9`m>}eMgdrxPX9bWXi<9{|t?q&K%$|W?p{p z{O|P#EuTM}^V7C({pYWdze+hXH`Ri6N^ccN*xDf9`+Di4OHbOB|84GGrTFz`v*w7b4PU0FX>;QG z%lVBdT)J8E5&t(lU2^YMP0-7ou3bFeuJ<4Ndgb!ts!WILe7~NqNjV!iFKO#s@%>lN zKRdtqebd!Rv-VHew)pw=q9ya{XBr3XUECBJ7r9nET=s(cZ~YZJ)&!Lw-*SC*Ki`GB zhHt)7o%;Ju^Y-xjDdI1tUTrUV@h9|W_4bQf95>D~ z-`8(*XLemc`P66kuD^Zr)_UEF&5PAkT~}||;&guR?&#?L)Rk__0$xvD`Bzlx#p3%l z|Lh7BcFXcCnvauZVh{%UGshKRU_4-S;ubjT;;kbWSmOW-*U}(7J(s0$uP50gc=I2Fc?dP93bN#EdXw~=j z#ZRsti~aun?UMh0KV55nyXofPr*B^_+%m_Bw>oq0r~H5V|Bq%LwVF0@`JLD1U+(ww zUTmqmD0M^k$}8u9Si5<0RjFC^o3FlpSKsg~uk~KA ze)&A9WUh15>g&AhYo2R=u5MlW^Vh|$*jF--)}Qn={Ppg`?k{J$Vte(}a^63`d23em z`3+_Jsvf*MH)+Yz*ZnVgtuDXTi_;D}wNhs8pQj_1<8MykG@hKgNWAFnUSlim8;=Wk$y za6Vha?7oBW6E(rlwn;wc}RB4sGrAF3n>uoS-<-Acv^_=ylG1m?DcIY-8s69A-iV32J7$Ha(Q)oKSu0*u;ALl z&*8K8%}gsOF1|eHskN%7^_n%0H~(|krKW!L#P!q8b8r8?UY)UTuI>Ev?BXT!97~t! z#BMTpq`rSijDBrNz{$deyRsf1US*t}m@oV8{q37Jhu()v_eH&Fp4}HQKkRBy)UNuS zi_V=ZP~3hZ>22`lPhT(2E1qR)#v>GnzjGNpEHSfpF9n$pFjP$`_b!_wbO%)Kfm5P ze`ffiv+l-oi|iN}7z(VJ)`)#r&FilFud>c_=c-lNPaeKow(Z{bYhFA5Kl9-6{PifM zY;XJRU48LqE^qi@pn7b}_Lo*{M@voi=jCw4gvE6#HUE9`_+?`7?rj7m6w@;-{MW$%2nY&)h*YnCx?dxCr4~vJ!ru$vll)Ex& z+uDasPp?_57CXE0@P>EWe?2%QlB_3oR|=f)+K!2R`B$)A^FUE~@#O>S7T&6`SbXpI z{5RWeOwULDJs(Vo*h?|PsWh+{a<+IufM|1PoJf6?bTt8=)D{7UGcheA@8;P)!7G+?Bo5Hb9rL- zGlo+aKQl5gG~5Hq57CO>auyRj`TG^As{%H>CwdUgNQ zy*pLv%JzF_ipb>c%iGg6-ehYWC zvT7Yz{lkLo*f}R?c2QG ziLKge-amhih_dIc0*zSL-W;)uGF!R-&p)Y|v*qodNky?Ibc3c}*!D_HEa9U>wA#O%{{_;v>$=A=v zS7y6kW{!?@ovJ4~<(1b%-q6tN838dXg6ro8T11`qb=O;UzUgXJqSvBjJRO1U4D!CR zBCA(6Cxr$p=i1I&%KHBO)q};`{Qu{yjk@ygRN2vEnFYPQ4|ZJMvFO~okn&p9`uT15 zMMHaY>Yw-gyB_g-(wC3-imP6qT=?nZmkV1QH{P0E<~s3U-Lsc_%F0+nO${UJNjou)eQNF^VB=op zt<@h@d~1p~`@VMHnx>oed%;@%Yui{D%Z1Xf-Msp$Ph?BFO0f6W{f91bt+k)AF4Nrk zz|Z>It35q078M(}x=Zt=n%wP}o8`RH;r=przFWd&Hy@|WEnWJ{h4psHxphZ{O)b_f z_KVjF`Ew`KZ!hTh(gTq>(z}|)NioO->|)(z|H@Whd$apOLb@S8v+wU>we)M7SM74!?H7M7JA41N z7pl^x4_f_8mVRinvAy#(zMps7%HC^hj{cloYjEQH>Wddcw+3(I@|M=C$nRDDdpToH zV0wB+&X)wA_HECuONMvn=51E}egD+lWu|*}wQRfEuuk^OW%ldu_Aij;(<#XFy><5e znY_ft-oAv~=g*hE;9HhCJzY;U%66S)5tmn~)^3MMFE{6P?Jt*BJ=Wqei7)EL9?-ah z0T+`F^RGWUGM{U%H+xrAQgGd^zjX6sOZ}%;*3R9L#@oNSDkft=W{FQ`~ zUzIDi&gRekDERiwdj9B}FE31MUt90mccu8{nUtmfvR0Mp&dd1tqxt!|S>jLL%U$%V zGxPbKb2h3bGJWH#na;Z{x8}P4O3yBKojdnor`7Ibci-K1PEwtD$gKKWcGk&%+dmex zRW3iR{=W12i#WkaF~+q4M!uh?sQB}j|NZ^qU0DBY!!4`tFS=uxCi@0`L~ zYtxGT*~b}bt34h+>{HIW!ufcXaFRvQKIN}x&gln!?gF^W=7gg)BSYwdrpmYw7!S`C7>5@^hPR9$xFG+QZF#MSt1se|}4z zidfZ#yMc~yn#r+&XT_dPQN`1iuUO{B#sBH*J=MuyzU+wW>d#odLZH6)t?WwE;^VKT z-}k&Wqs8NHadC)au-2+oTVEV*p5((HXdORmK|b%BMS2T!uUczG*w4KYK3~6T#YHo_ zJGoU7G8eWsUpphaI?(p;ReLj+%WOxpJ|ANLdS!;3*!k$)_OYqv%irwzdxb-HPR;gr zFGUx!3tPYLm1O?<^>y$o+5FQ|M&C}H(hqcGzb|}JL@r=}RM+Lrk6`L#8!si9lN z_UsRzBqA-fV6V5@%Z(GuH4W8Vl&e~@U!F->JJWjG&9~;;>tT^GZOU}@jE7HlgGz)+ zN!BlRwpYFG7C(M^b?@#~*;!jMt}^bvmHqNxxOLImYp-gbpZ!{}ZI)E#w@q_btyvY8 zvSI$WKQ)u)NrGH&Ras~MefFCkJ zNy}Q!9sG6vWVyDUPJnjaJFl?UPI(hIeeyDSvaYXe``tVLUV3f&A{&0?rsTgZrlFhL zj+?$vo)i)ry!ie8xr>;~*3G_h>979N*)pk5r)n78Fp)YHdYS$8zkTj?yF<0-?{g1S z{8yEJu7mBk$h5GGU;lG9XTMsycb`S2C;y&*{%dQhwpeZbe)$h)tx3Jpe757Ur}Ve} zj0$^Wu~yXD&;0i+8C%dr2>Ae#&bSd7>%@HJ*j?Y5m8!Rj zbb|Natk@HIdxHJ%>#-p2`8)F$EV&`@vvOEvIGiR><;jA@X zG8+K)%92Y-V<8& z>Ym&zBLz2GrRFQ=&U;Vi_AY(*skC;-?>YBwSGxUF-IhNMlpnT;nV*fgSLE;fWBP{A zPdTN;&F$; zNdNy!pu@Aur}V5o+QrKo;ODq#RUx2QGkY0kIM?K*!pFSOz9cIv|>X mVbr+Mu!G$5%rNW{%C~yupQTwo4i_UqY2DM+&t;ucLK6VC29rYo literal 0 HcmV?d00001 diff --git a/HEAD/assets/javascripts/bundle.c8b220af.min.js b/HEAD/assets/javascripts/bundle.13a4f30d.min.js similarity index 66% rename from HEAD/assets/javascripts/bundle.c8b220af.min.js rename to HEAD/assets/javascripts/bundle.13a4f30d.min.js index 34b23f95..c31fa1ac 100644 --- a/HEAD/assets/javascripts/bundle.c8b220af.min.js +++ b/HEAD/assets/javascripts/bundle.13a4f30d.min.js @@ -1,4 +1,4 @@ -"use strict";(()=>{var Wi=Object.create;var gr=Object.defineProperty;var Vi=Object.getOwnPropertyDescriptor;var Di=Object.getOwnPropertyNames,Vt=Object.getOwnPropertySymbols,Ni=Object.getPrototypeOf,yr=Object.prototype.hasOwnProperty,ao=Object.prototype.propertyIsEnumerable;var io=(e,t,r)=>t in e?gr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$=(e,t)=>{for(var r in t||(t={}))yr.call(t,r)&&io(e,r,t[r]);if(Vt)for(var r of Vt(t))ao.call(t,r)&&io(e,r,t[r]);return e};var so=(e,t)=>{var r={};for(var o in e)yr.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&Vt)for(var o of Vt(e))t.indexOf(o)<0&&ao.call(e,o)&&(r[o]=e[o]);return r};var xr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var zi=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Di(t))!yr.call(e,n)&&n!==r&&gr(e,n,{get:()=>t[n],enumerable:!(o=Vi(t,n))||o.enumerable});return e};var Lt=(e,t,r)=>(r=e!=null?Wi(Ni(e)):{},zi(t||!e||!e.__esModule?gr(r,"default",{value:e,enumerable:!0}):r,e));var co=(e,t,r)=>new Promise((o,n)=>{var i=p=>{try{s(r.next(p))}catch(c){n(c)}},a=p=>{try{s(r.throw(p))}catch(c){n(c)}},s=p=>p.done?o(p.value):Promise.resolve(p.value).then(i,a);s((r=r.apply(e,t)).next())});var lo=xr((Er,po)=>{(function(e,t){typeof Er=="object"&&typeof po!="undefined"?t():typeof define=="function"&&define.amd?define(t):t()})(Er,function(){"use strict";function e(r){var o=!0,n=!1,i=null,a={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function s(k){return!!(k&&k!==document&&k.nodeName!=="HTML"&&k.nodeName!=="BODY"&&"classList"in k&&"contains"in k.classList)}function p(k){var ft=k.type,qe=k.tagName;return!!(qe==="INPUT"&&a[ft]&&!k.readOnly||qe==="TEXTAREA"&&!k.readOnly||k.isContentEditable)}function c(k){k.classList.contains("focus-visible")||(k.classList.add("focus-visible"),k.setAttribute("data-focus-visible-added",""))}function l(k){k.hasAttribute("data-focus-visible-added")&&(k.classList.remove("focus-visible"),k.removeAttribute("data-focus-visible-added"))}function f(k){k.metaKey||k.altKey||k.ctrlKey||(s(r.activeElement)&&c(r.activeElement),o=!0)}function u(k){o=!1}function d(k){s(k.target)&&(o||p(k.target))&&c(k.target)}function y(k){s(k.target)&&(k.target.classList.contains("focus-visible")||k.target.hasAttribute("data-focus-visible-added"))&&(n=!0,window.clearTimeout(i),i=window.setTimeout(function(){n=!1},100),l(k.target))}function L(k){document.visibilityState==="hidden"&&(n&&(o=!0),X())}function X(){document.addEventListener("mousemove",J),document.addEventListener("mousedown",J),document.addEventListener("mouseup",J),document.addEventListener("pointermove",J),document.addEventListener("pointerdown",J),document.addEventListener("pointerup",J),document.addEventListener("touchmove",J),document.addEventListener("touchstart",J),document.addEventListener("touchend",J)}function ee(){document.removeEventListener("mousemove",J),document.removeEventListener("mousedown",J),document.removeEventListener("mouseup",J),document.removeEventListener("pointermove",J),document.removeEventListener("pointerdown",J),document.removeEventListener("pointerup",J),document.removeEventListener("touchmove",J),document.removeEventListener("touchstart",J),document.removeEventListener("touchend",J)}function J(k){k.target.nodeName&&k.target.nodeName.toLowerCase()==="html"||(o=!1,ee())}document.addEventListener("keydown",f,!0),document.addEventListener("mousedown",u,!0),document.addEventListener("pointerdown",u,!0),document.addEventListener("touchstart",u,!0),document.addEventListener("visibilitychange",L,!0),X(),r.addEventListener("focus",d,!0),r.addEventListener("blur",y,!0),r.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&r.host?r.host.setAttribute("data-js-focus-visible",""):r.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if(typeof window!="undefined"&&typeof document!="undefined"){window.applyFocusVisiblePolyfill=e;var t;try{t=new CustomEvent("focus-visible-polyfill-ready")}catch(r){t=document.createEvent("CustomEvent"),t.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}typeof document!="undefined"&&e(document)})});var qr=xr((dy,On)=>{"use strict";/*! +"use strict";(()=>{var Wi=Object.create;var gr=Object.defineProperty;var Vi=Object.getOwnPropertyDescriptor;var Di=Object.getOwnPropertyNames,Vt=Object.getOwnPropertySymbols,zi=Object.getPrototypeOf,yr=Object.prototype.hasOwnProperty,ao=Object.prototype.propertyIsEnumerable;var io=(e,t,r)=>t in e?gr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$=(e,t)=>{for(var r in t||(t={}))yr.call(t,r)&&io(e,r,t[r]);if(Vt)for(var r of Vt(t))ao.call(t,r)&&io(e,r,t[r]);return e};var so=(e,t)=>{var r={};for(var o in e)yr.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&Vt)for(var o of Vt(e))t.indexOf(o)<0&&ao.call(e,o)&&(r[o]=e[o]);return r};var xr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ni=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Di(t))!yr.call(e,n)&&n!==r&&gr(e,n,{get:()=>t[n],enumerable:!(o=Vi(t,n))||o.enumerable});return e};var Lt=(e,t,r)=>(r=e!=null?Wi(zi(e)):{},Ni(t||!e||!e.__esModule?gr(r,"default",{value:e,enumerable:!0}):r,e));var co=(e,t,r)=>new Promise((o,n)=>{var i=p=>{try{s(r.next(p))}catch(c){n(c)}},a=p=>{try{s(r.throw(p))}catch(c){n(c)}},s=p=>p.done?o(p.value):Promise.resolve(p.value).then(i,a);s((r=r.apply(e,t)).next())});var lo=xr((Er,po)=>{(function(e,t){typeof Er=="object"&&typeof po!="undefined"?t():typeof define=="function"&&define.amd?define(t):t()})(Er,function(){"use strict";function e(r){var o=!0,n=!1,i=null,a={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function s(k){return!!(k&&k!==document&&k.nodeName!=="HTML"&&k.nodeName!=="BODY"&&"classList"in k&&"contains"in k.classList)}function p(k){var ft=k.type,qe=k.tagName;return!!(qe==="INPUT"&&a[ft]&&!k.readOnly||qe==="TEXTAREA"&&!k.readOnly||k.isContentEditable)}function c(k){k.classList.contains("focus-visible")||(k.classList.add("focus-visible"),k.setAttribute("data-focus-visible-added",""))}function l(k){k.hasAttribute("data-focus-visible-added")&&(k.classList.remove("focus-visible"),k.removeAttribute("data-focus-visible-added"))}function f(k){k.metaKey||k.altKey||k.ctrlKey||(s(r.activeElement)&&c(r.activeElement),o=!0)}function u(k){o=!1}function d(k){s(k.target)&&(o||p(k.target))&&c(k.target)}function y(k){s(k.target)&&(k.target.classList.contains("focus-visible")||k.target.hasAttribute("data-focus-visible-added"))&&(n=!0,window.clearTimeout(i),i=window.setTimeout(function(){n=!1},100),l(k.target))}function L(k){document.visibilityState==="hidden"&&(n&&(o=!0),X())}function X(){document.addEventListener("mousemove",J),document.addEventListener("mousedown",J),document.addEventListener("mouseup",J),document.addEventListener("pointermove",J),document.addEventListener("pointerdown",J),document.addEventListener("pointerup",J),document.addEventListener("touchmove",J),document.addEventListener("touchstart",J),document.addEventListener("touchend",J)}function ee(){document.removeEventListener("mousemove",J),document.removeEventListener("mousedown",J),document.removeEventListener("mouseup",J),document.removeEventListener("pointermove",J),document.removeEventListener("pointerdown",J),document.removeEventListener("pointerup",J),document.removeEventListener("touchmove",J),document.removeEventListener("touchstart",J),document.removeEventListener("touchend",J)}function J(k){k.target.nodeName&&k.target.nodeName.toLowerCase()==="html"||(o=!1,ee())}document.addEventListener("keydown",f,!0),document.addEventListener("mousedown",u,!0),document.addEventListener("pointerdown",u,!0),document.addEventListener("touchstart",u,!0),document.addEventListener("visibilitychange",L,!0),X(),r.addEventListener("focus",d,!0),r.addEventListener("blur",y,!0),r.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&r.host?r.host.setAttribute("data-js-focus-visible",""):r.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if(typeof window!="undefined"&&typeof document!="undefined"){window.applyFocusVisiblePolyfill=e;var t;try{t=new CustomEvent("focus-visible-polyfill-ready")}catch(r){t=document.createEvent("CustomEvent"),t.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}typeof document!="undefined"&&e(document)})});var qr=xr((dy,On)=>{"use strict";/*! * escape-html * Copyright(c) 2012-2013 TJ Holowaychuk * Copyright(c) 2015 Andreas Lubbe @@ -9,8 +9,8 @@ * https://clipboardjs.com/ * * Licensed MIT © Zeno Rocha - */(function(t,r){typeof Rt=="object"&&typeof Yr=="object"?Yr.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Rt=="object"?Rt.ClipboardJS=r():t.ClipboardJS=r()})(Rt,function(){return function(){var e={686:function(o,n,i){"use strict";i.d(n,{default:function(){return Ui}});var a=i(279),s=i.n(a),p=i(370),c=i.n(p),l=i(817),f=i.n(l);function u(D){try{return document.execCommand(D)}catch(A){return!1}}var d=function(A){var M=f()(A);return u("cut"),M},y=d;function L(D){var A=document.documentElement.getAttribute("dir")==="rtl",M=document.createElement("textarea");M.style.fontSize="12pt",M.style.border="0",M.style.padding="0",M.style.margin="0",M.style.position="absolute",M.style[A?"right":"left"]="-9999px";var F=window.pageYOffset||document.documentElement.scrollTop;return M.style.top="".concat(F,"px"),M.setAttribute("readonly",""),M.value=D,M}var X=function(A,M){var F=L(A);M.container.appendChild(F);var V=f()(F);return u("copy"),F.remove(),V},ee=function(A){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},F="";return typeof A=="string"?F=X(A,M):A instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(A==null?void 0:A.type)?F=X(A.value,M):(F=f()(A),u("copy")),F},J=ee;function k(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?k=function(M){return typeof M}:k=function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M},k(D)}var ft=function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},M=A.action,F=M===void 0?"copy":M,V=A.container,Y=A.target,$e=A.text;if(F!=="copy"&&F!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(Y!==void 0)if(Y&&k(Y)==="object"&&Y.nodeType===1){if(F==="copy"&&Y.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(F==="cut"&&(Y.hasAttribute("readonly")||Y.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if($e)return J($e,{container:V});if(Y)return F==="cut"?y(Y):J(Y,{container:V})},qe=ft;function Fe(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Fe=function(M){return typeof M}:Fe=function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M},Fe(D)}function ki(D,A){if(!(D instanceof A))throw new TypeError("Cannot call a class as a function")}function no(D,A){for(var M=0;M0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof V.action=="function"?V.action:this.defaultAction,this.target=typeof V.target=="function"?V.target:this.defaultTarget,this.text=typeof V.text=="function"?V.text:this.defaultText,this.container=Fe(V.container)==="object"?V.container:document.body}},{key:"listenClick",value:function(V){var Y=this;this.listener=c()(V,"click",function($e){return Y.onClick($e)})}},{key:"onClick",value:function(V){var Y=V.delegateTarget||V.currentTarget,$e=this.action(Y)||"copy",Wt=qe({action:$e,container:this.container,target:this.target(Y),text:this.text(Y)});this.emit(Wt?"success":"error",{action:$e,text:Wt,trigger:Y,clearSelection:function(){Y&&Y.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(V){return vr("action",V)}},{key:"defaultTarget",value:function(V){var Y=vr("target",V);if(Y)return document.querySelector(Y)}},{key:"defaultText",value:function(V){return vr("text",V)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(V){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return J(V,Y)}},{key:"cut",value:function(V){return y(V)}},{key:"isSupported",value:function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],Y=typeof V=="string"?[V]:V,$e=!!document.queryCommandSupported;return Y.forEach(function(Wt){$e=$e&&!!document.queryCommandSupported(Wt)}),$e}}]),M}(s()),Ui=Fi},828:function(o){var n=9;if(typeof Element!="undefined"&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}function a(s,p){for(;s&&s.nodeType!==n;){if(typeof s.matches=="function"&&s.matches(p))return s;s=s.parentNode}}o.exports=a},438:function(o,n,i){var a=i(828);function s(l,f,u,d,y){var L=c.apply(this,arguments);return l.addEventListener(u,L,y),{destroy:function(){l.removeEventListener(u,L,y)}}}function p(l,f,u,d,y){return typeof l.addEventListener=="function"?s.apply(null,arguments):typeof u=="function"?s.bind(null,document).apply(null,arguments):(typeof l=="string"&&(l=document.querySelectorAll(l)),Array.prototype.map.call(l,function(L){return s(L,f,u,d,y)}))}function c(l,f,u,d){return function(y){y.delegateTarget=a(y.target,f),y.delegateTarget&&d.call(l,y)}}o.exports=p},879:function(o,n){n.node=function(i){return i!==void 0&&i instanceof HTMLElement&&i.nodeType===1},n.nodeList=function(i){var a=Object.prototype.toString.call(i);return i!==void 0&&(a==="[object NodeList]"||a==="[object HTMLCollection]")&&"length"in i&&(i.length===0||n.node(i[0]))},n.string=function(i){return typeof i=="string"||i instanceof String},n.fn=function(i){var a=Object.prototype.toString.call(i);return a==="[object Function]"}},370:function(o,n,i){var a=i(879),s=i(438);function p(u,d,y){if(!u&&!d&&!y)throw new Error("Missing required arguments");if(!a.string(d))throw new TypeError("Second argument must be a String");if(!a.fn(y))throw new TypeError("Third argument must be a Function");if(a.node(u))return c(u,d,y);if(a.nodeList(u))return l(u,d,y);if(a.string(u))return f(u,d,y);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function c(u,d,y){return u.addEventListener(d,y),{destroy:function(){u.removeEventListener(d,y)}}}function l(u,d,y){return Array.prototype.forEach.call(u,function(L){L.addEventListener(d,y)}),{destroy:function(){Array.prototype.forEach.call(u,function(L){L.removeEventListener(d,y)})}}}function f(u,d,y){return s(document.body,u,d,y)}o.exports=p},817:function(o){function n(i){var a;if(i.nodeName==="SELECT")i.focus(),a=i.value;else if(i.nodeName==="INPUT"||i.nodeName==="TEXTAREA"){var s=i.hasAttribute("readonly");s||i.setAttribute("readonly",""),i.select(),i.setSelectionRange(0,i.value.length),s||i.removeAttribute("readonly"),a=i.value}else{i.hasAttribute("contenteditable")&&i.focus();var p=window.getSelection(),c=document.createRange();c.selectNodeContents(i),p.removeAllRanges(),p.addRange(c),a=p.toString()}return a}o.exports=n},279:function(o){function n(){}n.prototype={on:function(i,a,s){var p=this.e||(this.e={});return(p[i]||(p[i]=[])).push({fn:a,ctx:s}),this},once:function(i,a,s){var p=this;function c(){p.off(i,c),a.apply(s,arguments)}return c._=a,this.on(i,c,s)},emit:function(i){var a=[].slice.call(arguments,1),s=((this.e||(this.e={}))[i]||[]).slice(),p=0,c=s.length;for(p;p0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function N(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var o=r.call(e),n,i=[],a;try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(s){a={error:s}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(a)throw a.error}}return i}function q(e,t,r){if(r||arguments.length===2)for(var o=0,n=t.length,i;o1||p(d,L)})},y&&(n[d]=y(n[d])))}function p(d,y){try{c(o[d](y))}catch(L){u(i[0][3],L)}}function c(d){d.value instanceof nt?Promise.resolve(d.value.v).then(l,f):u(i[0][2],d)}function l(d){p("next",d)}function f(d){p("throw",d)}function u(d,y){d(y),i.shift(),i.length&&p(i[0][0],i[0][1])}}function uo(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof he=="function"?he(e):e[Symbol.iterator](),r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r);function o(i){r[i]=e[i]&&function(a){return new Promise(function(s,p){a=e[i](a),n(s,p,a.done,a.value)})}}function n(i,a,s,p){Promise.resolve(p).then(function(c){i({value:c,done:s})},a)}}function H(e){return typeof e=="function"}function ut(e){var t=function(o){Error.call(o),o.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Nt=ut(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription: + */(function(t,r){typeof Rt=="object"&&typeof Yr=="object"?Yr.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Rt=="object"?Rt.ClipboardJS=r():t.ClipboardJS=r()})(Rt,function(){return function(){var e={686:function(o,n,i){"use strict";i.d(n,{default:function(){return Ui}});var a=i(279),s=i.n(a),p=i(370),c=i.n(p),l=i(817),f=i.n(l);function u(D){try{return document.execCommand(D)}catch(A){return!1}}var d=function(A){var M=f()(A);return u("cut"),M},y=d;function L(D){var A=document.documentElement.getAttribute("dir")==="rtl",M=document.createElement("textarea");M.style.fontSize="12pt",M.style.border="0",M.style.padding="0",M.style.margin="0",M.style.position="absolute",M.style[A?"right":"left"]="-9999px";var F=window.pageYOffset||document.documentElement.scrollTop;return M.style.top="".concat(F,"px"),M.setAttribute("readonly",""),M.value=D,M}var X=function(A,M){var F=L(A);M.container.appendChild(F);var V=f()(F);return u("copy"),F.remove(),V},ee=function(A){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},F="";return typeof A=="string"?F=X(A,M):A instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(A==null?void 0:A.type)?F=X(A.value,M):(F=f()(A),u("copy")),F},J=ee;function k(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?k=function(M){return typeof M}:k=function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M},k(D)}var ft=function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},M=A.action,F=M===void 0?"copy":M,V=A.container,Y=A.target,$e=A.text;if(F!=="copy"&&F!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(Y!==void 0)if(Y&&k(Y)==="object"&&Y.nodeType===1){if(F==="copy"&&Y.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(F==="cut"&&(Y.hasAttribute("readonly")||Y.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if($e)return J($e,{container:V});if(Y)return F==="cut"?y(Y):J(Y,{container:V})},qe=ft;function Fe(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Fe=function(M){return typeof M}:Fe=function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M},Fe(D)}function ki(D,A){if(!(D instanceof A))throw new TypeError("Cannot call a class as a function")}function no(D,A){for(var M=0;M0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof V.action=="function"?V.action:this.defaultAction,this.target=typeof V.target=="function"?V.target:this.defaultTarget,this.text=typeof V.text=="function"?V.text:this.defaultText,this.container=Fe(V.container)==="object"?V.container:document.body}},{key:"listenClick",value:function(V){var Y=this;this.listener=c()(V,"click",function($e){return Y.onClick($e)})}},{key:"onClick",value:function(V){var Y=V.delegateTarget||V.currentTarget,$e=this.action(Y)||"copy",Wt=qe({action:$e,container:this.container,target:this.target(Y),text:this.text(Y)});this.emit(Wt?"success":"error",{action:$e,text:Wt,trigger:Y,clearSelection:function(){Y&&Y.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(V){return vr("action",V)}},{key:"defaultTarget",value:function(V){var Y=vr("target",V);if(Y)return document.querySelector(Y)}},{key:"defaultText",value:function(V){return vr("text",V)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(V){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return J(V,Y)}},{key:"cut",value:function(V){return y(V)}},{key:"isSupported",value:function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],Y=typeof V=="string"?[V]:V,$e=!!document.queryCommandSupported;return Y.forEach(function(Wt){$e=$e&&!!document.queryCommandSupported(Wt)}),$e}}]),M}(s()),Ui=Fi},828:function(o){var n=9;if(typeof Element!="undefined"&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}function a(s,p){for(;s&&s.nodeType!==n;){if(typeof s.matches=="function"&&s.matches(p))return s;s=s.parentNode}}o.exports=a},438:function(o,n,i){var a=i(828);function s(l,f,u,d,y){var L=c.apply(this,arguments);return l.addEventListener(u,L,y),{destroy:function(){l.removeEventListener(u,L,y)}}}function p(l,f,u,d,y){return typeof l.addEventListener=="function"?s.apply(null,arguments):typeof u=="function"?s.bind(null,document).apply(null,arguments):(typeof l=="string"&&(l=document.querySelectorAll(l)),Array.prototype.map.call(l,function(L){return s(L,f,u,d,y)}))}function c(l,f,u,d){return function(y){y.delegateTarget=a(y.target,f),y.delegateTarget&&d.call(l,y)}}o.exports=p},879:function(o,n){n.node=function(i){return i!==void 0&&i instanceof HTMLElement&&i.nodeType===1},n.nodeList=function(i){var a=Object.prototype.toString.call(i);return i!==void 0&&(a==="[object NodeList]"||a==="[object HTMLCollection]")&&"length"in i&&(i.length===0||n.node(i[0]))},n.string=function(i){return typeof i=="string"||i instanceof String},n.fn=function(i){var a=Object.prototype.toString.call(i);return a==="[object Function]"}},370:function(o,n,i){var a=i(879),s=i(438);function p(u,d,y){if(!u&&!d&&!y)throw new Error("Missing required arguments");if(!a.string(d))throw new TypeError("Second argument must be a String");if(!a.fn(y))throw new TypeError("Third argument must be a Function");if(a.node(u))return c(u,d,y);if(a.nodeList(u))return l(u,d,y);if(a.string(u))return f(u,d,y);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function c(u,d,y){return u.addEventListener(d,y),{destroy:function(){u.removeEventListener(d,y)}}}function l(u,d,y){return Array.prototype.forEach.call(u,function(L){L.addEventListener(d,y)}),{destroy:function(){Array.prototype.forEach.call(u,function(L){L.removeEventListener(d,y)})}}}function f(u,d,y){return s(document.body,u,d,y)}o.exports=p},817:function(o){function n(i){var a;if(i.nodeName==="SELECT")i.focus(),a=i.value;else if(i.nodeName==="INPUT"||i.nodeName==="TEXTAREA"){var s=i.hasAttribute("readonly");s||i.setAttribute("readonly",""),i.select(),i.setSelectionRange(0,i.value.length),s||i.removeAttribute("readonly"),a=i.value}else{i.hasAttribute("contenteditable")&&i.focus();var p=window.getSelection(),c=document.createRange();c.selectNodeContents(i),p.removeAllRanges(),p.addRange(c),a=p.toString()}return a}o.exports=n},279:function(o){function n(){}n.prototype={on:function(i,a,s){var p=this.e||(this.e={});return(p[i]||(p[i]=[])).push({fn:a,ctx:s}),this},once:function(i,a,s){var p=this;function c(){p.off(i,c),a.apply(s,arguments)}return c._=a,this.on(i,c,s)},emit:function(i){var a=[].slice.call(arguments,1),s=((this.e||(this.e={}))[i]||[]).slice(),p=0,c=s.length;for(p;p0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function z(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var o=r.call(e),n,i=[],a;try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(s){a={error:s}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(a)throw a.error}}return i}function q(e,t,r){if(r||arguments.length===2)for(var o=0,n=t.length,i;o1||p(d,L)})},y&&(n[d]=y(n[d])))}function p(d,y){try{c(o[d](y))}catch(L){u(i[0][3],L)}}function c(d){d.value instanceof nt?Promise.resolve(d.value.v).then(l,f):u(i[0][2],d)}function l(d){p("next",d)}function f(d){p("throw",d)}function u(d,y){d(y),i.shift(),i.length&&p(i[0][0],i[0][1])}}function uo(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof he=="function"?he(e):e[Symbol.iterator](),r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r);function o(i){r[i]=e[i]&&function(a){return new Promise(function(s,p){a=e[i](a),n(s,p,a.done,a.value)})}}function n(i,a,s,p){Promise.resolve(p).then(function(c){i({value:c,done:s})},a)}}function H(e){return typeof e=="function"}function ut(e){var t=function(o){Error.call(o),o.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var zt=ut(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription: `+r.map(function(o,n){return n+1+") "+o.toString()}).join(` - `):"",this.name="UnsubscriptionError",this.errors=r}});function Qe(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Ue=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,o,n,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=he(a),p=s.next();!p.done;p=s.next()){var c=p.value;c.remove(this)}}catch(L){t={error:L}}finally{try{p&&!p.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else a.remove(this);var l=this.initialTeardown;if(H(l))try{l()}catch(L){i=L instanceof Nt?L.errors:[L]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var u=he(f),d=u.next();!d.done;d=u.next()){var y=d.value;try{ho(y)}catch(L){i=i!=null?i:[],L instanceof Nt?i=q(q([],N(i)),N(L.errors)):i.push(L)}}}catch(L){o={error:L}}finally{try{d&&!d.done&&(n=u.return)&&n.call(u)}finally{if(o)throw o.error}}}if(i)throw new Nt(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)ho(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Qe(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Qe(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var Tr=Ue.EMPTY;function zt(e){return e instanceof Ue||e&&"closed"in e&&H(e.remove)&&H(e.add)&&H(e.unsubscribe)}function ho(e){H(e)?e():e.unsubscribe()}var Pe={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var dt={setTimeout:function(e,t){for(var r=[],o=2;o0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var o=this,n=this,i=n.hasError,a=n.isStopped,s=n.observers;return i||a?Tr:(this.currentObservers=null,s.push(r),new Ue(function(){o.currentObservers=null,Qe(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var o=this,n=o.hasError,i=o.thrownError,a=o.isStopped;n?r.error(i):a&&r.complete()},t.prototype.asObservable=function(){var r=new j;return r.source=this,r},t.create=function(r,o){return new To(r,o)},t}(j);var To=function(e){oe(t,e);function t(r,o){var n=e.call(this)||this;return n.destination=r,n.source=o,n}return t.prototype.next=function(r){var o,n;(n=(o=this.destination)===null||o===void 0?void 0:o.next)===null||n===void 0||n.call(o,r)},t.prototype.error=function(r){var o,n;(n=(o=this.destination)===null||o===void 0?void 0:o.error)===null||n===void 0||n.call(o,r)},t.prototype.complete=function(){var r,o;(o=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||o===void 0||o.call(r)},t.prototype._subscribe=function(r){var o,n;return(n=(o=this.source)===null||o===void 0?void 0:o.subscribe(r))!==null&&n!==void 0?n:Tr},t}(g);var _r=function(e){oe(t,e);function t(r){var o=e.call(this)||this;return o._value=r,o}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(r){var o=e.prototype._subscribe.call(this,r);return!o.closed&&r.next(this._value),o},t.prototype.getValue=function(){var r=this,o=r.hasError,n=r.thrownError,i=r._value;if(o)throw n;return this._throwIfClosed(),i},t.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},t}(g);var _t={now:function(){return(_t.delegate||Date).now()},delegate:void 0};var At=function(e){oe(t,e);function t(r,o,n){r===void 0&&(r=1/0),o===void 0&&(o=1/0),n===void 0&&(n=_t);var i=e.call(this)||this;return i._bufferSize=r,i._windowTime=o,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=o===1/0,i._bufferSize=Math.max(1,r),i._windowTime=Math.max(1,o),i}return t.prototype.next=function(r){var o=this,n=o.isStopped,i=o._buffer,a=o._infiniteTimeWindow,s=o._timestampProvider,p=o._windowTime;n||(i.push(r),!a&&i.push(s.now()+p)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var o=this._innerSubscribe(r),n=this,i=n._infiniteTimeWindow,a=n._buffer,s=a.slice(),p=0;p0?e.prototype.schedule.call(this,r,o):(this.delay=o,this.state=r,this.scheduler.flush(this),this)},t.prototype.execute=function(r,o){return o>0||this.closed?e.prototype.execute.call(this,r,o):this._execute(r,o)},t.prototype.requestAsyncId=function(r,o,n){return n===void 0&&(n=0),n!=null&&n>0||n==null&&this.delay>0?e.prototype.requestAsyncId.call(this,r,o,n):(r.flush(this),0)},t}(gt);var Lo=function(e){oe(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(yt);var kr=new Lo(Oo);var Mo=function(e){oe(t,e);function t(r,o){var n=e.call(this,r,o)||this;return n.scheduler=r,n.work=o,n}return t.prototype.requestAsyncId=function(r,o,n){return n===void 0&&(n=0),n!==null&&n>0?e.prototype.requestAsyncId.call(this,r,o,n):(r.actions.push(this),r._scheduled||(r._scheduled=vt.requestAnimationFrame(function(){return r.flush(void 0)})))},t.prototype.recycleAsyncId=function(r,o,n){var i;if(n===void 0&&(n=0),n!=null?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,r,o,n);var a=r.actions;o!=null&&o===r._scheduled&&((i=a[a.length-1])===null||i===void 0?void 0:i.id)!==o&&(vt.cancelAnimationFrame(o),r._scheduled=void 0)},t}(gt);var _o=function(e){oe(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(r){this._active=!0;var o;r?o=r.id:(o=this._scheduled,this._scheduled=void 0);var n=this.actions,i;r=r||n.shift();do if(i=r.execute(r.state,r.delay))break;while((r=n[0])&&r.id===o&&n.shift());if(this._active=!1,i){for(;(r=n[0])&&r.id===o&&n.shift();)r.unsubscribe();throw i}},t}(yt);var me=new _o(Mo);var S=new j(function(e){return e.complete()});function Kt(e){return e&&H(e.schedule)}function Hr(e){return e[e.length-1]}function Xe(e){return H(Hr(e))?e.pop():void 0}function ke(e){return Kt(Hr(e))?e.pop():void 0}function Yt(e,t){return typeof Hr(e)=="number"?e.pop():t}var xt=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function Bt(e){return H(e==null?void 0:e.then)}function Gt(e){return H(e[bt])}function Jt(e){return Symbol.asyncIterator&&H(e==null?void 0:e[Symbol.asyncIterator])}function Xt(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Zi(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Zt=Zi();function er(e){return H(e==null?void 0:e[Zt])}function tr(e){return fo(this,arguments,function(){var r,o,n,i;return Dt(this,function(a){switch(a.label){case 0:r=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,nt(r.read())];case 3:return o=a.sent(),n=o.value,i=o.done,i?[4,nt(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,nt(n)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function rr(e){return H(e==null?void 0:e.getReader)}function U(e){if(e instanceof j)return e;if(e!=null){if(Gt(e))return ea(e);if(xt(e))return ta(e);if(Bt(e))return ra(e);if(Jt(e))return Ao(e);if(er(e))return oa(e);if(rr(e))return na(e)}throw Xt(e)}function ea(e){return new j(function(t){var r=e[bt]();if(H(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function ta(e){return new j(function(t){for(var r=0;r=2;return function(o){return o.pipe(e?b(function(n,i){return e(n,i,o)}):le,Te(1),r?Ve(t):Qo(function(){return new nr}))}}function jr(e){return e<=0?function(){return S}:E(function(t,r){var o=[];t.subscribe(T(r,function(n){o.push(n),e=2,!0))}function pe(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new g}:t,o=e.resetOnError,n=o===void 0?!0:o,i=e.resetOnComplete,a=i===void 0?!0:i,s=e.resetOnRefCountZero,p=s===void 0?!0:s;return function(c){var l,f,u,d=0,y=!1,L=!1,X=function(){f==null||f.unsubscribe(),f=void 0},ee=function(){X(),l=u=void 0,y=L=!1},J=function(){var k=l;ee(),k==null||k.unsubscribe()};return E(function(k,ft){d++,!L&&!y&&X();var qe=u=u!=null?u:r();ft.add(function(){d--,d===0&&!L&&!y&&(f=Ur(J,p))}),qe.subscribe(ft),!l&&d>0&&(l=new at({next:function(Fe){return qe.next(Fe)},error:function(Fe){L=!0,X(),f=Ur(ee,n,Fe),qe.error(Fe)},complete:function(){y=!0,X(),f=Ur(ee,a),qe.complete()}}),U(k).subscribe(l))})(c)}}function Ur(e,t){for(var r=[],o=2;oe.next(document)),e}function P(e,t=document){return Array.from(t.querySelectorAll(e))}function R(e,t=document){let r=fe(e,t);if(typeof r=="undefined")throw new ReferenceError(`Missing element: expected "${e}" to be present`);return r}function fe(e,t=document){return t.querySelector(e)||void 0}function Ie(){var e,t,r,o;return(o=(r=(t=(e=document.activeElement)==null?void 0:e.shadowRoot)==null?void 0:t.activeElement)!=null?r:document.activeElement)!=null?o:void 0}var wa=O(h(document.body,"focusin"),h(document.body,"focusout")).pipe(_e(1),Q(void 0),m(()=>Ie()||document.body),G(1));function et(e){return wa.pipe(m(t=>e.contains(t)),K())}function Ht(e,t){return C(()=>O(h(e,"mouseenter").pipe(m(()=>!0)),h(e,"mouseleave").pipe(m(()=>!1))).pipe(t?kt(r=>Le(+!r*t)):le,Q(e.matches(":hover"))))}function Jo(e,t){if(typeof t=="string"||typeof t=="number")e.innerHTML+=t.toString();else if(t instanceof Node)e.appendChild(t);else if(Array.isArray(t))for(let r of t)Jo(e,r)}function x(e,t,...r){let o=document.createElement(e);if(t)for(let n of Object.keys(t))typeof t[n]!="undefined"&&(typeof t[n]!="boolean"?o.setAttribute(n,t[n]):o.setAttribute(n,""));for(let n of r)Jo(o,n);return o}function sr(e){if(e>999){let t=+((e-950)%1e3>99);return`${((e+1e-6)/1e3).toFixed(t)}k`}else return e.toString()}function wt(e){let t=x("script",{src:e});return C(()=>(document.head.appendChild(t),O(h(t,"load"),h(t,"error").pipe(v(()=>$r(()=>new ReferenceError(`Invalid script: ${e}`))))).pipe(m(()=>{}),_(()=>document.head.removeChild(t)),Te(1))))}var Xo=new g,Ta=C(()=>typeof ResizeObserver=="undefined"?wt("https://unpkg.com/resize-observer-polyfill"):I(void 0)).pipe(m(()=>new ResizeObserver(e=>e.forEach(t=>Xo.next(t)))),v(e=>O(Ye,I(e)).pipe(_(()=>e.disconnect()))),G(1));function ce(e){return{width:e.offsetWidth,height:e.offsetHeight}}function ge(e){let t=e;for(;t.clientWidth===0&&t.parentElement;)t=t.parentElement;return Ta.pipe(w(r=>r.observe(t)),v(r=>Xo.pipe(b(o=>o.target===t),_(()=>r.unobserve(t)))),m(()=>ce(e)),Q(ce(e)))}function Tt(e){return{width:e.scrollWidth,height:e.scrollHeight}}function cr(e){let t=e.parentElement;for(;t&&(e.scrollWidth<=t.scrollWidth&&e.scrollHeight<=t.scrollHeight);)t=(e=t).parentElement;return t?e:void 0}function Zo(e){let t=[],r=e.parentElement;for(;r;)(e.clientWidth>r.clientWidth||e.clientHeight>r.clientHeight)&&t.push(r),r=(e=r).parentElement;return t.length===0&&t.push(document.documentElement),t}function De(e){return{x:e.offsetLeft,y:e.offsetTop}}function en(e){let t=e.getBoundingClientRect();return{x:t.x+window.scrollX,y:t.y+window.scrollY}}function tn(e){return O(h(window,"load"),h(window,"resize")).pipe(Me(0,me),m(()=>De(e)),Q(De(e)))}function pr(e){return{x:e.scrollLeft,y:e.scrollTop}}function Ne(e){return O(h(e,"scroll"),h(window,"scroll"),h(window,"resize")).pipe(Me(0,me),m(()=>pr(e)),Q(pr(e)))}var rn=new g,Sa=C(()=>I(new IntersectionObserver(e=>{for(let t of e)rn.next(t)},{threshold:0}))).pipe(v(e=>O(Ye,I(e)).pipe(_(()=>e.disconnect()))),G(1));function tt(e){return Sa.pipe(w(t=>t.observe(e)),v(t=>rn.pipe(b(({target:r})=>r===e),_(()=>t.unobserve(e)),m(({isIntersecting:r})=>r))))}function on(e,t=16){return Ne(e).pipe(m(({y:r})=>{let o=ce(e),n=Tt(e);return r>=n.height-o.height-t}),K())}var lr={drawer:R("[data-md-toggle=drawer]"),search:R("[data-md-toggle=search]")};function nn(e){return lr[e].checked}function Je(e,t){lr[e].checked!==t&&lr[e].click()}function ze(e){let t=lr[e];return h(t,"change").pipe(m(()=>t.checked),Q(t.checked))}function Oa(e,t){switch(e.constructor){case HTMLInputElement:return e.type==="radio"?/^Arrow/.test(t):!0;case HTMLSelectElement:case HTMLTextAreaElement:return!0;default:return e.isContentEditable}}function La(){return O(h(window,"compositionstart").pipe(m(()=>!0)),h(window,"compositionend").pipe(m(()=>!1))).pipe(Q(!1))}function an(){let e=h(window,"keydown").pipe(b(t=>!(t.metaKey||t.ctrlKey)),m(t=>({mode:nn("search")?"search":"global",type:t.key,claim(){t.preventDefault(),t.stopPropagation()}})),b(({mode:t,type:r})=>{if(t==="global"){let o=Ie();if(typeof o!="undefined")return!Oa(o,r)}return!0}),pe());return La().pipe(v(t=>t?S:e))}function ye(){return new URL(location.href)}function lt(e,t=!1){if(B("navigation.instant")&&!t){let r=x("a",{href:e.href});document.body.appendChild(r),r.click(),r.remove()}else location.href=e.href}function sn(){return new g}function cn(){return location.hash.slice(1)}function pn(e){let t=x("a",{href:e});t.addEventListener("click",r=>r.stopPropagation()),t.click()}function Ma(e){return O(h(window,"hashchange"),e).pipe(m(cn),Q(cn()),b(t=>t.length>0),G(1))}function ln(e){return Ma(e).pipe(m(t=>fe(`[id="${t}"]`)),b(t=>typeof t!="undefined"))}function $t(e){let t=matchMedia(e);return ir(r=>t.addListener(()=>r(t.matches))).pipe(Q(t.matches))}function mn(){let e=matchMedia("print");return O(h(window,"beforeprint").pipe(m(()=>!0)),h(window,"afterprint").pipe(m(()=>!1))).pipe(Q(e.matches))}function Nr(e,t){return e.pipe(v(r=>r?t():S))}function zr(e,t){return new j(r=>{let o=new XMLHttpRequest;return o.open("GET",`${e}`),o.responseType="blob",o.addEventListener("load",()=>{o.status>=200&&o.status<300?(r.next(o.response),r.complete()):r.error(new Error(o.statusText))}),o.addEventListener("error",()=>{r.error(new Error("Network error"))}),o.addEventListener("abort",()=>{r.complete()}),typeof(t==null?void 0:t.progress$)!="undefined"&&(o.addEventListener("progress",n=>{var i;if(n.lengthComputable)t.progress$.next(n.loaded/n.total*100);else{let a=(i=o.getResponseHeader("Content-Length"))!=null?i:0;t.progress$.next(n.loaded/+a*100)}}),t.progress$.next(5)),o.send(),()=>o.abort()})}function je(e,t){return zr(e,t).pipe(v(r=>r.text()),m(r=>JSON.parse(r)),G(1))}function fn(e,t){let r=new DOMParser;return zr(e,t).pipe(v(o=>o.text()),m(o=>r.parseFromString(o,"text/html")),G(1))}function un(e,t){let r=new DOMParser;return zr(e,t).pipe(v(o=>o.text()),m(o=>r.parseFromString(o,"text/xml")),G(1))}function dn(){return{x:Math.max(0,scrollX),y:Math.max(0,scrollY)}}function hn(){return O(h(window,"scroll",{passive:!0}),h(window,"resize",{passive:!0})).pipe(m(dn),Q(dn()))}function bn(){return{width:innerWidth,height:innerHeight}}function vn(){return h(window,"resize",{passive:!0}).pipe(m(bn),Q(bn()))}function gn(){return z([hn(),vn()]).pipe(m(([e,t])=>({offset:e,size:t})),G(1))}function mr(e,{viewport$:t,header$:r}){let o=t.pipe(te("size")),n=z([o,r]).pipe(m(()=>De(e)));return z([r,t,n]).pipe(m(([{height:i},{offset:a,size:s},{x:p,y:c}])=>({offset:{x:a.x-p,y:a.y-c+i},size:s})))}function _a(e){return h(e,"message",t=>t.data)}function Aa(e){let t=new g;return t.subscribe(r=>e.postMessage(r)),t}function yn(e,t=new Worker(e)){let r=_a(t),o=Aa(t),n=new g;n.subscribe(o);let i=o.pipe(Z(),ie(!0));return n.pipe(Z(),Re(r.pipe(W(i))),pe())}var Ca=R("#__config"),St=JSON.parse(Ca.textContent);St.base=`${new URL(St.base,ye())}`;function xe(){return St}function B(e){return St.features.includes(e)}function Ee(e,t){return typeof t!="undefined"?St.translations[e].replace("#",t.toString()):St.translations[e]}function Se(e,t=document){return R(`[data-md-component=${e}]`,t)}function ae(e,t=document){return P(`[data-md-component=${e}]`,t)}function ka(e){let t=R(".md-typeset > :first-child",e);return h(t,"click",{once:!0}).pipe(m(()=>R(".md-typeset",e)),m(r=>({hash:__md_hash(r.innerHTML)})))}function xn(e){if(!B("announce.dismiss")||!e.childElementCount)return S;if(!e.hidden){let t=R(".md-typeset",e);__md_hash(t.innerHTML)===__md_get("__announce")&&(e.hidden=!0)}return C(()=>{let t=new g;return t.subscribe(({hash:r})=>{e.hidden=!0,__md_set("__announce",r)}),ka(e).pipe(w(r=>t.next(r)),_(()=>t.complete()),m(r=>$({ref:e},r)))})}function Ha(e,{target$:t}){return t.pipe(m(r=>({hidden:r!==e})))}function En(e,t){let r=new g;return r.subscribe(({hidden:o})=>{e.hidden=o}),Ha(e,t).pipe(w(o=>r.next(o)),_(()=>r.complete()),m(o=>$({ref:e},o)))}function Pt(e,t){return t==="inline"?x("div",{class:"md-tooltip md-tooltip--inline",id:e,role:"tooltip"},x("div",{class:"md-tooltip__inner md-typeset"})):x("div",{class:"md-tooltip",id:e,role:"tooltip"},x("div",{class:"md-tooltip__inner md-typeset"}))}function wn(...e){return x("div",{class:"md-tooltip2",role:"tooltip"},x("div",{class:"md-tooltip2__inner md-typeset"},e))}function Tn(e,t){if(t=t?`${t}_annotation_${e}`:void 0,t){let r=t?`#${t}`:void 0;return x("aside",{class:"md-annotation",tabIndex:0},Pt(t),x("a",{href:r,class:"md-annotation__index",tabIndex:-1},x("span",{"data-md-annotation-id":e})))}else return x("aside",{class:"md-annotation",tabIndex:0},Pt(t),x("span",{class:"md-annotation__index",tabIndex:-1},x("span",{"data-md-annotation-id":e})))}function Sn(e){return x("button",{class:"md-clipboard md-icon",title:Ee("clipboard.copy"),"data-clipboard-target":`#${e} > code`})}var Ln=Lt(qr());function Qr(e,t){let r=t&2,o=t&1,n=Object.keys(e.terms).filter(p=>!e.terms[p]).reduce((p,c)=>[...p,x("del",null,(0,Ln.default)(c))," "],[]).slice(0,-1),i=xe(),a=new URL(e.location,i.base);B("search.highlight")&&a.searchParams.set("h",Object.entries(e.terms).filter(([,p])=>p).reduce((p,[c])=>`${p} ${c}`.trim(),""));let{tags:s}=xe();return x("a",{href:`${a}`,class:"md-search-result__link",tabIndex:-1},x("article",{class:"md-search-result__article md-typeset","data-md-score":e.score.toFixed(2)},r>0&&x("div",{class:"md-search-result__icon md-icon"}),r>0&&x("h1",null,e.title),r<=0&&x("h2",null,e.title),o>0&&e.text.length>0&&e.text,e.tags&&x("nav",{class:"md-tags"},e.tags.map(p=>{let c=s?p in s?`md-tag-icon md-tag--${s[p]}`:"md-tag-icon":"";return x("span",{class:`md-tag ${c}`},p)})),o>0&&n.length>0&&x("p",{class:"md-search-result__terms"},Ee("search.result.term.missing"),": ",...n)))}function Mn(e){let t=e[0].score,r=[...e],o=xe(),n=r.findIndex(l=>!`${new URL(l.location,o.base)}`.includes("#")),[i]=r.splice(n,1),a=r.findIndex(l=>l.scoreQr(l,1)),...p.length?[x("details",{class:"md-search-result__more"},x("summary",{tabIndex:-1},x("div",null,p.length>0&&p.length===1?Ee("search.result.more.one"):Ee("search.result.more.other",p.length))),...p.map(l=>Qr(l,1)))]:[]];return x("li",{class:"md-search-result__item"},c)}function _n(e){return x("ul",{class:"md-source__facts"},Object.entries(e).map(([t,r])=>x("li",{class:`md-source__fact md-source__fact--${t}`},typeof r=="number"?sr(r):r)))}function Kr(e){let t=`tabbed-control tabbed-control--${e}`;return x("div",{class:t,hidden:!0},x("button",{class:"tabbed-button",tabIndex:-1,"aria-hidden":"true"}))}function An(e){return x("div",{class:"md-typeset__scrollwrap"},x("div",{class:"md-typeset__table"},e))}function Ra(e){var o;let t=xe(),r=new URL(`../${e.version}/`,t.base);return x("li",{class:"md-version__item"},x("a",{href:`${r}`,class:"md-version__link"},e.title,((o=t.version)==null?void 0:o.alias)&&e.aliases.length>0&&x("span",{class:"md-version__alias"},e.aliases[0])))}function Cn(e,t){var o;let r=xe();return e=e.filter(n=>{var i;return!((i=n.properties)!=null&&i.hidden)}),x("div",{class:"md-version"},x("button",{class:"md-version__current","aria-label":Ee("select.version")},t.title,((o=r.version)==null?void 0:o.alias)&&t.aliases.length>0&&x("span",{class:"md-version__alias"},t.aliases[0])),x("ul",{class:"md-version__list"},e.map(Ra)))}var Ia=0;function ja(e){let t=z([et(e),Ht(e)]).pipe(m(([o,n])=>o||n),K()),r=C(()=>Zo(e)).pipe(ne(Ne),pt(1),He(t),m(()=>en(e)));return t.pipe(Ae(o=>o),v(()=>z([t,r])),m(([o,n])=>({active:o,offset:n})),pe())}function Fa(e,t){let{content$:r,viewport$:o}=t,n=`__tooltip2_${Ia++}`;return C(()=>{let i=new g,a=new _r(!1);i.pipe(Z(),ie(!1)).subscribe(a);let s=a.pipe(kt(c=>Le(+!c*250,kr)),K(),v(c=>c?r:S),w(c=>c.id=n),pe());z([i.pipe(m(({active:c})=>c)),s.pipe(v(c=>Ht(c,250)),Q(!1))]).pipe(m(c=>c.some(l=>l))).subscribe(a);let p=a.pipe(b(c=>c),re(s,o),m(([c,l,{size:f}])=>{let u=e.getBoundingClientRect(),d=u.width/2;if(l.role==="tooltip")return{x:d,y:8+u.height};if(u.y>=f.height/2){let{height:y}=ce(l);return{x:d,y:-16-y}}else return{x:d,y:16+u.height}}));return z([s,i,p]).subscribe(([c,{offset:l},f])=>{c.style.setProperty("--md-tooltip-host-x",`${l.x}px`),c.style.setProperty("--md-tooltip-host-y",`${l.y}px`),c.style.setProperty("--md-tooltip-x",`${f.x}px`),c.style.setProperty("--md-tooltip-y",`${f.y}px`),c.classList.toggle("md-tooltip2--top",f.y<0),c.classList.toggle("md-tooltip2--bottom",f.y>=0)}),a.pipe(b(c=>c),re(s,(c,l)=>l),b(c=>c.role==="tooltip")).subscribe(c=>{let l=ce(R(":scope > *",c));c.style.setProperty("--md-tooltip-width",`${l.width}px`),c.style.setProperty("--md-tooltip-tail","0px")}),a.pipe(K(),ve(me),re(s)).subscribe(([c,l])=>{l.classList.toggle("md-tooltip2--active",c)}),z([a.pipe(b(c=>c)),s]).subscribe(([c,l])=>{l.role==="dialog"?(e.setAttribute("aria-controls",n),e.setAttribute("aria-haspopup","dialog")):e.setAttribute("aria-describedby",n)}),a.pipe(b(c=>!c)).subscribe(()=>{e.removeAttribute("aria-controls"),e.removeAttribute("aria-describedby"),e.removeAttribute("aria-haspopup")}),ja(e).pipe(w(c=>i.next(c)),_(()=>i.complete()),m(c=>$({ref:e},c)))})}function mt(e,{viewport$:t},r=document.body){return Fa(e,{content$:new j(o=>{let n=e.title,i=wn(n);return o.next(i),e.removeAttribute("title"),r.append(i),()=>{i.remove(),e.setAttribute("title",n)}}),viewport$:t})}function Ua(e,t){let r=C(()=>z([tn(e),Ne(t)])).pipe(m(([{x:o,y:n},i])=>{let{width:a,height:s}=ce(e);return{x:o-i.x+a/2,y:n-i.y+s/2}}));return et(e).pipe(v(o=>r.pipe(m(n=>({active:o,offset:n})),Te(+!o||1/0))))}function kn(e,t,{target$:r}){let[o,n]=Array.from(e.children);return C(()=>{let i=new g,a=i.pipe(Z(),ie(!0));return i.subscribe({next({offset:s}){e.style.setProperty("--md-tooltip-x",`${s.x}px`),e.style.setProperty("--md-tooltip-y",`${s.y}px`)},complete(){e.style.removeProperty("--md-tooltip-x"),e.style.removeProperty("--md-tooltip-y")}}),tt(e).pipe(W(a)).subscribe(s=>{e.toggleAttribute("data-md-visible",s)}),O(i.pipe(b(({active:s})=>s)),i.pipe(_e(250),b(({active:s})=>!s))).subscribe({next({active:s}){s?e.prepend(o):o.remove()},complete(){e.prepend(o)}}),i.pipe(Me(16,me)).subscribe(({active:s})=>{o.classList.toggle("md-tooltip--active",s)}),i.pipe(pt(125,me),b(()=>!!e.offsetParent),m(()=>e.offsetParent.getBoundingClientRect()),m(({x:s})=>s)).subscribe({next(s){s?e.style.setProperty("--md-tooltip-0",`${-s}px`):e.style.removeProperty("--md-tooltip-0")},complete(){e.style.removeProperty("--md-tooltip-0")}}),h(n,"click").pipe(W(a),b(s=>!(s.metaKey||s.ctrlKey))).subscribe(s=>{s.stopPropagation(),s.preventDefault()}),h(n,"mousedown").pipe(W(a),re(i)).subscribe(([s,{active:p}])=>{var c;if(s.button!==0||s.metaKey||s.ctrlKey)s.preventDefault();else if(p){s.preventDefault();let l=e.parentElement.closest(".md-annotation");l instanceof HTMLElement?l.focus():(c=Ie())==null||c.blur()}}),r.pipe(W(a),b(s=>s===o),Ge(125)).subscribe(()=>e.focus()),Ua(e,t).pipe(w(s=>i.next(s)),_(()=>i.complete()),m(s=>$({ref:e},s)))})}function Wa(e){return e.tagName==="CODE"?P(".c, .c1, .cm",e):[e]}function Va(e){let t=[];for(let r of Wa(e)){let o=[],n=document.createNodeIterator(r,NodeFilter.SHOW_TEXT);for(let i=n.nextNode();i;i=n.nextNode())o.push(i);for(let i of o){let a;for(;a=/(\(\d+\))(!)?/.exec(i.textContent);){let[,s,p]=a;if(typeof p=="undefined"){let c=i.splitText(a.index);i=c.splitText(s.length),t.push(c)}else{i.textContent=s,t.push(i);break}}}}return t}function Hn(e,t){t.append(...Array.from(e.childNodes))}function fr(e,t,{target$:r,print$:o}){let n=t.closest("[id]"),i=n==null?void 0:n.id,a=new Map;for(let s of Va(t)){let[,p]=s.textContent.match(/\((\d+)\)/);fe(`:scope > li:nth-child(${p})`,e)&&(a.set(p,Tn(p,i)),s.replaceWith(a.get(p)))}return a.size===0?S:C(()=>{let s=new g,p=s.pipe(Z(),ie(!0)),c=[];for(let[l,f]of a)c.push([R(".md-typeset",f),R(`:scope > li:nth-child(${l})`,e)]);return o.pipe(W(p)).subscribe(l=>{e.hidden=!l,e.classList.toggle("md-annotation-list",l);for(let[f,u]of c)l?Hn(f,u):Hn(u,f)}),O(...[...a].map(([,l])=>kn(l,t,{target$:r}))).pipe(_(()=>s.complete()),pe())})}function $n(e){if(e.nextElementSibling){let t=e.nextElementSibling;if(t.tagName==="OL")return t;if(t.tagName==="P"&&!t.children.length)return $n(t)}}function Pn(e,t){return C(()=>{let r=$n(e);return typeof r!="undefined"?fr(r,e,t):S})}var Rn=Lt(Br());var Da=0;function In(e){if(e.nextElementSibling){let t=e.nextElementSibling;if(t.tagName==="OL")return t;if(t.tagName==="P"&&!t.children.length)return In(t)}}function Na(e){return ge(e).pipe(m(({width:t})=>({scrollable:Tt(e).width>t})),te("scrollable"))}function jn(e,t){let{matches:r}=matchMedia("(hover)"),o=C(()=>{let n=new g,i=n.pipe(jr(1));n.subscribe(({scrollable:c})=>{c&&r?e.setAttribute("tabindex","0"):e.removeAttribute("tabindex")});let a=[];if(Rn.default.isSupported()&&(e.closest(".copy")||B("content.code.copy")&&!e.closest(".no-copy"))){let c=e.closest("pre");c.id=`__code_${Da++}`;let l=Sn(c.id);c.insertBefore(l,e),B("content.tooltips")&&a.push(mt(l,{viewport$}))}let s=e.closest(".highlight");if(s instanceof HTMLElement){let c=In(s);if(typeof c!="undefined"&&(s.classList.contains("annotate")||B("content.code.annotate"))){let l=fr(c,e,t);a.push(ge(s).pipe(W(i),m(({width:f,height:u})=>f&&u),K(),v(f=>f?l:S)))}}return P(":scope > span[id]",e).length&&e.classList.add("md-code__content"),Na(e).pipe(w(c=>n.next(c)),_(()=>n.complete()),m(c=>$({ref:e},c)),Re(...a))});return B("content.lazy")?tt(e).pipe(b(n=>n),Te(1),v(()=>o)):o}function za(e,{target$:t,print$:r}){let o=!0;return O(t.pipe(m(n=>n.closest("details:not([open])")),b(n=>e===n),m(()=>({action:"open",reveal:!0}))),r.pipe(b(n=>n||!o),w(()=>o=e.open),m(n=>({action:n?"open":"close"}))))}function Fn(e,t){return C(()=>{let r=new g;return r.subscribe(({action:o,reveal:n})=>{e.toggleAttribute("open",o==="open"),n&&e.scrollIntoView()}),za(e,t).pipe(w(o=>r.next(o)),_(()=>r.complete()),m(o=>$({ref:e},o)))})}var Un=".node circle,.node ellipse,.node path,.node polygon,.node rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}marker{fill:var(--md-mermaid-edge-color)!important}.edgeLabel .label rect{fill:#0000}.flowchartTitleText{fill:var(--md-mermaid-label-fg-color)}.label{color:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.label foreignObject{line-height:normal;overflow:visible}.label div .edgeLabel{color:var(--md-mermaid-label-fg-color)}.edgeLabel,.edgeLabel p,.label div .edgeLabel{background-color:var(--md-mermaid-label-bg-color)}.edgeLabel,.edgeLabel p{fill:var(--md-mermaid-label-bg-color);color:var(--md-mermaid-edge-color)}.edgePath .path,.flowchart-link{stroke:var(--md-mermaid-edge-color);stroke-width:.05rem}.edgePath .arrowheadPath{fill:var(--md-mermaid-edge-color);stroke:none}.cluster rect{fill:var(--md-default-fg-color--lightest);stroke:var(--md-default-fg-color--lighter)}.cluster span{color:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}g #flowchart-circleEnd,g #flowchart-circleStart,g #flowchart-crossEnd,g #flowchart-crossStart,g #flowchart-pointEnd,g #flowchart-pointStart{stroke:none}.classDiagramTitleText{fill:var(--md-mermaid-label-fg-color)}g.classGroup line,g.classGroup rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}g.classGroup text{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.classLabel .box{fill:var(--md-mermaid-label-bg-color);background-color:var(--md-mermaid-label-bg-color);opacity:1}.classLabel .label{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.node .divider{stroke:var(--md-mermaid-node-fg-color)}.relation{stroke:var(--md-mermaid-edge-color)}.cardinality{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.cardinality text{fill:inherit!important}defs marker.marker.composition.class path,defs marker.marker.dependency.class path,defs marker.marker.extension.class path{fill:var(--md-mermaid-edge-color)!important;stroke:var(--md-mermaid-edge-color)!important}defs marker.marker.aggregation.class path{fill:var(--md-mermaid-label-bg-color)!important;stroke:var(--md-mermaid-edge-color)!important}.statediagramTitleText{fill:var(--md-mermaid-label-fg-color)}g.stateGroup rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}g.stateGroup .state-title{fill:var(--md-mermaid-label-fg-color)!important;font-family:var(--md-mermaid-font-family)}g.stateGroup .composit{fill:var(--md-mermaid-label-bg-color)}.nodeLabel,.nodeLabel p{color:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}a .nodeLabel{text-decoration:underline}.node circle.state-end,.node circle.state-start,.start-state{fill:var(--md-mermaid-edge-color);stroke:none}.end-state-inner,.end-state-outer{fill:var(--md-mermaid-edge-color)}.end-state-inner,.node circle.state-end{stroke:var(--md-mermaid-label-bg-color)}.transition{stroke:var(--md-mermaid-edge-color)}[id^=state-fork] rect,[id^=state-join] rect{fill:var(--md-mermaid-edge-color)!important;stroke:none!important}.statediagram-cluster.statediagram-cluster .inner{fill:var(--md-default-bg-color)}.statediagram-cluster rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}.statediagram-state rect.divider{fill:var(--md-default-fg-color--lightest);stroke:var(--md-default-fg-color--lighter)}defs #statediagram-barbEnd{stroke:var(--md-mermaid-edge-color)}.entityTitleText{fill:var(--md-mermaid-label-fg-color)}.attributeBoxEven,.attributeBoxOdd{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}.entityBox{fill:var(--md-mermaid-label-bg-color);stroke:var(--md-mermaid-node-fg-color)}.entityLabel{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.relationshipLabelBox{fill:var(--md-mermaid-label-bg-color);fill-opacity:1;background-color:var(--md-mermaid-label-bg-color);opacity:1}.relationshipLabel{fill:var(--md-mermaid-label-fg-color)}.relationshipLine{stroke:var(--md-mermaid-edge-color)}defs #ONE_OR_MORE_END *,defs #ONE_OR_MORE_START *,defs #ONLY_ONE_END *,defs #ONLY_ONE_START *,defs #ZERO_OR_MORE_END *,defs #ZERO_OR_MORE_START *,defs #ZERO_OR_ONE_END *,defs #ZERO_OR_ONE_START *{stroke:var(--md-mermaid-edge-color)!important}defs #ZERO_OR_MORE_END circle,defs #ZERO_OR_MORE_START circle{fill:var(--md-mermaid-label-bg-color)}text:not([class]):last-child{fill:var(--md-mermaid-label-fg-color)}.actor{fill:var(--md-mermaid-sequence-actor-bg-color);stroke:var(--md-mermaid-sequence-actor-border-color)}text.actor>tspan{fill:var(--md-mermaid-sequence-actor-fg-color);font-family:var(--md-mermaid-font-family)}line{stroke:var(--md-mermaid-sequence-actor-line-color)}.actor-man circle,.actor-man line{fill:var(--md-mermaid-sequence-actorman-bg-color);stroke:var(--md-mermaid-sequence-actorman-line-color)}.messageLine0,.messageLine1{stroke:var(--md-mermaid-sequence-message-line-color)}.note{fill:var(--md-mermaid-sequence-note-bg-color);stroke:var(--md-mermaid-sequence-note-border-color)}.loopText,.loopText>tspan,.messageText,.noteText>tspan{stroke:none;font-family:var(--md-mermaid-font-family)!important}.messageText{fill:var(--md-mermaid-sequence-message-fg-color)}.loopText,.loopText>tspan{fill:var(--md-mermaid-sequence-loop-fg-color)}.noteText>tspan{fill:var(--md-mermaid-sequence-note-fg-color)}#arrowhead path{fill:var(--md-mermaid-sequence-message-line-color);stroke:none}.loopLine{fill:var(--md-mermaid-sequence-loop-bg-color);stroke:var(--md-mermaid-sequence-loop-border-color)}.labelBox{fill:var(--md-mermaid-sequence-label-bg-color);stroke:none}.labelText,.labelText>span{fill:var(--md-mermaid-sequence-label-fg-color);font-family:var(--md-mermaid-font-family)}.sequenceNumber{fill:var(--md-mermaid-sequence-number-fg-color)}rect.rect{fill:var(--md-mermaid-sequence-box-bg-color);stroke:none}rect.rect+text.text{fill:var(--md-mermaid-sequence-box-fg-color)}defs #sequencenumber{fill:var(--md-mermaid-sequence-number-bg-color)!important}";var Gr,Qa=0;function Ka(){return typeof mermaid=="undefined"||mermaid instanceof Element?wt("https://unpkg.com/mermaid@11/dist/mermaid.min.js"):I(void 0)}function Wn(e){return e.classList.remove("mermaid"),Gr||(Gr=Ka().pipe(w(()=>mermaid.initialize({startOnLoad:!1,themeCSS:Un,sequence:{actorFontSize:"16px",messageFontSize:"16px",noteFontSize:"16px"}})),m(()=>{}),G(1))),Gr.subscribe(()=>co(this,null,function*(){e.classList.add("mermaid");let t=`__mermaid_${Qa++}`,r=x("div",{class:"mermaid"}),o=e.textContent,{svg:n,fn:i}=yield mermaid.render(t,o),a=r.attachShadow({mode:"closed"});a.innerHTML=n,e.replaceWith(r),i==null||i(a)})),Gr.pipe(m(()=>({ref:e})))}var Vn=x("table");function Dn(e){return e.replaceWith(Vn),Vn.replaceWith(An(e)),I({ref:e})}function Ya(e){let t=e.find(r=>r.checked)||e[0];return O(...e.map(r=>h(r,"change").pipe(m(()=>R(`label[for="${r.id}"]`))))).pipe(Q(R(`label[for="${t.id}"]`)),m(r=>({active:r})))}function Nn(e,{viewport$:t,target$:r}){let o=R(".tabbed-labels",e),n=P(":scope > input",e),i=Kr("prev");e.append(i);let a=Kr("next");return e.append(a),C(()=>{let s=new g,p=s.pipe(Z(),ie(!0));z([s,ge(e),tt(e)]).pipe(W(p),Me(1,me)).subscribe({next([{active:c},l]){let f=De(c),{width:u}=ce(c);e.style.setProperty("--md-indicator-x",`${f.x}px`),e.style.setProperty("--md-indicator-width",`${u}px`);let d=pr(o);(f.xd.x+l.width)&&o.scrollTo({left:Math.max(0,f.x-16),behavior:"smooth"})},complete(){e.style.removeProperty("--md-indicator-x"),e.style.removeProperty("--md-indicator-width")}}),z([Ne(o),ge(o)]).pipe(W(p)).subscribe(([c,l])=>{let f=Tt(o);i.hidden=c.x<16,a.hidden=c.x>f.width-l.width-16}),O(h(i,"click").pipe(m(()=>-1)),h(a,"click").pipe(m(()=>1))).pipe(W(p)).subscribe(c=>{let{width:l}=ce(o);o.scrollBy({left:l*c,behavior:"smooth"})}),r.pipe(W(p),b(c=>n.includes(c))).subscribe(c=>c.click()),o.classList.add("tabbed-labels--linked");for(let c of n){let l=R(`label[for="${c.id}"]`);l.replaceChildren(x("a",{href:`#${l.htmlFor}`,tabIndex:-1},...Array.from(l.childNodes))),h(l.firstElementChild,"click").pipe(W(p),b(f=>!(f.metaKey||f.ctrlKey)),w(f=>{f.preventDefault(),f.stopPropagation()})).subscribe(()=>{history.replaceState({},"",`#${l.htmlFor}`),l.click()})}return B("content.tabs.link")&&s.pipe(Ce(1),re(t)).subscribe(([{active:c},{offset:l}])=>{let f=c.innerText.trim();if(c.hasAttribute("data-md-switching"))c.removeAttribute("data-md-switching");else{let u=e.offsetTop-l.y;for(let y of P("[data-tabs]"))for(let L of P(":scope > input",y)){let X=R(`label[for="${L.id}"]`);if(X!==c&&X.innerText.trim()===f){X.setAttribute("data-md-switching",""),L.click();break}}window.scrollTo({top:e.offsetTop-u});let d=__md_get("__tabs")||[];__md_set("__tabs",[...new Set([f,...d])])}}),s.pipe(W(p)).subscribe(()=>{for(let c of P("audio, video",e))c.pause()}),Ya(n).pipe(w(c=>s.next(c)),_(()=>s.complete()),m(c=>$({ref:e},c)))}).pipe(Ke(se))}function zn(e,{viewport$:t,target$:r,print$:o}){return O(...P(".annotate:not(.highlight)",e).map(n=>Pn(n,{target$:r,print$:o})),...P("pre:not(.mermaid) > code",e).map(n=>jn(n,{target$:r,print$:o})),...P("pre.mermaid",e).map(n=>Wn(n)),...P("table:not([class])",e).map(n=>Dn(n)),...P("details",e).map(n=>Fn(n,{target$:r,print$:o})),...P("[data-tabs]",e).map(n=>Nn(n,{viewport$:t,target$:r})),...P("[title]",e).filter(()=>B("content.tooltips")).map(n=>mt(n,{viewport$:t})))}function Ba(e,{alert$:t}){return t.pipe(v(r=>O(I(!0),I(!1).pipe(Ge(2e3))).pipe(m(o=>({message:r,active:o})))))}function qn(e,t){let r=R(".md-typeset",e);return C(()=>{let o=new g;return o.subscribe(({message:n,active:i})=>{e.classList.toggle("md-dialog--active",i),r.textContent=n}),Ba(e,t).pipe(w(n=>o.next(n)),_(()=>o.complete()),m(n=>$({ref:e},n)))})}var Ga=0;function Ja(e,t){document.body.append(e);let{width:r}=ce(e);e.style.setProperty("--md-tooltip-width",`${r}px`),e.remove();let o=cr(t),n=typeof o!="undefined"?Ne(o):I({x:0,y:0}),i=O(et(t),Ht(t)).pipe(K());return z([i,n]).pipe(m(([a,s])=>{let{x:p,y:c}=De(t),l=ce(t),f=t.closest("table");return f&&t.parentElement&&(p+=f.offsetLeft+t.parentElement.offsetLeft,c+=f.offsetTop+t.parentElement.offsetTop),{active:a,offset:{x:p-s.x+l.width/2-r/2,y:c-s.y+l.height+8}}}))}function Qn(e){let t=e.title;if(!t.length)return S;let r=`__tooltip_${Ga++}`,o=Pt(r,"inline"),n=R(".md-typeset",o);return n.innerHTML=t,C(()=>{let i=new g;return i.subscribe({next({offset:a}){o.style.setProperty("--md-tooltip-x",`${a.x}px`),o.style.setProperty("--md-tooltip-y",`${a.y}px`)},complete(){o.style.removeProperty("--md-tooltip-x"),o.style.removeProperty("--md-tooltip-y")}}),O(i.pipe(b(({active:a})=>a)),i.pipe(_e(250),b(({active:a})=>!a))).subscribe({next({active:a}){a?(e.insertAdjacentElement("afterend",o),e.setAttribute("aria-describedby",r),e.removeAttribute("title")):(o.remove(),e.removeAttribute("aria-describedby"),e.setAttribute("title",t))},complete(){o.remove(),e.removeAttribute("aria-describedby"),e.setAttribute("title",t)}}),i.pipe(Me(16,me)).subscribe(({active:a})=>{o.classList.toggle("md-tooltip--active",a)}),i.pipe(pt(125,me),b(()=>!!e.offsetParent),m(()=>e.offsetParent.getBoundingClientRect()),m(({x:a})=>a)).subscribe({next(a){a?o.style.setProperty("--md-tooltip-0",`${-a}px`):o.style.removeProperty("--md-tooltip-0")},complete(){o.style.removeProperty("--md-tooltip-0")}}),Ja(o,e).pipe(w(a=>i.next(a)),_(()=>i.complete()),m(a=>$({ref:e},a)))}).pipe(Ke(se))}function Xa({viewport$:e}){if(!B("header.autohide"))return I(!1);let t=e.pipe(m(({offset:{y:n}})=>n),Be(2,1),m(([n,i])=>[nMath.abs(i-n.y)>100),m(([,[n]])=>n),K()),o=ze("search");return z([e,o]).pipe(m(([{offset:n},i])=>n.y>400&&!i),K(),v(n=>n?r:I(!1)),Q(!1))}function Kn(e,t){return C(()=>z([ge(e),Xa(t)])).pipe(m(([{height:r},o])=>({height:r,hidden:o})),K((r,o)=>r.height===o.height&&r.hidden===o.hidden),G(1))}function Yn(e,{header$:t,main$:r}){return C(()=>{let o=new g,n=o.pipe(Z(),ie(!0));o.pipe(te("active"),He(t)).subscribe(([{active:a},{hidden:s}])=>{e.classList.toggle("md-header--shadow",a&&!s),e.hidden=s});let i=ue(P("[title]",e)).pipe(b(()=>B("content.tooltips")),ne(a=>Qn(a)));return r.subscribe(o),t.pipe(W(n),m(a=>$({ref:e},a)),Re(i.pipe(W(n))))})}function Za(e,{viewport$:t,header$:r}){return mr(e,{viewport$:t,header$:r}).pipe(m(({offset:{y:o}})=>{let{height:n}=ce(e);return{active:o>=n}}),te("active"))}function Bn(e,t){return C(()=>{let r=new g;r.subscribe({next({active:n}){e.classList.toggle("md-header__title--active",n)},complete(){e.classList.remove("md-header__title--active")}});let o=fe(".md-content h1");return typeof o=="undefined"?S:Za(o,t).pipe(w(n=>r.next(n)),_(()=>r.complete()),m(n=>$({ref:e},n)))})}function Gn(e,{viewport$:t,header$:r}){let o=r.pipe(m(({height:i})=>i),K()),n=o.pipe(v(()=>ge(e).pipe(m(({height:i})=>({top:e.offsetTop,bottom:e.offsetTop+i})),te("bottom"))));return z([o,n,t]).pipe(m(([i,{top:a,bottom:s},{offset:{y:p},size:{height:c}}])=>(c=Math.max(0,c-Math.max(0,a-p,i)-Math.max(0,c+p-s)),{offset:a-i,height:c,active:a-i<=p})),K((i,a)=>i.offset===a.offset&&i.height===a.height&&i.active===a.active))}function es(e){let t=__md_get("__palette")||{index:e.findIndex(o=>matchMedia(o.getAttribute("data-md-color-media")).matches)},r=Math.max(0,Math.min(t.index,e.length-1));return I(...e).pipe(ne(o=>h(o,"change").pipe(m(()=>o))),Q(e[r]),m(o=>({index:e.indexOf(o),color:{media:o.getAttribute("data-md-color-media"),scheme:o.getAttribute("data-md-color-scheme"),primary:o.getAttribute("data-md-color-primary"),accent:o.getAttribute("data-md-color-accent")}})),G(1))}function Jn(e){let t=P("input",e),r=x("meta",{name:"theme-color"});document.head.appendChild(r);let o=x("meta",{name:"color-scheme"});document.head.appendChild(o);let n=$t("(prefers-color-scheme: light)");return C(()=>{let i=new g;return i.subscribe(a=>{if(document.body.setAttribute("data-md-color-switching",""),a.color.media==="(prefers-color-scheme)"){let s=matchMedia("(prefers-color-scheme: light)"),p=document.querySelector(s.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");a.color.scheme=p.getAttribute("data-md-color-scheme"),a.color.primary=p.getAttribute("data-md-color-primary"),a.color.accent=p.getAttribute("data-md-color-accent")}for(let[s,p]of Object.entries(a.color))document.body.setAttribute(`data-md-color-${s}`,p);for(let s=0;sa.key==="Enter"),re(i,(a,s)=>s)).subscribe(({index:a})=>{a=(a+1)%t.length,t[a].click(),t[a].focus()}),i.pipe(m(()=>{let a=Se("header"),s=window.getComputedStyle(a);return o.content=s.colorScheme,s.backgroundColor.match(/\d+/g).map(p=>(+p).toString(16).padStart(2,"0")).join("")})).subscribe(a=>r.content=`#${a}`),i.pipe(ve(se)).subscribe(()=>{document.body.removeAttribute("data-md-color-switching")}),es(t).pipe(W(n.pipe(Ce(1))),ct(),w(a=>i.next(a)),_(()=>i.complete()),m(a=>$({ref:e},a)))})}function Xn(e,{progress$:t}){return C(()=>{let r=new g;return r.subscribe(({value:o})=>{e.style.setProperty("--md-progress-value",`${o}`)}),t.pipe(w(o=>r.next({value:o})),_(()=>r.complete()),m(o=>({ref:e,value:o})))})}var Jr=Lt(Br());function ts(e){e.setAttribute("data-md-copying","");let t=e.closest("[data-copy]"),r=t?t.getAttribute("data-copy"):e.innerText;return e.removeAttribute("data-md-copying"),r.trimEnd()}function Zn({alert$:e}){Jr.default.isSupported()&&new j(t=>{new Jr.default("[data-clipboard-target], [data-clipboard-text]",{text:r=>r.getAttribute("data-clipboard-text")||ts(R(r.getAttribute("data-clipboard-target")))}).on("success",r=>t.next(r))}).pipe(w(t=>{t.trigger.focus()}),m(()=>Ee("clipboard.copied"))).subscribe(e)}function ei(e,t){return e.protocol=t.protocol,e.hostname=t.hostname,e}function rs(e,t){let r=new Map;for(let o of P("url",e)){let n=R("loc",o),i=[ei(new URL(n.textContent),t)];r.set(`${i[0]}`,i);for(let a of P("[rel=alternate]",o)){let s=a.getAttribute("href");s!=null&&i.push(ei(new URL(s),t))}}return r}function ur(e){return un(new URL("sitemap.xml",e)).pipe(m(t=>rs(t,new URL(e))),de(()=>I(new Map)))}function os(e,t){if(!(e.target instanceof Element))return S;let r=e.target.closest("a");if(r===null)return S;if(r.target||e.metaKey||e.ctrlKey)return S;let o=new URL(r.href);return o.search=o.hash="",t.has(`${o}`)?(e.preventDefault(),I(new URL(r.href))):S}function ti(e){let t=new Map;for(let r of P(":scope > *",e.head))t.set(r.outerHTML,r);return t}function ri(e){for(let t of P("[href], [src]",e))for(let r of["href","src"]){let o=t.getAttribute(r);if(o&&!/^(?:[a-z]+:)?\/\//i.test(o)){t[r]=t[r];break}}return I(e)}function ns(e){for(let o of["[data-md-component=announce]","[data-md-component=container]","[data-md-component=header-topic]","[data-md-component=outdated]","[data-md-component=logo]","[data-md-component=skip]",...B("navigation.tabs.sticky")?["[data-md-component=tabs]"]:[]]){let n=fe(o),i=fe(o,e);typeof n!="undefined"&&typeof i!="undefined"&&n.replaceWith(i)}let t=ti(document);for(let[o,n]of ti(e))t.has(o)?t.delete(o):document.head.appendChild(n);for(let o of t.values()){let n=o.getAttribute("name");n!=="theme-color"&&n!=="color-scheme"&&o.remove()}let r=Se("container");return We(P("script",r)).pipe(v(o=>{let n=e.createElement("script");if(o.src){for(let i of o.getAttributeNames())n.setAttribute(i,o.getAttribute(i));return o.replaceWith(n),new j(i=>{n.onload=()=>i.complete()})}else return n.textContent=o.textContent,o.replaceWith(n),S}),Z(),ie(document))}function oi({location$:e,viewport$:t,progress$:r}){let o=xe();if(location.protocol==="file:")return S;let n=ur(o.base);I(document).subscribe(ri);let i=h(document.body,"click").pipe(He(n),v(([p,c])=>os(p,c)),pe()),a=h(window,"popstate").pipe(m(ye),pe());i.pipe(re(t)).subscribe(([p,{offset:c}])=>{history.replaceState(c,""),history.pushState(null,"",p)}),O(i,a).subscribe(e);let s=e.pipe(te("pathname"),v(p=>fn(p,{progress$:r}).pipe(de(()=>(lt(p,!0),S)))),v(ri),v(ns),pe());return O(s.pipe(re(e,(p,c)=>c)),s.pipe(v(()=>e),te("hash")),e.pipe(K((p,c)=>p.pathname===c.pathname&&p.hash===c.hash),v(()=>i),w(()=>history.back()))).subscribe(p=>{var c,l;history.state!==null||!p.hash?window.scrollTo(0,(l=(c=history.state)==null?void 0:c.y)!=null?l:0):(history.scrollRestoration="auto",pn(p.hash),history.scrollRestoration="manual")}),e.subscribe(()=>{history.scrollRestoration="manual"}),h(window,"beforeunload").subscribe(()=>{history.scrollRestoration="auto"}),t.pipe(te("offset"),_e(100)).subscribe(({offset:p})=>{history.replaceState(p,"")}),s}var ni=Lt(qr());function ii(e){let t=e.separator.split("|").map(n=>n.replace(/(\(\?[!=<][^)]+\))/g,"").length===0?"\uFFFD":n).join("|"),r=new RegExp(t,"img"),o=(n,i,a)=>`${i}${a}`;return n=>{n=n.replace(/[\s*+\-:~^]+/g," ").trim();let i=new RegExp(`(^|${e.separator}|)(${n.replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&").replace(r,"|")})`,"img");return a=>(0,ni.default)(a).replace(i,o).replace(/<\/mark>(\s+)]*>/img,"$1")}}function It(e){return e.type===1}function dr(e){return e.type===3}function ai(e,t){let r=yn(e);return O(I(location.protocol!=="file:"),ze("search")).pipe(Ae(o=>o),v(()=>t)).subscribe(({config:o,docs:n})=>r.next({type:0,data:{config:o,docs:n,options:{suggest:B("search.suggest")}}})),r}function si(e){var l;let{selectedVersionSitemap:t,selectedVersionBaseURL:r,currentLocation:o,currentBaseURL:n}=e,i=(l=Xr(n))==null?void 0:l.pathname;if(i===void 0)return;let a=ss(o.pathname,i);if(a===void 0)return;let s=ps(t.keys());if(!t.has(s))return;let p=Xr(a,s);if(!p||!t.has(p.href))return;let c=Xr(a,r);if(c)return c.hash=o.hash,c.search=o.search,c}function Xr(e,t){try{return new URL(e,t)}catch(r){return}}function ss(e,t){if(e.startsWith(t))return e.slice(t.length)}function cs(e,t){let r=Math.min(e.length,t.length),o;for(o=0;oS)),o=r.pipe(m(n=>{let[,i]=t.base.match(/([^/]+)\/?$/);return n.find(({version:a,aliases:s})=>a===i||s.includes(i))||n[0]}));r.pipe(m(n=>new Map(n.map(i=>[`${new URL(`../${i.version}/`,t.base)}`,i]))),v(n=>h(document.body,"click").pipe(b(i=>!i.metaKey&&!i.ctrlKey),re(o),v(([i,a])=>{if(i.target instanceof Element){let s=i.target.closest("a");if(s&&!s.target&&n.has(s.href)){let p=s.href;return!i.target.closest(".md-version")&&n.get(p)===a?S:(i.preventDefault(),I(new URL(p)))}}return S}),v(i=>ur(i).pipe(m(a=>{var s;return(s=si({selectedVersionSitemap:a,selectedVersionBaseURL:i,currentLocation:ye(),currentBaseURL:t.base}))!=null?s:i})))))).subscribe(n=>lt(n,!0)),z([r,o]).subscribe(([n,i])=>{R(".md-header__topic").appendChild(Cn(n,i))}),e.pipe(v(()=>o)).subscribe(n=>{var s;let i=new URL(t.base),a=__md_get("__outdated",sessionStorage,i);if(a===null){a=!0;let p=((s=t.version)==null?void 0:s.default)||"latest";Array.isArray(p)||(p=[p]);e:for(let c of p)for(let l of n.aliases.concat(n.version))if(new RegExp(c,"i").test(l)){a=!1;break e}__md_set("__outdated",a,sessionStorage,i)}if(a)for(let p of ae("outdated"))p.hidden=!1})}function ls(e,{worker$:t}){let{searchParams:r}=ye();r.has("q")&&(Je("search",!0),e.value=r.get("q"),e.focus(),ze("search").pipe(Ae(i=>!i)).subscribe(()=>{let i=ye();i.searchParams.delete("q"),history.replaceState({},"",`${i}`)}));let o=et(e),n=O(t.pipe(Ae(It)),h(e,"keyup"),o).pipe(m(()=>e.value),K());return z([n,o]).pipe(m(([i,a])=>({value:i,focus:a})),G(1))}function pi(e,{worker$:t}){let r=new g,o=r.pipe(Z(),ie(!0));z([t.pipe(Ae(It)),r],(i,a)=>a).pipe(te("value")).subscribe(({value:i})=>t.next({type:2,data:i})),r.pipe(te("focus")).subscribe(({focus:i})=>{i&&Je("search",i)}),h(e.form,"reset").pipe(W(o)).subscribe(()=>e.focus());let n=R("header [for=__search]");return h(n,"click").subscribe(()=>e.focus()),ls(e,{worker$:t}).pipe(w(i=>r.next(i)),_(()=>r.complete()),m(i=>$({ref:e},i)),G(1))}function li(e,{worker$:t,query$:r}){let o=new g,n=on(e.parentElement).pipe(b(Boolean)),i=e.parentElement,a=R(":scope > :first-child",e),s=R(":scope > :last-child",e);ze("search").subscribe(l=>s.setAttribute("role",l?"list":"presentation")),o.pipe(re(r),Wr(t.pipe(Ae(It)))).subscribe(([{items:l},{value:f}])=>{switch(l.length){case 0:a.textContent=f.length?Ee("search.result.none"):Ee("search.result.placeholder");break;case 1:a.textContent=Ee("search.result.one");break;default:let u=sr(l.length);a.textContent=Ee("search.result.other",u)}});let p=o.pipe(w(()=>s.innerHTML=""),v(({items:l})=>O(I(...l.slice(0,10)),I(...l.slice(10)).pipe(Be(4),Dr(n),v(([f])=>f)))),m(Mn),pe());return p.subscribe(l=>s.appendChild(l)),p.pipe(ne(l=>{let f=fe("details",l);return typeof f=="undefined"?S:h(f,"toggle").pipe(W(o),m(()=>f))})).subscribe(l=>{l.open===!1&&l.offsetTop<=i.scrollTop&&i.scrollTo({top:l.offsetTop})}),t.pipe(b(dr),m(({data:l})=>l)).pipe(w(l=>o.next(l)),_(()=>o.complete()),m(l=>$({ref:e},l)))}function ms(e,{query$:t}){return t.pipe(m(({value:r})=>{let o=ye();return o.hash="",r=r.replace(/\s+/g,"+").replace(/&/g,"%26").replace(/=/g,"%3D"),o.search=`q=${r}`,{url:o}}))}function mi(e,t){let r=new g,o=r.pipe(Z(),ie(!0));return r.subscribe(({url:n})=>{e.setAttribute("data-clipboard-text",e.href),e.href=`${n}`}),h(e,"click").pipe(W(o)).subscribe(n=>n.preventDefault()),ms(e,t).pipe(w(n=>r.next(n)),_(()=>r.complete()),m(n=>$({ref:e},n)))}function fi(e,{worker$:t,keyboard$:r}){let o=new g,n=Se("search-query"),i=O(h(n,"keydown"),h(n,"focus")).pipe(ve(se),m(()=>n.value),K());return o.pipe(He(i),m(([{suggest:s},p])=>{let c=p.split(/([\s-]+)/);if(s!=null&&s.length&&c[c.length-1]){let l=s[s.length-1];l.startsWith(c[c.length-1])&&(c[c.length-1]=l)}else c.length=0;return c})).subscribe(s=>e.innerHTML=s.join("").replace(/\s/g," ")),r.pipe(b(({mode:s})=>s==="search")).subscribe(s=>{switch(s.type){case"ArrowRight":e.innerText.length&&n.selectionStart===n.value.length&&(n.value=e.innerText);break}}),t.pipe(b(dr),m(({data:s})=>s)).pipe(w(s=>o.next(s)),_(()=>o.complete()),m(()=>({ref:e})))}function ui(e,{index$:t,keyboard$:r}){let o=xe();try{let n=ai(o.search,t),i=Se("search-query",e),a=Se("search-result",e);h(e,"click").pipe(b(({target:p})=>p instanceof Element&&!!p.closest("a"))).subscribe(()=>Je("search",!1)),r.pipe(b(({mode:p})=>p==="search")).subscribe(p=>{let c=Ie();switch(p.type){case"Enter":if(c===i){let l=new Map;for(let f of P(":first-child [href]",a)){let u=f.firstElementChild;l.set(f,parseFloat(u.getAttribute("data-md-score")))}if(l.size){let[[f]]=[...l].sort(([,u],[,d])=>d-u);f.click()}p.claim()}break;case"Escape":case"Tab":Je("search",!1),i.blur();break;case"ArrowUp":case"ArrowDown":if(typeof c=="undefined")i.focus();else{let l=[i,...P(":not(details) > [href], summary, details[open] [href]",a)],f=Math.max(0,(Math.max(0,l.indexOf(c))+l.length+(p.type==="ArrowUp"?-1:1))%l.length);l[f].focus()}p.claim();break;default:i!==Ie()&&i.focus()}}),r.pipe(b(({mode:p})=>p==="global")).subscribe(p=>{switch(p.type){case"f":case"s":case"/":i.focus(),i.select(),p.claim();break}});let s=pi(i,{worker$:n});return O(s,li(a,{worker$:n,query$:s})).pipe(Re(...ae("search-share",e).map(p=>mi(p,{query$:s})),...ae("search-suggest",e).map(p=>fi(p,{worker$:n,keyboard$:r}))))}catch(n){return e.hidden=!0,Ye}}function di(e,{index$:t,location$:r}){return z([t,r.pipe(Q(ye()),b(o=>!!o.searchParams.get("h")))]).pipe(m(([o,n])=>ii(o.config)(n.searchParams.get("h"))),m(o=>{var a;let n=new Map,i=document.createNodeIterator(e,NodeFilter.SHOW_TEXT);for(let s=i.nextNode();s;s=i.nextNode())if((a=s.parentElement)!=null&&a.offsetHeight){let p=s.textContent,c=o(p);c.length>p.length&&n.set(s,c)}for(let[s,p]of n){let{childNodes:c}=x("span",null,p);s.replaceWith(...Array.from(c))}return{ref:e,nodes:n}}))}function fs(e,{viewport$:t,main$:r}){let o=e.closest(".md-grid"),n=o.offsetTop-o.parentElement.offsetTop;return z([r,t]).pipe(m(([{offset:i,height:a},{offset:{y:s}}])=>(a=a+Math.min(n,Math.max(0,s-i))-n,{height:a,locked:s>=i+n})),K((i,a)=>i.height===a.height&&i.locked===a.locked))}function Zr(e,o){var n=o,{header$:t}=n,r=so(n,["header$"]);let i=R(".md-sidebar__scrollwrap",e),{y:a}=De(i);return C(()=>{let s=new g,p=s.pipe(Z(),ie(!0)),c=s.pipe(Me(0,me));return c.pipe(re(t)).subscribe({next([{height:l},{height:f}]){i.style.height=`${l-2*a}px`,e.style.top=`${f}px`},complete(){i.style.height="",e.style.top=""}}),c.pipe(Ae()).subscribe(()=>{for(let l of P(".md-nav__link--active[href]",e)){if(!l.clientHeight)continue;let f=l.closest(".md-sidebar__scrollwrap");if(typeof f!="undefined"){let u=l.offsetTop-f.offsetTop,{height:d}=ce(f);f.scrollTo({top:u-d/2})}}}),ue(P("label[tabindex]",e)).pipe(ne(l=>h(l,"click").pipe(ve(se),m(()=>l),W(p)))).subscribe(l=>{let f=R(`[id="${l.htmlFor}"]`);R(`[aria-labelledby="${l.id}"]`).setAttribute("aria-expanded",`${f.checked}`)}),fs(e,r).pipe(w(l=>s.next(l)),_(()=>s.complete()),m(l=>$({ref:e},l)))})}function hi(e,t){if(typeof t!="undefined"){let r=`https://api.github.com/repos/${e}/${t}`;return st(je(`${r}/releases/latest`).pipe(de(()=>S),m(o=>({version:o.tag_name})),Ve({})),je(r).pipe(de(()=>S),m(o=>({stars:o.stargazers_count,forks:o.forks_count})),Ve({}))).pipe(m(([o,n])=>$($({},o),n)))}else{let r=`https://api.github.com/users/${e}`;return je(r).pipe(m(o=>({repositories:o.public_repos})),Ve({}))}}function bi(e,t){let r=`https://${e}/api/v4/projects/${encodeURIComponent(t)}`;return st(je(`${r}/releases/permalink/latest`).pipe(de(()=>S),m(({tag_name:o})=>({version:o})),Ve({})),je(r).pipe(de(()=>S),m(({star_count:o,forks_count:n})=>({stars:o,forks:n})),Ve({}))).pipe(m(([o,n])=>$($({},o),n)))}function vi(e){let t=e.match(/^.+github\.com\/([^/]+)\/?([^/]+)?/i);if(t){let[,r,o]=t;return hi(r,o)}if(t=e.match(/^.+?([^/]*gitlab[^/]+)\/(.+?)\/?$/i),t){let[,r,o]=t;return bi(r,o)}return S}var us;function ds(e){return us||(us=C(()=>{let t=__md_get("__source",sessionStorage);if(t)return I(t);if(ae("consent").length){let o=__md_get("__consent");if(!(o&&o.github))return S}return vi(e.href).pipe(w(o=>__md_set("__source",o,sessionStorage)))}).pipe(de(()=>S),b(t=>Object.keys(t).length>0),m(t=>({facts:t})),G(1)))}function gi(e){let t=R(":scope > :last-child",e);return C(()=>{let r=new g;return r.subscribe(({facts:o})=>{t.appendChild(_n(o)),t.classList.add("md-source__repository--active")}),ds(e).pipe(w(o=>r.next(o)),_(()=>r.complete()),m(o=>$({ref:e},o)))})}function hs(e,{viewport$:t,header$:r}){return ge(document.body).pipe(v(()=>mr(e,{header$:r,viewport$:t})),m(({offset:{y:o}})=>({hidden:o>=10})),te("hidden"))}function yi(e,t){return C(()=>{let r=new g;return r.subscribe({next({hidden:o}){e.hidden=o},complete(){e.hidden=!1}}),(B("navigation.tabs.sticky")?I({hidden:!1}):hs(e,t)).pipe(w(o=>r.next(o)),_(()=>r.complete()),m(o=>$({ref:e},o)))})}function bs(e,{viewport$:t,header$:r}){let o=new Map,n=P(".md-nav__link",e);for(let s of n){let p=decodeURIComponent(s.hash.substring(1)),c=fe(`[id="${p}"]`);typeof c!="undefined"&&o.set(s,c)}let i=r.pipe(te("height"),m(({height:s})=>{let p=Se("main"),c=R(":scope > :first-child",p);return s+.8*(c.offsetTop-p.offsetTop)}),pe());return ge(document.body).pipe(te("height"),v(s=>C(()=>{let p=[];return I([...o].reduce((c,[l,f])=>{for(;p.length&&o.get(p[p.length-1]).tagName>=f.tagName;)p.pop();let u=f.offsetTop;for(;!u&&f.parentElement;)f=f.parentElement,u=f.offsetTop;let d=f.offsetParent;for(;d;d=d.offsetParent)u+=d.offsetTop;return c.set([...p=[...p,l]].reverse(),u)},new Map))}).pipe(m(p=>new Map([...p].sort(([,c],[,l])=>c-l))),He(i),v(([p,c])=>t.pipe(Fr(([l,f],{offset:{y:u},size:d})=>{let y=u+d.height>=Math.floor(s.height);for(;f.length;){let[,L]=f[0];if(L-c=u&&!y)f=[l.pop(),...f];else break}return[l,f]},[[],[...p]]),K((l,f)=>l[0]===f[0]&&l[1]===f[1])))))).pipe(m(([s,p])=>({prev:s.map(([c])=>c),next:p.map(([c])=>c)})),Q({prev:[],next:[]}),Be(2,1),m(([s,p])=>s.prev.length{let i=new g,a=i.pipe(Z(),ie(!0));if(i.subscribe(({prev:s,next:p})=>{for(let[c]of p)c.classList.remove("md-nav__link--passed"),c.classList.remove("md-nav__link--active");for(let[c,[l]]of s.entries())l.classList.add("md-nav__link--passed"),l.classList.toggle("md-nav__link--active",c===s.length-1)}),B("toc.follow")){let s=O(t.pipe(_e(1),m(()=>{})),t.pipe(_e(250),m(()=>"smooth")));i.pipe(b(({prev:p})=>p.length>0),He(o.pipe(ve(se))),re(s)).subscribe(([[{prev:p}],c])=>{let[l]=p[p.length-1];if(l.offsetHeight){let f=cr(l);if(typeof f!="undefined"){let u=l.offsetTop-f.offsetTop,{height:d}=ce(f);f.scrollTo({top:u-d/2,behavior:c})}}})}return B("navigation.tracking")&&t.pipe(W(a),te("offset"),_e(250),Ce(1),W(n.pipe(Ce(1))),ct({delay:250}),re(i)).subscribe(([,{prev:s}])=>{let p=ye(),c=s[s.length-1];if(c&&c.length){let[l]=c,{hash:f}=new URL(l.href);p.hash!==f&&(p.hash=f,history.replaceState({},"",`${p}`))}else p.hash="",history.replaceState({},"",`${p}`)}),bs(e,{viewport$:t,header$:r}).pipe(w(s=>i.next(s)),_(()=>i.complete()),m(s=>$({ref:e},s)))})}function vs(e,{viewport$:t,main$:r,target$:o}){let n=t.pipe(m(({offset:{y:a}})=>a),Be(2,1),m(([a,s])=>a>s&&s>0),K()),i=r.pipe(m(({active:a})=>a));return z([i,n]).pipe(m(([a,s])=>!(a&&s)),K(),W(o.pipe(Ce(1))),ie(!0),ct({delay:250}),m(a=>({hidden:a})))}function Ei(e,{viewport$:t,header$:r,main$:o,target$:n}){let i=new g,a=i.pipe(Z(),ie(!0));return i.subscribe({next({hidden:s}){e.hidden=s,s?(e.setAttribute("tabindex","-1"),e.blur()):e.removeAttribute("tabindex")},complete(){e.style.top="",e.hidden=!0,e.removeAttribute("tabindex")}}),r.pipe(W(a),te("height")).subscribe(({height:s})=>{e.style.top=`${s+16}px`}),h(e,"click").subscribe(s=>{s.preventDefault(),window.scrollTo({top:0})}),vs(e,{viewport$:t,main$:o,target$:n}).pipe(w(s=>i.next(s)),_(()=>i.complete()),m(s=>$({ref:e},s)))}function wi({document$:e,viewport$:t}){e.pipe(v(()=>P(".md-ellipsis")),ne(r=>tt(r).pipe(W(e.pipe(Ce(1))),b(o=>o),m(()=>r),Te(1))),b(r=>r.offsetWidth{let o=r.innerText,n=r.closest("a")||r;return n.title=o,B("content.tooltips")?mt(n,{viewport$:t}).pipe(W(e.pipe(Ce(1))),_(()=>n.removeAttribute("title"))):S})).subscribe(),B("content.tooltips")&&e.pipe(v(()=>P(".md-status")),ne(r=>mt(r,{viewport$:t}))).subscribe()}function Ti({document$:e,tablet$:t}){e.pipe(v(()=>P(".md-toggle--indeterminate")),w(r=>{r.indeterminate=!0,r.checked=!1}),ne(r=>h(r,"change").pipe(Vr(()=>r.classList.contains("md-toggle--indeterminate")),m(()=>r))),re(t)).subscribe(([r,o])=>{r.classList.remove("md-toggle--indeterminate"),o&&(r.checked=!1)})}function gs(){return/(iPad|iPhone|iPod)/.test(navigator.userAgent)}function Si({document$:e}){e.pipe(v(()=>P("[data-md-scrollfix]")),w(t=>t.removeAttribute("data-md-scrollfix")),b(gs),ne(t=>h(t,"touchstart").pipe(m(()=>t)))).subscribe(t=>{let r=t.scrollTop;r===0?t.scrollTop=1:r+t.offsetHeight===t.scrollHeight&&(t.scrollTop=r-1)})}function Oi({viewport$:e,tablet$:t}){z([ze("search"),t]).pipe(m(([r,o])=>r&&!o),v(r=>I(r).pipe(Ge(r?400:100))),re(e)).subscribe(([r,{offset:{y:o}}])=>{if(r)document.body.setAttribute("data-md-scrolllock",""),document.body.style.top=`-${o}px`;else{let n=-1*parseInt(document.body.style.top,10);document.body.removeAttribute("data-md-scrolllock"),document.body.style.top="",n&&window.scrollTo(0,n)}})}Object.entries||(Object.entries=function(e){let t=[];for(let r of Object.keys(e))t.push([r,e[r]]);return t});Object.values||(Object.values=function(e){let t=[];for(let r of Object.keys(e))t.push(e[r]);return t});typeof Element!="undefined"&&(Element.prototype.scrollTo||(Element.prototype.scrollTo=function(e,t){typeof e=="object"?(this.scrollLeft=e.left,this.scrollTop=e.top):(this.scrollLeft=e,this.scrollTop=t)}),Element.prototype.replaceWith||(Element.prototype.replaceWith=function(...e){let t=this.parentNode;if(t){e.length===0&&t.removeChild(this);for(let r=e.length-1;r>=0;r--){let o=e[r];typeof o=="string"?o=document.createTextNode(o):o.parentNode&&o.parentNode.removeChild(o),r?t.insertBefore(this.previousSibling,o):t.replaceChild(o,this)}}}));function ys(){return location.protocol==="file:"?wt(`${new URL("search/search_index.js",eo.base)}`).pipe(m(()=>__index),G(1)):je(new URL("search/search_index.json",eo.base))}document.documentElement.classList.remove("no-js");document.documentElement.classList.add("js");var ot=Go(),Ft=sn(),Ot=ln(Ft),to=an(),Oe=gn(),hr=$t("(min-width: 960px)"),Mi=$t("(min-width: 1220px)"),_i=mn(),eo=xe(),Ai=document.forms.namedItem("search")?ys():Ye,ro=new g;Zn({alert$:ro});var oo=new g;B("navigation.instant")&&oi({location$:Ft,viewport$:Oe,progress$:oo}).subscribe(ot);var Li;((Li=eo.version)==null?void 0:Li.provider)==="mike"&&ci({document$:ot});O(Ft,Ot).pipe(Ge(125)).subscribe(()=>{Je("drawer",!1),Je("search",!1)});to.pipe(b(({mode:e})=>e==="global")).subscribe(e=>{switch(e.type){case"p":case",":let t=fe("link[rel=prev]");typeof t!="undefined"&<(t);break;case"n":case".":let r=fe("link[rel=next]");typeof r!="undefined"&<(r);break;case"Enter":let o=Ie();o instanceof HTMLLabelElement&&o.click()}});wi({viewport$:Oe,document$:ot});Ti({document$:ot,tablet$:hr});Si({document$:ot});Oi({viewport$:Oe,tablet$:hr});var rt=Kn(Se("header"),{viewport$:Oe}),jt=ot.pipe(m(()=>Se("main")),v(e=>Gn(e,{viewport$:Oe,header$:rt})),G(1)),xs=O(...ae("consent").map(e=>En(e,{target$:Ot})),...ae("dialog").map(e=>qn(e,{alert$:ro})),...ae("palette").map(e=>Jn(e)),...ae("progress").map(e=>Xn(e,{progress$:oo})),...ae("search").map(e=>ui(e,{index$:Ai,keyboard$:to})),...ae("source").map(e=>gi(e))),Es=C(()=>O(...ae("announce").map(e=>xn(e)),...ae("content").map(e=>zn(e,{viewport$:Oe,target$:Ot,print$:_i})),...ae("content").map(e=>B("search.highlight")?di(e,{index$:Ai,location$:Ft}):S),...ae("header").map(e=>Yn(e,{viewport$:Oe,header$:rt,main$:jt})),...ae("header-title").map(e=>Bn(e,{viewport$:Oe,header$:rt})),...ae("sidebar").map(e=>e.getAttribute("data-md-type")==="navigation"?Nr(Mi,()=>Zr(e,{viewport$:Oe,header$:rt,main$:jt})):Nr(hr,()=>Zr(e,{viewport$:Oe,header$:rt,main$:jt}))),...ae("tabs").map(e=>yi(e,{viewport$:Oe,header$:rt})),...ae("toc").map(e=>xi(e,{viewport$:Oe,header$:rt,main$:jt,target$:Ot})),...ae("top").map(e=>Ei(e,{viewport$:Oe,header$:rt,main$:jt,target$:Ot})))),Ci=ot.pipe(v(()=>Es),Re(xs),G(1));Ci.subscribe();window.document$=ot;window.location$=Ft;window.target$=Ot;window.keyboard$=to;window.viewport$=Oe;window.tablet$=hr;window.screen$=Mi;window.print$=_i;window.alert$=ro;window.progress$=oo;window.component$=Ci;})(); -//# sourceMappingURL=bundle.c8b220af.min.js.map + `):"",this.name="UnsubscriptionError",this.errors=r}});function Qe(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Ue=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,o,n,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=he(a),p=s.next();!p.done;p=s.next()){var c=p.value;c.remove(this)}}catch(L){t={error:L}}finally{try{p&&!p.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else a.remove(this);var l=this.initialTeardown;if(H(l))try{l()}catch(L){i=L instanceof zt?L.errors:[L]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var u=he(f),d=u.next();!d.done;d=u.next()){var y=d.value;try{ho(y)}catch(L){i=i!=null?i:[],L instanceof zt?i=q(q([],z(i)),z(L.errors)):i.push(L)}}}catch(L){o={error:L}}finally{try{d&&!d.done&&(n=u.return)&&n.call(u)}finally{if(o)throw o.error}}}if(i)throw new zt(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)ho(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Qe(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Qe(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var Tr=Ue.EMPTY;function Nt(e){return e instanceof Ue||e&&"closed"in e&&H(e.remove)&&H(e.add)&&H(e.unsubscribe)}function ho(e){H(e)?e():e.unsubscribe()}var Pe={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var dt={setTimeout:function(e,t){for(var r=[],o=2;o0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var o=this,n=this,i=n.hasError,a=n.isStopped,s=n.observers;return i||a?Tr:(this.currentObservers=null,s.push(r),new Ue(function(){o.currentObservers=null,Qe(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var o=this,n=o.hasError,i=o.thrownError,a=o.isStopped;n?r.error(i):a&&r.complete()},t.prototype.asObservable=function(){var r=new j;return r.source=this,r},t.create=function(r,o){return new To(r,o)},t}(j);var To=function(e){oe(t,e);function t(r,o){var n=e.call(this)||this;return n.destination=r,n.source=o,n}return t.prototype.next=function(r){var o,n;(n=(o=this.destination)===null||o===void 0?void 0:o.next)===null||n===void 0||n.call(o,r)},t.prototype.error=function(r){var o,n;(n=(o=this.destination)===null||o===void 0?void 0:o.error)===null||n===void 0||n.call(o,r)},t.prototype.complete=function(){var r,o;(o=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||o===void 0||o.call(r)},t.prototype._subscribe=function(r){var o,n;return(n=(o=this.source)===null||o===void 0?void 0:o.subscribe(r))!==null&&n!==void 0?n:Tr},t}(g);var _r=function(e){oe(t,e);function t(r){var o=e.call(this)||this;return o._value=r,o}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(r){var o=e.prototype._subscribe.call(this,r);return!o.closed&&r.next(this._value),o},t.prototype.getValue=function(){var r=this,o=r.hasError,n=r.thrownError,i=r._value;if(o)throw n;return this._throwIfClosed(),i},t.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},t}(g);var _t={now:function(){return(_t.delegate||Date).now()},delegate:void 0};var At=function(e){oe(t,e);function t(r,o,n){r===void 0&&(r=1/0),o===void 0&&(o=1/0),n===void 0&&(n=_t);var i=e.call(this)||this;return i._bufferSize=r,i._windowTime=o,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=o===1/0,i._bufferSize=Math.max(1,r),i._windowTime=Math.max(1,o),i}return t.prototype.next=function(r){var o=this,n=o.isStopped,i=o._buffer,a=o._infiniteTimeWindow,s=o._timestampProvider,p=o._windowTime;n||(i.push(r),!a&&i.push(s.now()+p)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var o=this._innerSubscribe(r),n=this,i=n._infiniteTimeWindow,a=n._buffer,s=a.slice(),p=0;p0?e.prototype.schedule.call(this,r,o):(this.delay=o,this.state=r,this.scheduler.flush(this),this)},t.prototype.execute=function(r,o){return o>0||this.closed?e.prototype.execute.call(this,r,o):this._execute(r,o)},t.prototype.requestAsyncId=function(r,o,n){return n===void 0&&(n=0),n!=null&&n>0||n==null&&this.delay>0?e.prototype.requestAsyncId.call(this,r,o,n):(r.flush(this),0)},t}(gt);var Lo=function(e){oe(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(yt);var kr=new Lo(Oo);var Mo=function(e){oe(t,e);function t(r,o){var n=e.call(this,r,o)||this;return n.scheduler=r,n.work=o,n}return t.prototype.requestAsyncId=function(r,o,n){return n===void 0&&(n=0),n!==null&&n>0?e.prototype.requestAsyncId.call(this,r,o,n):(r.actions.push(this),r._scheduled||(r._scheduled=vt.requestAnimationFrame(function(){return r.flush(void 0)})))},t.prototype.recycleAsyncId=function(r,o,n){var i;if(n===void 0&&(n=0),n!=null?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,r,o,n);var a=r.actions;o!=null&&o===r._scheduled&&((i=a[a.length-1])===null||i===void 0?void 0:i.id)!==o&&(vt.cancelAnimationFrame(o),r._scheduled=void 0)},t}(gt);var _o=function(e){oe(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(r){this._active=!0;var o;r?o=r.id:(o=this._scheduled,this._scheduled=void 0);var n=this.actions,i;r=r||n.shift();do if(i=r.execute(r.state,r.delay))break;while((r=n[0])&&r.id===o&&n.shift());if(this._active=!1,i){for(;(r=n[0])&&r.id===o&&n.shift();)r.unsubscribe();throw i}},t}(yt);var me=new _o(Mo);var S=new j(function(e){return e.complete()});function Kt(e){return e&&H(e.schedule)}function Hr(e){return e[e.length-1]}function Xe(e){return H(Hr(e))?e.pop():void 0}function ke(e){return Kt(Hr(e))?e.pop():void 0}function Yt(e,t){return typeof Hr(e)=="number"?e.pop():t}var xt=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function Bt(e){return H(e==null?void 0:e.then)}function Gt(e){return H(e[bt])}function Jt(e){return Symbol.asyncIterator&&H(e==null?void 0:e[Symbol.asyncIterator])}function Xt(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Zi(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Zt=Zi();function er(e){return H(e==null?void 0:e[Zt])}function tr(e){return fo(this,arguments,function(){var r,o,n,i;return Dt(this,function(a){switch(a.label){case 0:r=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,nt(r.read())];case 3:return o=a.sent(),n=o.value,i=o.done,i?[4,nt(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,nt(n)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function rr(e){return H(e==null?void 0:e.getReader)}function U(e){if(e instanceof j)return e;if(e!=null){if(Gt(e))return ea(e);if(xt(e))return ta(e);if(Bt(e))return ra(e);if(Jt(e))return Ao(e);if(er(e))return oa(e);if(rr(e))return na(e)}throw Xt(e)}function ea(e){return new j(function(t){var r=e[bt]();if(H(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function ta(e){return new j(function(t){for(var r=0;r=2;return function(o){return o.pipe(e?b(function(n,i){return e(n,i,o)}):le,Te(1),r?Ve(t):Qo(function(){return new nr}))}}function jr(e){return e<=0?function(){return S}:E(function(t,r){var o=[];t.subscribe(T(r,function(n){o.push(n),e=2,!0))}function pe(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new g}:t,o=e.resetOnError,n=o===void 0?!0:o,i=e.resetOnComplete,a=i===void 0?!0:i,s=e.resetOnRefCountZero,p=s===void 0?!0:s;return function(c){var l,f,u,d=0,y=!1,L=!1,X=function(){f==null||f.unsubscribe(),f=void 0},ee=function(){X(),l=u=void 0,y=L=!1},J=function(){var k=l;ee(),k==null||k.unsubscribe()};return E(function(k,ft){d++,!L&&!y&&X();var qe=u=u!=null?u:r();ft.add(function(){d--,d===0&&!L&&!y&&(f=Ur(J,p))}),qe.subscribe(ft),!l&&d>0&&(l=new at({next:function(Fe){return qe.next(Fe)},error:function(Fe){L=!0,X(),f=Ur(ee,n,Fe),qe.error(Fe)},complete:function(){y=!0,X(),f=Ur(ee,a),qe.complete()}}),U(k).subscribe(l))})(c)}}function Ur(e,t){for(var r=[],o=2;oe.next(document)),e}function P(e,t=document){return Array.from(t.querySelectorAll(e))}function R(e,t=document){let r=fe(e,t);if(typeof r=="undefined")throw new ReferenceError(`Missing element: expected "${e}" to be present`);return r}function fe(e,t=document){return t.querySelector(e)||void 0}function Ie(){var e,t,r,o;return(o=(r=(t=(e=document.activeElement)==null?void 0:e.shadowRoot)==null?void 0:t.activeElement)!=null?r:document.activeElement)!=null?o:void 0}var wa=O(h(document.body,"focusin"),h(document.body,"focusout")).pipe(_e(1),Q(void 0),m(()=>Ie()||document.body),G(1));function et(e){return wa.pipe(m(t=>e.contains(t)),K())}function Ht(e,t){return C(()=>O(h(e,"mouseenter").pipe(m(()=>!0)),h(e,"mouseleave").pipe(m(()=>!1))).pipe(t?kt(r=>Le(+!r*t)):le,Q(e.matches(":hover"))))}function Jo(e,t){if(typeof t=="string"||typeof t=="number")e.innerHTML+=t.toString();else if(t instanceof Node)e.appendChild(t);else if(Array.isArray(t))for(let r of t)Jo(e,r)}function x(e,t,...r){let o=document.createElement(e);if(t)for(let n of Object.keys(t))typeof t[n]!="undefined"&&(typeof t[n]!="boolean"?o.setAttribute(n,t[n]):o.setAttribute(n,""));for(let n of r)Jo(o,n);return o}function sr(e){if(e>999){let t=+((e-950)%1e3>99);return`${((e+1e-6)/1e3).toFixed(t)}k`}else return e.toString()}function wt(e){let t=x("script",{src:e});return C(()=>(document.head.appendChild(t),O(h(t,"load"),h(t,"error").pipe(v(()=>$r(()=>new ReferenceError(`Invalid script: ${e}`))))).pipe(m(()=>{}),_(()=>document.head.removeChild(t)),Te(1))))}var Xo=new g,Ta=C(()=>typeof ResizeObserver=="undefined"?wt("https://unpkg.com/resize-observer-polyfill"):I(void 0)).pipe(m(()=>new ResizeObserver(e=>e.forEach(t=>Xo.next(t)))),v(e=>O(Ye,I(e)).pipe(_(()=>e.disconnect()))),G(1));function ce(e){return{width:e.offsetWidth,height:e.offsetHeight}}function ge(e){let t=e;for(;t.clientWidth===0&&t.parentElement;)t=t.parentElement;return Ta.pipe(w(r=>r.observe(t)),v(r=>Xo.pipe(b(o=>o.target===t),_(()=>r.unobserve(t)))),m(()=>ce(e)),Q(ce(e)))}function Tt(e){return{width:e.scrollWidth,height:e.scrollHeight}}function cr(e){let t=e.parentElement;for(;t&&(e.scrollWidth<=t.scrollWidth&&e.scrollHeight<=t.scrollHeight);)t=(e=t).parentElement;return t?e:void 0}function Zo(e){let t=[],r=e.parentElement;for(;r;)(e.clientWidth>r.clientWidth||e.clientHeight>r.clientHeight)&&t.push(r),r=(e=r).parentElement;return t.length===0&&t.push(document.documentElement),t}function De(e){return{x:e.offsetLeft,y:e.offsetTop}}function en(e){let t=e.getBoundingClientRect();return{x:t.x+window.scrollX,y:t.y+window.scrollY}}function tn(e){return O(h(window,"load"),h(window,"resize")).pipe(Me(0,me),m(()=>De(e)),Q(De(e)))}function pr(e){return{x:e.scrollLeft,y:e.scrollTop}}function ze(e){return O(h(e,"scroll"),h(window,"scroll"),h(window,"resize")).pipe(Me(0,me),m(()=>pr(e)),Q(pr(e)))}var rn=new g,Sa=C(()=>I(new IntersectionObserver(e=>{for(let t of e)rn.next(t)},{threshold:0}))).pipe(v(e=>O(Ye,I(e)).pipe(_(()=>e.disconnect()))),G(1));function tt(e){return Sa.pipe(w(t=>t.observe(e)),v(t=>rn.pipe(b(({target:r})=>r===e),_(()=>t.unobserve(e)),m(({isIntersecting:r})=>r))))}function on(e,t=16){return ze(e).pipe(m(({y:r})=>{let o=ce(e),n=Tt(e);return r>=n.height-o.height-t}),K())}var lr={drawer:R("[data-md-toggle=drawer]"),search:R("[data-md-toggle=search]")};function nn(e){return lr[e].checked}function Je(e,t){lr[e].checked!==t&&lr[e].click()}function Ne(e){let t=lr[e];return h(t,"change").pipe(m(()=>t.checked),Q(t.checked))}function Oa(e,t){switch(e.constructor){case HTMLInputElement:return e.type==="radio"?/^Arrow/.test(t):!0;case HTMLSelectElement:case HTMLTextAreaElement:return!0;default:return e.isContentEditable}}function La(){return O(h(window,"compositionstart").pipe(m(()=>!0)),h(window,"compositionend").pipe(m(()=>!1))).pipe(Q(!1))}function an(){let e=h(window,"keydown").pipe(b(t=>!(t.metaKey||t.ctrlKey)),m(t=>({mode:nn("search")?"search":"global",type:t.key,claim(){t.preventDefault(),t.stopPropagation()}})),b(({mode:t,type:r})=>{if(t==="global"){let o=Ie();if(typeof o!="undefined")return!Oa(o,r)}return!0}),pe());return La().pipe(v(t=>t?S:e))}function ye(){return new URL(location.href)}function lt(e,t=!1){if(B("navigation.instant")&&!t){let r=x("a",{href:e.href});document.body.appendChild(r),r.click(),r.remove()}else location.href=e.href}function sn(){return new g}function cn(){return location.hash.slice(1)}function pn(e){let t=x("a",{href:e});t.addEventListener("click",r=>r.stopPropagation()),t.click()}function Ma(e){return O(h(window,"hashchange"),e).pipe(m(cn),Q(cn()),b(t=>t.length>0),G(1))}function ln(e){return Ma(e).pipe(m(t=>fe(`[id="${t}"]`)),b(t=>typeof t!="undefined"))}function $t(e){let t=matchMedia(e);return ir(r=>t.addListener(()=>r(t.matches))).pipe(Q(t.matches))}function mn(){let e=matchMedia("print");return O(h(window,"beforeprint").pipe(m(()=>!0)),h(window,"afterprint").pipe(m(()=>!1))).pipe(Q(e.matches))}function zr(e,t){return e.pipe(v(r=>r?t():S))}function Nr(e,t){return new j(r=>{let o=new XMLHttpRequest;return o.open("GET",`${e}`),o.responseType="blob",o.addEventListener("load",()=>{o.status>=200&&o.status<300?(r.next(o.response),r.complete()):r.error(new Error(o.statusText))}),o.addEventListener("error",()=>{r.error(new Error("Network error"))}),o.addEventListener("abort",()=>{r.complete()}),typeof(t==null?void 0:t.progress$)!="undefined"&&(o.addEventListener("progress",n=>{var i;if(n.lengthComputable)t.progress$.next(n.loaded/n.total*100);else{let a=(i=o.getResponseHeader("Content-Length"))!=null?i:0;t.progress$.next(n.loaded/+a*100)}}),t.progress$.next(5)),o.send(),()=>o.abort()})}function je(e,t){return Nr(e,t).pipe(v(r=>r.text()),m(r=>JSON.parse(r)),G(1))}function fn(e,t){let r=new DOMParser;return Nr(e,t).pipe(v(o=>o.text()),m(o=>r.parseFromString(o,"text/html")),G(1))}function un(e,t){let r=new DOMParser;return Nr(e,t).pipe(v(o=>o.text()),m(o=>r.parseFromString(o,"text/xml")),G(1))}function dn(){return{x:Math.max(0,scrollX),y:Math.max(0,scrollY)}}function hn(){return O(h(window,"scroll",{passive:!0}),h(window,"resize",{passive:!0})).pipe(m(dn),Q(dn()))}function bn(){return{width:innerWidth,height:innerHeight}}function vn(){return h(window,"resize",{passive:!0}).pipe(m(bn),Q(bn()))}function gn(){return N([hn(),vn()]).pipe(m(([e,t])=>({offset:e,size:t})),G(1))}function mr(e,{viewport$:t,header$:r}){let o=t.pipe(te("size")),n=N([o,r]).pipe(m(()=>De(e)));return N([r,t,n]).pipe(m(([{height:i},{offset:a,size:s},{x:p,y:c}])=>({offset:{x:a.x-p,y:a.y-c+i},size:s})))}function _a(e){return h(e,"message",t=>t.data)}function Aa(e){let t=new g;return t.subscribe(r=>e.postMessage(r)),t}function yn(e,t=new Worker(e)){let r=_a(t),o=Aa(t),n=new g;n.subscribe(o);let i=o.pipe(Z(),ie(!0));return n.pipe(Z(),Re(r.pipe(W(i))),pe())}var Ca=R("#__config"),St=JSON.parse(Ca.textContent);St.base=`${new URL(St.base,ye())}`;function xe(){return St}function B(e){return St.features.includes(e)}function Ee(e,t){return typeof t!="undefined"?St.translations[e].replace("#",t.toString()):St.translations[e]}function Se(e,t=document){return R(`[data-md-component=${e}]`,t)}function ae(e,t=document){return P(`[data-md-component=${e}]`,t)}function ka(e){let t=R(".md-typeset > :first-child",e);return h(t,"click",{once:!0}).pipe(m(()=>R(".md-typeset",e)),m(r=>({hash:__md_hash(r.innerHTML)})))}function xn(e){if(!B("announce.dismiss")||!e.childElementCount)return S;if(!e.hidden){let t=R(".md-typeset",e);__md_hash(t.innerHTML)===__md_get("__announce")&&(e.hidden=!0)}return C(()=>{let t=new g;return t.subscribe(({hash:r})=>{e.hidden=!0,__md_set("__announce",r)}),ka(e).pipe(w(r=>t.next(r)),_(()=>t.complete()),m(r=>$({ref:e},r)))})}function Ha(e,{target$:t}){return t.pipe(m(r=>({hidden:r!==e})))}function En(e,t){let r=new g;return r.subscribe(({hidden:o})=>{e.hidden=o}),Ha(e,t).pipe(w(o=>r.next(o)),_(()=>r.complete()),m(o=>$({ref:e},o)))}function Pt(e,t){return t==="inline"?x("div",{class:"md-tooltip md-tooltip--inline",id:e,role:"tooltip"},x("div",{class:"md-tooltip__inner md-typeset"})):x("div",{class:"md-tooltip",id:e,role:"tooltip"},x("div",{class:"md-tooltip__inner md-typeset"}))}function wn(...e){return x("div",{class:"md-tooltip2",role:"tooltip"},x("div",{class:"md-tooltip2__inner md-typeset"},e))}function Tn(e,t){if(t=t?`${t}_annotation_${e}`:void 0,t){let r=t?`#${t}`:void 0;return x("aside",{class:"md-annotation",tabIndex:0},Pt(t),x("a",{href:r,class:"md-annotation__index",tabIndex:-1},x("span",{"data-md-annotation-id":e})))}else return x("aside",{class:"md-annotation",tabIndex:0},Pt(t),x("span",{class:"md-annotation__index",tabIndex:-1},x("span",{"data-md-annotation-id":e})))}function Sn(e){return x("button",{class:"md-clipboard md-icon",title:Ee("clipboard.copy"),"data-clipboard-target":`#${e} > code`})}var Ln=Lt(qr());function Qr(e,t){let r=t&2,o=t&1,n=Object.keys(e.terms).filter(p=>!e.terms[p]).reduce((p,c)=>[...p,x("del",null,(0,Ln.default)(c))," "],[]).slice(0,-1),i=xe(),a=new URL(e.location,i.base);B("search.highlight")&&a.searchParams.set("h",Object.entries(e.terms).filter(([,p])=>p).reduce((p,[c])=>`${p} ${c}`.trim(),""));let{tags:s}=xe();return x("a",{href:`${a}`,class:"md-search-result__link",tabIndex:-1},x("article",{class:"md-search-result__article md-typeset","data-md-score":e.score.toFixed(2)},r>0&&x("div",{class:"md-search-result__icon md-icon"}),r>0&&x("h1",null,e.title),r<=0&&x("h2",null,e.title),o>0&&e.text.length>0&&e.text,e.tags&&x("nav",{class:"md-tags"},e.tags.map(p=>{let c=s?p in s?`md-tag-icon md-tag--${s[p]}`:"md-tag-icon":"";return x("span",{class:`md-tag ${c}`},p)})),o>0&&n.length>0&&x("p",{class:"md-search-result__terms"},Ee("search.result.term.missing"),": ",...n)))}function Mn(e){let t=e[0].score,r=[...e],o=xe(),n=r.findIndex(l=>!`${new URL(l.location,o.base)}`.includes("#")),[i]=r.splice(n,1),a=r.findIndex(l=>l.scoreQr(l,1)),...p.length?[x("details",{class:"md-search-result__more"},x("summary",{tabIndex:-1},x("div",null,p.length>0&&p.length===1?Ee("search.result.more.one"):Ee("search.result.more.other",p.length))),...p.map(l=>Qr(l,1)))]:[]];return x("li",{class:"md-search-result__item"},c)}function _n(e){return x("ul",{class:"md-source__facts"},Object.entries(e).map(([t,r])=>x("li",{class:`md-source__fact md-source__fact--${t}`},typeof r=="number"?sr(r):r)))}function Kr(e){let t=`tabbed-control tabbed-control--${e}`;return x("div",{class:t,hidden:!0},x("button",{class:"tabbed-button",tabIndex:-1,"aria-hidden":"true"}))}function An(e){return x("div",{class:"md-typeset__scrollwrap"},x("div",{class:"md-typeset__table"},e))}function Ra(e){var o;let t=xe(),r=new URL(`../${e.version}/`,t.base);return x("li",{class:"md-version__item"},x("a",{href:`${r}`,class:"md-version__link"},e.title,((o=t.version)==null?void 0:o.alias)&&e.aliases.length>0&&x("span",{class:"md-version__alias"},e.aliases[0])))}function Cn(e,t){var o;let r=xe();return e=e.filter(n=>{var i;return!((i=n.properties)!=null&&i.hidden)}),x("div",{class:"md-version"},x("button",{class:"md-version__current","aria-label":Ee("select.version")},t.title,((o=r.version)==null?void 0:o.alias)&&t.aliases.length>0&&x("span",{class:"md-version__alias"},t.aliases[0])),x("ul",{class:"md-version__list"},e.map(Ra)))}var Ia=0;function ja(e){let t=N([et(e),Ht(e)]).pipe(m(([o,n])=>o||n),K()),r=C(()=>Zo(e)).pipe(ne(ze),pt(1),He(t),m(()=>en(e)));return t.pipe(Ae(o=>o),v(()=>N([t,r])),m(([o,n])=>({active:o,offset:n})),pe())}function Fa(e,t){let{content$:r,viewport$:o}=t,n=`__tooltip2_${Ia++}`;return C(()=>{let i=new g,a=new _r(!1);i.pipe(Z(),ie(!1)).subscribe(a);let s=a.pipe(kt(c=>Le(+!c*250,kr)),K(),v(c=>c?r:S),w(c=>c.id=n),pe());N([i.pipe(m(({active:c})=>c)),s.pipe(v(c=>Ht(c,250)),Q(!1))]).pipe(m(c=>c.some(l=>l))).subscribe(a);let p=a.pipe(b(c=>c),re(s,o),m(([c,l,{size:f}])=>{let u=e.getBoundingClientRect(),d=u.width/2;if(l.role==="tooltip")return{x:d,y:8+u.height};if(u.y>=f.height/2){let{height:y}=ce(l);return{x:d,y:-16-y}}else return{x:d,y:16+u.height}}));return N([s,i,p]).subscribe(([c,{offset:l},f])=>{c.style.setProperty("--md-tooltip-host-x",`${l.x}px`),c.style.setProperty("--md-tooltip-host-y",`${l.y}px`),c.style.setProperty("--md-tooltip-x",`${f.x}px`),c.style.setProperty("--md-tooltip-y",`${f.y}px`),c.classList.toggle("md-tooltip2--top",f.y<0),c.classList.toggle("md-tooltip2--bottom",f.y>=0)}),a.pipe(b(c=>c),re(s,(c,l)=>l),b(c=>c.role==="tooltip")).subscribe(c=>{let l=ce(R(":scope > *",c));c.style.setProperty("--md-tooltip-width",`${l.width}px`),c.style.setProperty("--md-tooltip-tail","0px")}),a.pipe(K(),ve(me),re(s)).subscribe(([c,l])=>{l.classList.toggle("md-tooltip2--active",c)}),N([a.pipe(b(c=>c)),s]).subscribe(([c,l])=>{l.role==="dialog"?(e.setAttribute("aria-controls",n),e.setAttribute("aria-haspopup","dialog")):e.setAttribute("aria-describedby",n)}),a.pipe(b(c=>!c)).subscribe(()=>{e.removeAttribute("aria-controls"),e.removeAttribute("aria-describedby"),e.removeAttribute("aria-haspopup")}),ja(e).pipe(w(c=>i.next(c)),_(()=>i.complete()),m(c=>$({ref:e},c)))})}function mt(e,{viewport$:t},r=document.body){return Fa(e,{content$:new j(o=>{let n=e.title,i=wn(n);return o.next(i),e.removeAttribute("title"),r.append(i),()=>{i.remove(),e.setAttribute("title",n)}}),viewport$:t})}function Ua(e,t){let r=C(()=>N([tn(e),ze(t)])).pipe(m(([{x:o,y:n},i])=>{let{width:a,height:s}=ce(e);return{x:o-i.x+a/2,y:n-i.y+s/2}}));return et(e).pipe(v(o=>r.pipe(m(n=>({active:o,offset:n})),Te(+!o||1/0))))}function kn(e,t,{target$:r}){let[o,n]=Array.from(e.children);return C(()=>{let i=new g,a=i.pipe(Z(),ie(!0));return i.subscribe({next({offset:s}){e.style.setProperty("--md-tooltip-x",`${s.x}px`),e.style.setProperty("--md-tooltip-y",`${s.y}px`)},complete(){e.style.removeProperty("--md-tooltip-x"),e.style.removeProperty("--md-tooltip-y")}}),tt(e).pipe(W(a)).subscribe(s=>{e.toggleAttribute("data-md-visible",s)}),O(i.pipe(b(({active:s})=>s)),i.pipe(_e(250),b(({active:s})=>!s))).subscribe({next({active:s}){s?e.prepend(o):o.remove()},complete(){e.prepend(o)}}),i.pipe(Me(16,me)).subscribe(({active:s})=>{o.classList.toggle("md-tooltip--active",s)}),i.pipe(pt(125,me),b(()=>!!e.offsetParent),m(()=>e.offsetParent.getBoundingClientRect()),m(({x:s})=>s)).subscribe({next(s){s?e.style.setProperty("--md-tooltip-0",`${-s}px`):e.style.removeProperty("--md-tooltip-0")},complete(){e.style.removeProperty("--md-tooltip-0")}}),h(n,"click").pipe(W(a),b(s=>!(s.metaKey||s.ctrlKey))).subscribe(s=>{s.stopPropagation(),s.preventDefault()}),h(n,"mousedown").pipe(W(a),re(i)).subscribe(([s,{active:p}])=>{var c;if(s.button!==0||s.metaKey||s.ctrlKey)s.preventDefault();else if(p){s.preventDefault();let l=e.parentElement.closest(".md-annotation");l instanceof HTMLElement?l.focus():(c=Ie())==null||c.blur()}}),r.pipe(W(a),b(s=>s===o),Ge(125)).subscribe(()=>e.focus()),Ua(e,t).pipe(w(s=>i.next(s)),_(()=>i.complete()),m(s=>$({ref:e},s)))})}function Wa(e){return e.tagName==="CODE"?P(".c, .c1, .cm",e):[e]}function Va(e){let t=[];for(let r of Wa(e)){let o=[],n=document.createNodeIterator(r,NodeFilter.SHOW_TEXT);for(let i=n.nextNode();i;i=n.nextNode())o.push(i);for(let i of o){let a;for(;a=/(\(\d+\))(!)?/.exec(i.textContent);){let[,s,p]=a;if(typeof p=="undefined"){let c=i.splitText(a.index);i=c.splitText(s.length),t.push(c)}else{i.textContent=s,t.push(i);break}}}}return t}function Hn(e,t){t.append(...Array.from(e.childNodes))}function fr(e,t,{target$:r,print$:o}){let n=t.closest("[id]"),i=n==null?void 0:n.id,a=new Map;for(let s of Va(t)){let[,p]=s.textContent.match(/\((\d+)\)/);fe(`:scope > li:nth-child(${p})`,e)&&(a.set(p,Tn(p,i)),s.replaceWith(a.get(p)))}return a.size===0?S:C(()=>{let s=new g,p=s.pipe(Z(),ie(!0)),c=[];for(let[l,f]of a)c.push([R(".md-typeset",f),R(`:scope > li:nth-child(${l})`,e)]);return o.pipe(W(p)).subscribe(l=>{e.hidden=!l,e.classList.toggle("md-annotation-list",l);for(let[f,u]of c)l?Hn(f,u):Hn(u,f)}),O(...[...a].map(([,l])=>kn(l,t,{target$:r}))).pipe(_(()=>s.complete()),pe())})}function $n(e){if(e.nextElementSibling){let t=e.nextElementSibling;if(t.tagName==="OL")return t;if(t.tagName==="P"&&!t.children.length)return $n(t)}}function Pn(e,t){return C(()=>{let r=$n(e);return typeof r!="undefined"?fr(r,e,t):S})}var Rn=Lt(Br());var Da=0;function In(e){if(e.nextElementSibling){let t=e.nextElementSibling;if(t.tagName==="OL")return t;if(t.tagName==="P"&&!t.children.length)return In(t)}}function za(e){return ge(e).pipe(m(({width:t})=>({scrollable:Tt(e).width>t})),te("scrollable"))}function jn(e,t){let{matches:r}=matchMedia("(hover)"),o=C(()=>{let n=new g,i=n.pipe(jr(1));n.subscribe(({scrollable:c})=>{c&&r?e.setAttribute("tabindex","0"):e.removeAttribute("tabindex")});let a=[];if(Rn.default.isSupported()&&(e.closest(".copy")||B("content.code.copy")&&!e.closest(".no-copy"))){let c=e.closest("pre");c.id=`__code_${Da++}`;let l=Sn(c.id);c.insertBefore(l,e),B("content.tooltips")&&a.push(mt(l,{viewport$}))}let s=e.closest(".highlight");if(s instanceof HTMLElement){let c=In(s);if(typeof c!="undefined"&&(s.classList.contains("annotate")||B("content.code.annotate"))){let l=fr(c,e,t);a.push(ge(s).pipe(W(i),m(({width:f,height:u})=>f&&u),K(),v(f=>f?l:S)))}}return P(":scope > span[id]",e).length&&e.classList.add("md-code__content"),za(e).pipe(w(c=>n.next(c)),_(()=>n.complete()),m(c=>$({ref:e},c)),Re(...a))});return B("content.lazy")?tt(e).pipe(b(n=>n),Te(1),v(()=>o)):o}function Na(e,{target$:t,print$:r}){let o=!0;return O(t.pipe(m(n=>n.closest("details:not([open])")),b(n=>e===n),m(()=>({action:"open",reveal:!0}))),r.pipe(b(n=>n||!o),w(()=>o=e.open),m(n=>({action:n?"open":"close"}))))}function Fn(e,t){return C(()=>{let r=new g;return r.subscribe(({action:o,reveal:n})=>{e.toggleAttribute("open",o==="open"),n&&e.scrollIntoView()}),Na(e,t).pipe(w(o=>r.next(o)),_(()=>r.complete()),m(o=>$({ref:e},o)))})}var Un=".node circle,.node ellipse,.node path,.node polygon,.node rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}marker{fill:var(--md-mermaid-edge-color)!important}.edgeLabel .label rect{fill:#0000}.flowchartTitleText{fill:var(--md-mermaid-label-fg-color)}.label{color:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.label foreignObject{line-height:normal;overflow:visible}.label div .edgeLabel{color:var(--md-mermaid-label-fg-color)}.edgeLabel,.edgeLabel p,.label div .edgeLabel{background-color:var(--md-mermaid-label-bg-color)}.edgeLabel,.edgeLabel p{fill:var(--md-mermaid-label-bg-color);color:var(--md-mermaid-edge-color)}.edgePath .path,.flowchart-link{stroke:var(--md-mermaid-edge-color);stroke-width:.05rem}.edgePath .arrowheadPath{fill:var(--md-mermaid-edge-color);stroke:none}.cluster rect{fill:var(--md-default-fg-color--lightest);stroke:var(--md-default-fg-color--lighter)}.cluster span{color:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}g #flowchart-circleEnd,g #flowchart-circleStart,g #flowchart-crossEnd,g #flowchart-crossStart,g #flowchart-pointEnd,g #flowchart-pointStart{stroke:none}.classDiagramTitleText{fill:var(--md-mermaid-label-fg-color)}g.classGroup line,g.classGroup rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}g.classGroup text{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.classLabel .box{fill:var(--md-mermaid-label-bg-color);background-color:var(--md-mermaid-label-bg-color);opacity:1}.classLabel .label{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.node .divider{stroke:var(--md-mermaid-node-fg-color)}.relation{stroke:var(--md-mermaid-edge-color)}.cardinality{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.cardinality text{fill:inherit!important}defs marker.marker.composition.class path,defs marker.marker.dependency.class path,defs marker.marker.extension.class path{fill:var(--md-mermaid-edge-color)!important;stroke:var(--md-mermaid-edge-color)!important}defs marker.marker.aggregation.class path{fill:var(--md-mermaid-label-bg-color)!important;stroke:var(--md-mermaid-edge-color)!important}.statediagramTitleText{fill:var(--md-mermaid-label-fg-color)}g.stateGroup rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}g.stateGroup .state-title{fill:var(--md-mermaid-label-fg-color)!important;font-family:var(--md-mermaid-font-family)}g.stateGroup .composit{fill:var(--md-mermaid-label-bg-color)}.nodeLabel,.nodeLabel p{color:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}a .nodeLabel{text-decoration:underline}.node circle.state-end,.node circle.state-start,.start-state{fill:var(--md-mermaid-edge-color);stroke:none}.end-state-inner,.end-state-outer{fill:var(--md-mermaid-edge-color)}.end-state-inner,.node circle.state-end{stroke:var(--md-mermaid-label-bg-color)}.transition{stroke:var(--md-mermaid-edge-color)}[id^=state-fork] rect,[id^=state-join] rect{fill:var(--md-mermaid-edge-color)!important;stroke:none!important}.statediagram-cluster.statediagram-cluster .inner{fill:var(--md-default-bg-color)}.statediagram-cluster rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}.statediagram-state rect.divider{fill:var(--md-default-fg-color--lightest);stroke:var(--md-default-fg-color--lighter)}defs #statediagram-barbEnd{stroke:var(--md-mermaid-edge-color)}[id^=entity] path,[id^=entity] rect{fill:var(--md-default-bg-color)}.relationshipLine{stroke:var(--md-mermaid-edge-color)}defs .marker.oneOrMore.er *,defs .marker.onlyOne.er *,defs .marker.zeroOrMore.er *,defs .marker.zeroOrOne.er *{stroke:var(--md-mermaid-edge-color)!important}text:not([class]):last-child{fill:var(--md-mermaid-label-fg-color)}.actor{fill:var(--md-mermaid-sequence-actor-bg-color);stroke:var(--md-mermaid-sequence-actor-border-color)}text.actor>tspan{fill:var(--md-mermaid-sequence-actor-fg-color);font-family:var(--md-mermaid-font-family)}line{stroke:var(--md-mermaid-sequence-actor-line-color)}.actor-man circle,.actor-man line{fill:var(--md-mermaid-sequence-actorman-bg-color);stroke:var(--md-mermaid-sequence-actorman-line-color)}.messageLine0,.messageLine1{stroke:var(--md-mermaid-sequence-message-line-color)}.note{fill:var(--md-mermaid-sequence-note-bg-color);stroke:var(--md-mermaid-sequence-note-border-color)}.loopText,.loopText>tspan,.messageText,.noteText>tspan{stroke:none;font-family:var(--md-mermaid-font-family)!important}.messageText{fill:var(--md-mermaid-sequence-message-fg-color)}.loopText,.loopText>tspan{fill:var(--md-mermaid-sequence-loop-fg-color)}.noteText>tspan{fill:var(--md-mermaid-sequence-note-fg-color)}#arrowhead path{fill:var(--md-mermaid-sequence-message-line-color);stroke:none}.loopLine{fill:var(--md-mermaid-sequence-loop-bg-color);stroke:var(--md-mermaid-sequence-loop-border-color)}.labelBox{fill:var(--md-mermaid-sequence-label-bg-color);stroke:none}.labelText,.labelText>span{fill:var(--md-mermaid-sequence-label-fg-color);font-family:var(--md-mermaid-font-family)}.sequenceNumber{fill:var(--md-mermaid-sequence-number-fg-color)}rect.rect{fill:var(--md-mermaid-sequence-box-bg-color);stroke:none}rect.rect+text.text{fill:var(--md-mermaid-sequence-box-fg-color)}defs #sequencenumber{fill:var(--md-mermaid-sequence-number-bg-color)!important}";var Gr,Qa=0;function Ka(){return typeof mermaid=="undefined"||mermaid instanceof Element?wt("https://unpkg.com/mermaid@11/dist/mermaid.min.js"):I(void 0)}function Wn(e){return e.classList.remove("mermaid"),Gr||(Gr=Ka().pipe(w(()=>mermaid.initialize({startOnLoad:!1,themeCSS:Un,sequence:{actorFontSize:"16px",messageFontSize:"16px",noteFontSize:"16px"}})),m(()=>{}),G(1))),Gr.subscribe(()=>co(null,null,function*(){e.classList.add("mermaid");let t=`__mermaid_${Qa++}`,r=x("div",{class:"mermaid"}),o=e.textContent,{svg:n,fn:i}=yield mermaid.render(t,o),a=r.attachShadow({mode:"closed"});a.innerHTML=n,e.replaceWith(r),i==null||i(a)})),Gr.pipe(m(()=>({ref:e})))}var Vn=x("table");function Dn(e){return e.replaceWith(Vn),Vn.replaceWith(An(e)),I({ref:e})}function Ya(e){let t=e.find(r=>r.checked)||e[0];return O(...e.map(r=>h(r,"change").pipe(m(()=>R(`label[for="${r.id}"]`))))).pipe(Q(R(`label[for="${t.id}"]`)),m(r=>({active:r})))}function zn(e,{viewport$:t,target$:r}){let o=R(".tabbed-labels",e),n=P(":scope > input",e),i=Kr("prev");e.append(i);let a=Kr("next");return e.append(a),C(()=>{let s=new g,p=s.pipe(Z(),ie(!0));N([s,ge(e),tt(e)]).pipe(W(p),Me(1,me)).subscribe({next([{active:c},l]){let f=De(c),{width:u}=ce(c);e.style.setProperty("--md-indicator-x",`${f.x}px`),e.style.setProperty("--md-indicator-width",`${u}px`);let d=pr(o);(f.xd.x+l.width)&&o.scrollTo({left:Math.max(0,f.x-16),behavior:"smooth"})},complete(){e.style.removeProperty("--md-indicator-x"),e.style.removeProperty("--md-indicator-width")}}),N([ze(o),ge(o)]).pipe(W(p)).subscribe(([c,l])=>{let f=Tt(o);i.hidden=c.x<16,a.hidden=c.x>f.width-l.width-16}),O(h(i,"click").pipe(m(()=>-1)),h(a,"click").pipe(m(()=>1))).pipe(W(p)).subscribe(c=>{let{width:l}=ce(o);o.scrollBy({left:l*c,behavior:"smooth"})}),r.pipe(W(p),b(c=>n.includes(c))).subscribe(c=>c.click()),o.classList.add("tabbed-labels--linked");for(let c of n){let l=R(`label[for="${c.id}"]`);l.replaceChildren(x("a",{href:`#${l.htmlFor}`,tabIndex:-1},...Array.from(l.childNodes))),h(l.firstElementChild,"click").pipe(W(p),b(f=>!(f.metaKey||f.ctrlKey)),w(f=>{f.preventDefault(),f.stopPropagation()})).subscribe(()=>{history.replaceState({},"",`#${l.htmlFor}`),l.click()})}return B("content.tabs.link")&&s.pipe(Ce(1),re(t)).subscribe(([{active:c},{offset:l}])=>{let f=c.innerText.trim();if(c.hasAttribute("data-md-switching"))c.removeAttribute("data-md-switching");else{let u=e.offsetTop-l.y;for(let y of P("[data-tabs]"))for(let L of P(":scope > input",y)){let X=R(`label[for="${L.id}"]`);if(X!==c&&X.innerText.trim()===f){X.setAttribute("data-md-switching",""),L.click();break}}window.scrollTo({top:e.offsetTop-u});let d=__md_get("__tabs")||[];__md_set("__tabs",[...new Set([f,...d])])}}),s.pipe(W(p)).subscribe(()=>{for(let c of P("audio, video",e))c.pause()}),Ya(n).pipe(w(c=>s.next(c)),_(()=>s.complete()),m(c=>$({ref:e},c)))}).pipe(Ke(se))}function Nn(e,{viewport$:t,target$:r,print$:o}){return O(...P(".annotate:not(.highlight)",e).map(n=>Pn(n,{target$:r,print$:o})),...P("pre:not(.mermaid) > code",e).map(n=>jn(n,{target$:r,print$:o})),...P("pre.mermaid",e).map(n=>Wn(n)),...P("table:not([class])",e).map(n=>Dn(n)),...P("details",e).map(n=>Fn(n,{target$:r,print$:o})),...P("[data-tabs]",e).map(n=>zn(n,{viewport$:t,target$:r})),...P("[title]",e).filter(()=>B("content.tooltips")).map(n=>mt(n,{viewport$:t})))}function Ba(e,{alert$:t}){return t.pipe(v(r=>O(I(!0),I(!1).pipe(Ge(2e3))).pipe(m(o=>({message:r,active:o})))))}function qn(e,t){let r=R(".md-typeset",e);return C(()=>{let o=new g;return o.subscribe(({message:n,active:i})=>{e.classList.toggle("md-dialog--active",i),r.textContent=n}),Ba(e,t).pipe(w(n=>o.next(n)),_(()=>o.complete()),m(n=>$({ref:e},n)))})}var Ga=0;function Ja(e,t){document.body.append(e);let{width:r}=ce(e);e.style.setProperty("--md-tooltip-width",`${r}px`),e.remove();let o=cr(t),n=typeof o!="undefined"?ze(o):I({x:0,y:0}),i=O(et(t),Ht(t)).pipe(K());return N([i,n]).pipe(m(([a,s])=>{let{x:p,y:c}=De(t),l=ce(t),f=t.closest("table");return f&&t.parentElement&&(p+=f.offsetLeft+t.parentElement.offsetLeft,c+=f.offsetTop+t.parentElement.offsetTop),{active:a,offset:{x:p-s.x+l.width/2-r/2,y:c-s.y+l.height+8}}}))}function Qn(e){let t=e.title;if(!t.length)return S;let r=`__tooltip_${Ga++}`,o=Pt(r,"inline"),n=R(".md-typeset",o);return n.innerHTML=t,C(()=>{let i=new g;return i.subscribe({next({offset:a}){o.style.setProperty("--md-tooltip-x",`${a.x}px`),o.style.setProperty("--md-tooltip-y",`${a.y}px`)},complete(){o.style.removeProperty("--md-tooltip-x"),o.style.removeProperty("--md-tooltip-y")}}),O(i.pipe(b(({active:a})=>a)),i.pipe(_e(250),b(({active:a})=>!a))).subscribe({next({active:a}){a?(e.insertAdjacentElement("afterend",o),e.setAttribute("aria-describedby",r),e.removeAttribute("title")):(o.remove(),e.removeAttribute("aria-describedby"),e.setAttribute("title",t))},complete(){o.remove(),e.removeAttribute("aria-describedby"),e.setAttribute("title",t)}}),i.pipe(Me(16,me)).subscribe(({active:a})=>{o.classList.toggle("md-tooltip--active",a)}),i.pipe(pt(125,me),b(()=>!!e.offsetParent),m(()=>e.offsetParent.getBoundingClientRect()),m(({x:a})=>a)).subscribe({next(a){a?o.style.setProperty("--md-tooltip-0",`${-a}px`):o.style.removeProperty("--md-tooltip-0")},complete(){o.style.removeProperty("--md-tooltip-0")}}),Ja(o,e).pipe(w(a=>i.next(a)),_(()=>i.complete()),m(a=>$({ref:e},a)))}).pipe(Ke(se))}function Xa({viewport$:e}){if(!B("header.autohide"))return I(!1);let t=e.pipe(m(({offset:{y:n}})=>n),Be(2,1),m(([n,i])=>[nMath.abs(i-n.y)>100),m(([,[n]])=>n),K()),o=Ne("search");return N([e,o]).pipe(m(([{offset:n},i])=>n.y>400&&!i),K(),v(n=>n?r:I(!1)),Q(!1))}function Kn(e,t){return C(()=>N([ge(e),Xa(t)])).pipe(m(([{height:r},o])=>({height:r,hidden:o})),K((r,o)=>r.height===o.height&&r.hidden===o.hidden),G(1))}function Yn(e,{header$:t,main$:r}){return C(()=>{let o=new g,n=o.pipe(Z(),ie(!0));o.pipe(te("active"),He(t)).subscribe(([{active:a},{hidden:s}])=>{e.classList.toggle("md-header--shadow",a&&!s),e.hidden=s});let i=ue(P("[title]",e)).pipe(b(()=>B("content.tooltips")),ne(a=>Qn(a)));return r.subscribe(o),t.pipe(W(n),m(a=>$({ref:e},a)),Re(i.pipe(W(n))))})}function Za(e,{viewport$:t,header$:r}){return mr(e,{viewport$:t,header$:r}).pipe(m(({offset:{y:o}})=>{let{height:n}=ce(e);return{active:o>=n}}),te("active"))}function Bn(e,t){return C(()=>{let r=new g;r.subscribe({next({active:n}){e.classList.toggle("md-header__title--active",n)},complete(){e.classList.remove("md-header__title--active")}});let o=fe(".md-content h1");return typeof o=="undefined"?S:Za(o,t).pipe(w(n=>r.next(n)),_(()=>r.complete()),m(n=>$({ref:e},n)))})}function Gn(e,{viewport$:t,header$:r}){let o=r.pipe(m(({height:i})=>i),K()),n=o.pipe(v(()=>ge(e).pipe(m(({height:i})=>({top:e.offsetTop,bottom:e.offsetTop+i})),te("bottom"))));return N([o,n,t]).pipe(m(([i,{top:a,bottom:s},{offset:{y:p},size:{height:c}}])=>(c=Math.max(0,c-Math.max(0,a-p,i)-Math.max(0,c+p-s)),{offset:a-i,height:c,active:a-i<=p})),K((i,a)=>i.offset===a.offset&&i.height===a.height&&i.active===a.active))}function es(e){let t=__md_get("__palette")||{index:e.findIndex(o=>matchMedia(o.getAttribute("data-md-color-media")).matches)},r=Math.max(0,Math.min(t.index,e.length-1));return I(...e).pipe(ne(o=>h(o,"change").pipe(m(()=>o))),Q(e[r]),m(o=>({index:e.indexOf(o),color:{media:o.getAttribute("data-md-color-media"),scheme:o.getAttribute("data-md-color-scheme"),primary:o.getAttribute("data-md-color-primary"),accent:o.getAttribute("data-md-color-accent")}})),G(1))}function Jn(e){let t=P("input",e),r=x("meta",{name:"theme-color"});document.head.appendChild(r);let o=x("meta",{name:"color-scheme"});document.head.appendChild(o);let n=$t("(prefers-color-scheme: light)");return C(()=>{let i=new g;return i.subscribe(a=>{if(document.body.setAttribute("data-md-color-switching",""),a.color.media==="(prefers-color-scheme)"){let s=matchMedia("(prefers-color-scheme: light)"),p=document.querySelector(s.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");a.color.scheme=p.getAttribute("data-md-color-scheme"),a.color.primary=p.getAttribute("data-md-color-primary"),a.color.accent=p.getAttribute("data-md-color-accent")}for(let[s,p]of Object.entries(a.color))document.body.setAttribute(`data-md-color-${s}`,p);for(let s=0;sa.key==="Enter"),re(i,(a,s)=>s)).subscribe(({index:a})=>{a=(a+1)%t.length,t[a].click(),t[a].focus()}),i.pipe(m(()=>{let a=Se("header"),s=window.getComputedStyle(a);return o.content=s.colorScheme,s.backgroundColor.match(/\d+/g).map(p=>(+p).toString(16).padStart(2,"0")).join("")})).subscribe(a=>r.content=`#${a}`),i.pipe(ve(se)).subscribe(()=>{document.body.removeAttribute("data-md-color-switching")}),es(t).pipe(W(n.pipe(Ce(1))),ct(),w(a=>i.next(a)),_(()=>i.complete()),m(a=>$({ref:e},a)))})}function Xn(e,{progress$:t}){return C(()=>{let r=new g;return r.subscribe(({value:o})=>{e.style.setProperty("--md-progress-value",`${o}`)}),t.pipe(w(o=>r.next({value:o})),_(()=>r.complete()),m(o=>({ref:e,value:o})))})}var Jr=Lt(Br());function ts(e){e.setAttribute("data-md-copying","");let t=e.closest("[data-copy]"),r=t?t.getAttribute("data-copy"):e.innerText;return e.removeAttribute("data-md-copying"),r.trimEnd()}function Zn({alert$:e}){Jr.default.isSupported()&&new j(t=>{new Jr.default("[data-clipboard-target], [data-clipboard-text]",{text:r=>r.getAttribute("data-clipboard-text")||ts(R(r.getAttribute("data-clipboard-target")))}).on("success",r=>t.next(r))}).pipe(w(t=>{t.trigger.focus()}),m(()=>Ee("clipboard.copied"))).subscribe(e)}function ei(e,t){return e.protocol=t.protocol,e.hostname=t.hostname,e}function rs(e,t){let r=new Map;for(let o of P("url",e)){let n=R("loc",o),i=[ei(new URL(n.textContent),t)];r.set(`${i[0]}`,i);for(let a of P("[rel=alternate]",o)){let s=a.getAttribute("href");s!=null&&i.push(ei(new URL(s),t))}}return r}function ur(e){return un(new URL("sitemap.xml",e)).pipe(m(t=>rs(t,new URL(e))),de(()=>I(new Map)))}function os(e,t){if(!(e.target instanceof Element))return S;let r=e.target.closest("a");if(r===null)return S;if(r.target||e.metaKey||e.ctrlKey)return S;let o=new URL(r.href);return o.search=o.hash="",t.has(`${o}`)?(e.preventDefault(),I(new URL(r.href))):S}function ti(e){let t=new Map;for(let r of P(":scope > *",e.head))t.set(r.outerHTML,r);return t}function ri(e){for(let t of P("[href], [src]",e))for(let r of["href","src"]){let o=t.getAttribute(r);if(o&&!/^(?:[a-z]+:)?\/\//i.test(o)){t[r]=t[r];break}}return I(e)}function ns(e){for(let o of["[data-md-component=announce]","[data-md-component=container]","[data-md-component=header-topic]","[data-md-component=outdated]","[data-md-component=logo]","[data-md-component=skip]",...B("navigation.tabs.sticky")?["[data-md-component=tabs]"]:[]]){let n=fe(o),i=fe(o,e);typeof n!="undefined"&&typeof i!="undefined"&&n.replaceWith(i)}let t=ti(document);for(let[o,n]of ti(e))t.has(o)?t.delete(o):document.head.appendChild(n);for(let o of t.values()){let n=o.getAttribute("name");n!=="theme-color"&&n!=="color-scheme"&&o.remove()}let r=Se("container");return We(P("script",r)).pipe(v(o=>{let n=e.createElement("script");if(o.src){for(let i of o.getAttributeNames())n.setAttribute(i,o.getAttribute(i));return o.replaceWith(n),new j(i=>{n.onload=()=>i.complete()})}else return n.textContent=o.textContent,o.replaceWith(n),S}),Z(),ie(document))}function oi({location$:e,viewport$:t,progress$:r}){let o=xe();if(location.protocol==="file:")return S;let n=ur(o.base);I(document).subscribe(ri);let i=h(document.body,"click").pipe(He(n),v(([p,c])=>os(p,c)),pe()),a=h(window,"popstate").pipe(m(ye),pe());i.pipe(re(t)).subscribe(([p,{offset:c}])=>{history.replaceState(c,""),history.pushState(null,"",p)}),O(i,a).subscribe(e);let s=e.pipe(te("pathname"),v(p=>fn(p,{progress$:r}).pipe(de(()=>(lt(p,!0),S)))),v(ri),v(ns),pe());return O(s.pipe(re(e,(p,c)=>c)),s.pipe(v(()=>e),te("hash")),e.pipe(K((p,c)=>p.pathname===c.pathname&&p.hash===c.hash),v(()=>i),w(()=>history.back()))).subscribe(p=>{var c,l;history.state!==null||!p.hash?window.scrollTo(0,(l=(c=history.state)==null?void 0:c.y)!=null?l:0):(history.scrollRestoration="auto",pn(p.hash),history.scrollRestoration="manual")}),e.subscribe(()=>{history.scrollRestoration="manual"}),h(window,"beforeunload").subscribe(()=>{history.scrollRestoration="auto"}),t.pipe(te("offset"),_e(100)).subscribe(({offset:p})=>{history.replaceState(p,"")}),s}var ni=Lt(qr());function ii(e){let t=e.separator.split("|").map(n=>n.replace(/(\(\?[!=<][^)]+\))/g,"").length===0?"\uFFFD":n).join("|"),r=new RegExp(t,"img"),o=(n,i,a)=>`${i}${a}`;return n=>{n=n.replace(/[\s*+\-:~^]+/g," ").trim();let i=new RegExp(`(^|${e.separator}|)(${n.replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&").replace(r,"|")})`,"img");return a=>(0,ni.default)(a).replace(i,o).replace(/<\/mark>(\s+)]*>/img,"$1")}}function It(e){return e.type===1}function dr(e){return e.type===3}function ai(e,t){let r=yn(e);return O(I(location.protocol!=="file:"),Ne("search")).pipe(Ae(o=>o),v(()=>t)).subscribe(({config:o,docs:n})=>r.next({type:0,data:{config:o,docs:n,options:{suggest:B("search.suggest")}}})),r}function si(e){var l;let{selectedVersionSitemap:t,selectedVersionBaseURL:r,currentLocation:o,currentBaseURL:n}=e,i=(l=Xr(n))==null?void 0:l.pathname;if(i===void 0)return;let a=ss(o.pathname,i);if(a===void 0)return;let s=ps(t.keys());if(!t.has(s))return;let p=Xr(a,s);if(!p||!t.has(p.href))return;let c=Xr(a,r);if(c)return c.hash=o.hash,c.search=o.search,c}function Xr(e,t){try{return new URL(e,t)}catch(r){return}}function ss(e,t){if(e.startsWith(t))return e.slice(t.length)}function cs(e,t){let r=Math.min(e.length,t.length),o;for(o=0;oS)),o=r.pipe(m(n=>{let[,i]=t.base.match(/([^/]+)\/?$/);return n.find(({version:a,aliases:s})=>a===i||s.includes(i))||n[0]}));r.pipe(m(n=>new Map(n.map(i=>[`${new URL(`../${i.version}/`,t.base)}`,i]))),v(n=>h(document.body,"click").pipe(b(i=>!i.metaKey&&!i.ctrlKey),re(o),v(([i,a])=>{if(i.target instanceof Element){let s=i.target.closest("a");if(s&&!s.target&&n.has(s.href)){let p=s.href;return!i.target.closest(".md-version")&&n.get(p)===a?S:(i.preventDefault(),I(new URL(p)))}}return S}),v(i=>ur(i).pipe(m(a=>{var s;return(s=si({selectedVersionSitemap:a,selectedVersionBaseURL:i,currentLocation:ye(),currentBaseURL:t.base}))!=null?s:i})))))).subscribe(n=>lt(n,!0)),N([r,o]).subscribe(([n,i])=>{R(".md-header__topic").appendChild(Cn(n,i))}),e.pipe(v(()=>o)).subscribe(n=>{var s;let i=new URL(t.base),a=__md_get("__outdated",sessionStorage,i);if(a===null){a=!0;let p=((s=t.version)==null?void 0:s.default)||"latest";Array.isArray(p)||(p=[p]);e:for(let c of p)for(let l of n.aliases.concat(n.version))if(new RegExp(c,"i").test(l)){a=!1;break e}__md_set("__outdated",a,sessionStorage,i)}if(a)for(let p of ae("outdated"))p.hidden=!1})}function ls(e,{worker$:t}){let{searchParams:r}=ye();r.has("q")&&(Je("search",!0),e.value=r.get("q"),e.focus(),Ne("search").pipe(Ae(i=>!i)).subscribe(()=>{let i=ye();i.searchParams.delete("q"),history.replaceState({},"",`${i}`)}));let o=et(e),n=O(t.pipe(Ae(It)),h(e,"keyup"),o).pipe(m(()=>e.value),K());return N([n,o]).pipe(m(([i,a])=>({value:i,focus:a})),G(1))}function pi(e,{worker$:t}){let r=new g,o=r.pipe(Z(),ie(!0));N([t.pipe(Ae(It)),r],(i,a)=>a).pipe(te("value")).subscribe(({value:i})=>t.next({type:2,data:i})),r.pipe(te("focus")).subscribe(({focus:i})=>{i&&Je("search",i)}),h(e.form,"reset").pipe(W(o)).subscribe(()=>e.focus());let n=R("header [for=__search]");return h(n,"click").subscribe(()=>e.focus()),ls(e,{worker$:t}).pipe(w(i=>r.next(i)),_(()=>r.complete()),m(i=>$({ref:e},i)),G(1))}function li(e,{worker$:t,query$:r}){let o=new g,n=on(e.parentElement).pipe(b(Boolean)),i=e.parentElement,a=R(":scope > :first-child",e),s=R(":scope > :last-child",e);Ne("search").subscribe(l=>s.setAttribute("role",l?"list":"presentation")),o.pipe(re(r),Wr(t.pipe(Ae(It)))).subscribe(([{items:l},{value:f}])=>{switch(l.length){case 0:a.textContent=f.length?Ee("search.result.none"):Ee("search.result.placeholder");break;case 1:a.textContent=Ee("search.result.one");break;default:let u=sr(l.length);a.textContent=Ee("search.result.other",u)}});let p=o.pipe(w(()=>s.innerHTML=""),v(({items:l})=>O(I(...l.slice(0,10)),I(...l.slice(10)).pipe(Be(4),Dr(n),v(([f])=>f)))),m(Mn),pe());return p.subscribe(l=>s.appendChild(l)),p.pipe(ne(l=>{let f=fe("details",l);return typeof f=="undefined"?S:h(f,"toggle").pipe(W(o),m(()=>f))})).subscribe(l=>{l.open===!1&&l.offsetTop<=i.scrollTop&&i.scrollTo({top:l.offsetTop})}),t.pipe(b(dr),m(({data:l})=>l)).pipe(w(l=>o.next(l)),_(()=>o.complete()),m(l=>$({ref:e},l)))}function ms(e,{query$:t}){return t.pipe(m(({value:r})=>{let o=ye();return o.hash="",r=r.replace(/\s+/g,"+").replace(/&/g,"%26").replace(/=/g,"%3D"),o.search=`q=${r}`,{url:o}}))}function mi(e,t){let r=new g,o=r.pipe(Z(),ie(!0));return r.subscribe(({url:n})=>{e.setAttribute("data-clipboard-text",e.href),e.href=`${n}`}),h(e,"click").pipe(W(o)).subscribe(n=>n.preventDefault()),ms(e,t).pipe(w(n=>r.next(n)),_(()=>r.complete()),m(n=>$({ref:e},n)))}function fi(e,{worker$:t,keyboard$:r}){let o=new g,n=Se("search-query"),i=O(h(n,"keydown"),h(n,"focus")).pipe(ve(se),m(()=>n.value),K());return o.pipe(He(i),m(([{suggest:s},p])=>{let c=p.split(/([\s-]+)/);if(s!=null&&s.length&&c[c.length-1]){let l=s[s.length-1];l.startsWith(c[c.length-1])&&(c[c.length-1]=l)}else c.length=0;return c})).subscribe(s=>e.innerHTML=s.join("").replace(/\s/g," ")),r.pipe(b(({mode:s})=>s==="search")).subscribe(s=>{switch(s.type){case"ArrowRight":e.innerText.length&&n.selectionStart===n.value.length&&(n.value=e.innerText);break}}),t.pipe(b(dr),m(({data:s})=>s)).pipe(w(s=>o.next(s)),_(()=>o.complete()),m(()=>({ref:e})))}function ui(e,{index$:t,keyboard$:r}){let o=xe();try{let n=ai(o.search,t),i=Se("search-query",e),a=Se("search-result",e);h(e,"click").pipe(b(({target:p})=>p instanceof Element&&!!p.closest("a"))).subscribe(()=>Je("search",!1)),r.pipe(b(({mode:p})=>p==="search")).subscribe(p=>{let c=Ie();switch(p.type){case"Enter":if(c===i){let l=new Map;for(let f of P(":first-child [href]",a)){let u=f.firstElementChild;l.set(f,parseFloat(u.getAttribute("data-md-score")))}if(l.size){let[[f]]=[...l].sort(([,u],[,d])=>d-u);f.click()}p.claim()}break;case"Escape":case"Tab":Je("search",!1),i.blur();break;case"ArrowUp":case"ArrowDown":if(typeof c=="undefined")i.focus();else{let l=[i,...P(":not(details) > [href], summary, details[open] [href]",a)],f=Math.max(0,(Math.max(0,l.indexOf(c))+l.length+(p.type==="ArrowUp"?-1:1))%l.length);l[f].focus()}p.claim();break;default:i!==Ie()&&i.focus()}}),r.pipe(b(({mode:p})=>p==="global")).subscribe(p=>{switch(p.type){case"f":case"s":case"/":i.focus(),i.select(),p.claim();break}});let s=pi(i,{worker$:n});return O(s,li(a,{worker$:n,query$:s})).pipe(Re(...ae("search-share",e).map(p=>mi(p,{query$:s})),...ae("search-suggest",e).map(p=>fi(p,{worker$:n,keyboard$:r}))))}catch(n){return e.hidden=!0,Ye}}function di(e,{index$:t,location$:r}){return N([t,r.pipe(Q(ye()),b(o=>!!o.searchParams.get("h")))]).pipe(m(([o,n])=>ii(o.config)(n.searchParams.get("h"))),m(o=>{var a;let n=new Map,i=document.createNodeIterator(e,NodeFilter.SHOW_TEXT);for(let s=i.nextNode();s;s=i.nextNode())if((a=s.parentElement)!=null&&a.offsetHeight){let p=s.textContent,c=o(p);c.length>p.length&&n.set(s,c)}for(let[s,p]of n){let{childNodes:c}=x("span",null,p);s.replaceWith(...Array.from(c))}return{ref:e,nodes:n}}))}function fs(e,{viewport$:t,main$:r}){let o=e.closest(".md-grid"),n=o.offsetTop-o.parentElement.offsetTop;return N([r,t]).pipe(m(([{offset:i,height:a},{offset:{y:s}}])=>(a=a+Math.min(n,Math.max(0,s-i))-n,{height:a,locked:s>=i+n})),K((i,a)=>i.height===a.height&&i.locked===a.locked))}function Zr(e,o){var n=o,{header$:t}=n,r=so(n,["header$"]);let i=R(".md-sidebar__scrollwrap",e),{y:a}=De(i);return C(()=>{let s=new g,p=s.pipe(Z(),ie(!0)),c=s.pipe(Me(0,me));return c.pipe(re(t)).subscribe({next([{height:l},{height:f}]){i.style.height=`${l-2*a}px`,e.style.top=`${f}px`},complete(){i.style.height="",e.style.top=""}}),c.pipe(Ae()).subscribe(()=>{for(let l of P(".md-nav__link--active[href]",e)){if(!l.clientHeight)continue;let f=l.closest(".md-sidebar__scrollwrap");if(typeof f!="undefined"){let u=l.offsetTop-f.offsetTop,{height:d}=ce(f);f.scrollTo({top:u-d/2})}}}),ue(P("label[tabindex]",e)).pipe(ne(l=>h(l,"click").pipe(ve(se),m(()=>l),W(p)))).subscribe(l=>{let f=R(`[id="${l.htmlFor}"]`);R(`[aria-labelledby="${l.id}"]`).setAttribute("aria-expanded",`${f.checked}`)}),fs(e,r).pipe(w(l=>s.next(l)),_(()=>s.complete()),m(l=>$({ref:e},l)))})}function hi(e,t){if(typeof t!="undefined"){let r=`https://api.github.com/repos/${e}/${t}`;return st(je(`${r}/releases/latest`).pipe(de(()=>S),m(o=>({version:o.tag_name})),Ve({})),je(r).pipe(de(()=>S),m(o=>({stars:o.stargazers_count,forks:o.forks_count})),Ve({}))).pipe(m(([o,n])=>$($({},o),n)))}else{let r=`https://api.github.com/users/${e}`;return je(r).pipe(m(o=>({repositories:o.public_repos})),Ve({}))}}function bi(e,t){let r=`https://${e}/api/v4/projects/${encodeURIComponent(t)}`;return st(je(`${r}/releases/permalink/latest`).pipe(de(()=>S),m(({tag_name:o})=>({version:o})),Ve({})),je(r).pipe(de(()=>S),m(({star_count:o,forks_count:n})=>({stars:o,forks:n})),Ve({}))).pipe(m(([o,n])=>$($({},o),n)))}function vi(e){let t=e.match(/^.+github\.com\/([^/]+)\/?([^/]+)?/i);if(t){let[,r,o]=t;return hi(r,o)}if(t=e.match(/^.+?([^/]*gitlab[^/]+)\/(.+?)\/?$/i),t){let[,r,o]=t;return bi(r,o)}return S}var us;function ds(e){return us||(us=C(()=>{let t=__md_get("__source",sessionStorage);if(t)return I(t);if(ae("consent").length){let o=__md_get("__consent");if(!(o&&o.github))return S}return vi(e.href).pipe(w(o=>__md_set("__source",o,sessionStorage)))}).pipe(de(()=>S),b(t=>Object.keys(t).length>0),m(t=>({facts:t})),G(1)))}function gi(e){let t=R(":scope > :last-child",e);return C(()=>{let r=new g;return r.subscribe(({facts:o})=>{t.appendChild(_n(o)),t.classList.add("md-source__repository--active")}),ds(e).pipe(w(o=>r.next(o)),_(()=>r.complete()),m(o=>$({ref:e},o)))})}function hs(e,{viewport$:t,header$:r}){return ge(document.body).pipe(v(()=>mr(e,{header$:r,viewport$:t})),m(({offset:{y:o}})=>({hidden:o>=10})),te("hidden"))}function yi(e,t){return C(()=>{let r=new g;return r.subscribe({next({hidden:o}){e.hidden=o},complete(){e.hidden=!1}}),(B("navigation.tabs.sticky")?I({hidden:!1}):hs(e,t)).pipe(w(o=>r.next(o)),_(()=>r.complete()),m(o=>$({ref:e},o)))})}function bs(e,{viewport$:t,header$:r}){let o=new Map,n=P(".md-nav__link",e);for(let s of n){let p=decodeURIComponent(s.hash.substring(1)),c=fe(`[id="${p}"]`);typeof c!="undefined"&&o.set(s,c)}let i=r.pipe(te("height"),m(({height:s})=>{let p=Se("main"),c=R(":scope > :first-child",p);return s+.8*(c.offsetTop-p.offsetTop)}),pe());return ge(document.body).pipe(te("height"),v(s=>C(()=>{let p=[];return I([...o].reduce((c,[l,f])=>{for(;p.length&&o.get(p[p.length-1]).tagName>=f.tagName;)p.pop();let u=f.offsetTop;for(;!u&&f.parentElement;)f=f.parentElement,u=f.offsetTop;let d=f.offsetParent;for(;d;d=d.offsetParent)u+=d.offsetTop;return c.set([...p=[...p,l]].reverse(),u)},new Map))}).pipe(m(p=>new Map([...p].sort(([,c],[,l])=>c-l))),He(i),v(([p,c])=>t.pipe(Fr(([l,f],{offset:{y:u},size:d})=>{let y=u+d.height>=Math.floor(s.height);for(;f.length;){let[,L]=f[0];if(L-c=u&&!y)f=[l.pop(),...f];else break}return[l,f]},[[],[...p]]),K((l,f)=>l[0]===f[0]&&l[1]===f[1])))))).pipe(m(([s,p])=>({prev:s.map(([c])=>c),next:p.map(([c])=>c)})),Q({prev:[],next:[]}),Be(2,1),m(([s,p])=>s.prev.length{let i=new g,a=i.pipe(Z(),ie(!0));if(i.subscribe(({prev:s,next:p})=>{for(let[c]of p)c.classList.remove("md-nav__link--passed"),c.classList.remove("md-nav__link--active");for(let[c,[l]]of s.entries())l.classList.add("md-nav__link--passed"),l.classList.toggle("md-nav__link--active",c===s.length-1)}),B("toc.follow")){let s=O(t.pipe(_e(1),m(()=>{})),t.pipe(_e(250),m(()=>"smooth")));i.pipe(b(({prev:p})=>p.length>0),He(o.pipe(ve(se))),re(s)).subscribe(([[{prev:p}],c])=>{let[l]=p[p.length-1];if(l.offsetHeight){let f=cr(l);if(typeof f!="undefined"){let u=l.offsetTop-f.offsetTop,{height:d}=ce(f);f.scrollTo({top:u-d/2,behavior:c})}}})}return B("navigation.tracking")&&t.pipe(W(a),te("offset"),_e(250),Ce(1),W(n.pipe(Ce(1))),ct({delay:250}),re(i)).subscribe(([,{prev:s}])=>{let p=ye(),c=s[s.length-1];if(c&&c.length){let[l]=c,{hash:f}=new URL(l.href);p.hash!==f&&(p.hash=f,history.replaceState({},"",`${p}`))}else p.hash="",history.replaceState({},"",`${p}`)}),bs(e,{viewport$:t,header$:r}).pipe(w(s=>i.next(s)),_(()=>i.complete()),m(s=>$({ref:e},s)))})}function vs(e,{viewport$:t,main$:r,target$:o}){let n=t.pipe(m(({offset:{y:a}})=>a),Be(2,1),m(([a,s])=>a>s&&s>0),K()),i=r.pipe(m(({active:a})=>a));return N([i,n]).pipe(m(([a,s])=>!(a&&s)),K(),W(o.pipe(Ce(1))),ie(!0),ct({delay:250}),m(a=>({hidden:a})))}function Ei(e,{viewport$:t,header$:r,main$:o,target$:n}){let i=new g,a=i.pipe(Z(),ie(!0));return i.subscribe({next({hidden:s}){e.hidden=s,s?(e.setAttribute("tabindex","-1"),e.blur()):e.removeAttribute("tabindex")},complete(){e.style.top="",e.hidden=!0,e.removeAttribute("tabindex")}}),r.pipe(W(a),te("height")).subscribe(({height:s})=>{e.style.top=`${s+16}px`}),h(e,"click").subscribe(s=>{s.preventDefault(),window.scrollTo({top:0})}),vs(e,{viewport$:t,main$:o,target$:n}).pipe(w(s=>i.next(s)),_(()=>i.complete()),m(s=>$({ref:e},s)))}function wi({document$:e,viewport$:t}){e.pipe(v(()=>P(".md-ellipsis")),ne(r=>tt(r).pipe(W(e.pipe(Ce(1))),b(o=>o),m(()=>r),Te(1))),b(r=>r.offsetWidth{let o=r.innerText,n=r.closest("a")||r;return n.title=o,B("content.tooltips")?mt(n,{viewport$:t}).pipe(W(e.pipe(Ce(1))),_(()=>n.removeAttribute("title"))):S})).subscribe(),B("content.tooltips")&&e.pipe(v(()=>P(".md-status")),ne(r=>mt(r,{viewport$:t}))).subscribe()}function Ti({document$:e,tablet$:t}){e.pipe(v(()=>P(".md-toggle--indeterminate")),w(r=>{r.indeterminate=!0,r.checked=!1}),ne(r=>h(r,"change").pipe(Vr(()=>r.classList.contains("md-toggle--indeterminate")),m(()=>r))),re(t)).subscribe(([r,o])=>{r.classList.remove("md-toggle--indeterminate"),o&&(r.checked=!1)})}function gs(){return/(iPad|iPhone|iPod)/.test(navigator.userAgent)}function Si({document$:e}){e.pipe(v(()=>P("[data-md-scrollfix]")),w(t=>t.removeAttribute("data-md-scrollfix")),b(gs),ne(t=>h(t,"touchstart").pipe(m(()=>t)))).subscribe(t=>{let r=t.scrollTop;r===0?t.scrollTop=1:r+t.offsetHeight===t.scrollHeight&&(t.scrollTop=r-1)})}function Oi({viewport$:e,tablet$:t}){N([Ne("search"),t]).pipe(m(([r,o])=>r&&!o),v(r=>I(r).pipe(Ge(r?400:100))),re(e)).subscribe(([r,{offset:{y:o}}])=>{if(r)document.body.setAttribute("data-md-scrolllock",""),document.body.style.top=`-${o}px`;else{let n=-1*parseInt(document.body.style.top,10);document.body.removeAttribute("data-md-scrolllock"),document.body.style.top="",n&&window.scrollTo(0,n)}})}Object.entries||(Object.entries=function(e){let t=[];for(let r of Object.keys(e))t.push([r,e[r]]);return t});Object.values||(Object.values=function(e){let t=[];for(let r of Object.keys(e))t.push(e[r]);return t});typeof Element!="undefined"&&(Element.prototype.scrollTo||(Element.prototype.scrollTo=function(e,t){typeof e=="object"?(this.scrollLeft=e.left,this.scrollTop=e.top):(this.scrollLeft=e,this.scrollTop=t)}),Element.prototype.replaceWith||(Element.prototype.replaceWith=function(...e){let t=this.parentNode;if(t){e.length===0&&t.removeChild(this);for(let r=e.length-1;r>=0;r--){let o=e[r];typeof o=="string"?o=document.createTextNode(o):o.parentNode&&o.parentNode.removeChild(o),r?t.insertBefore(this.previousSibling,o):t.replaceChild(o,this)}}}));function ys(){return location.protocol==="file:"?wt(`${new URL("search/search_index.js",eo.base)}`).pipe(m(()=>__index),G(1)):je(new URL("search/search_index.json",eo.base))}document.documentElement.classList.remove("no-js");document.documentElement.classList.add("js");var ot=Go(),Ft=sn(),Ot=ln(Ft),to=an(),Oe=gn(),hr=$t("(min-width: 960px)"),Mi=$t("(min-width: 1220px)"),_i=mn(),eo=xe(),Ai=document.forms.namedItem("search")?ys():Ye,ro=new g;Zn({alert$:ro});var oo=new g;B("navigation.instant")&&oi({location$:Ft,viewport$:Oe,progress$:oo}).subscribe(ot);var Li;((Li=eo.version)==null?void 0:Li.provider)==="mike"&&ci({document$:ot});O(Ft,Ot).pipe(Ge(125)).subscribe(()=>{Je("drawer",!1),Je("search",!1)});to.pipe(b(({mode:e})=>e==="global")).subscribe(e=>{switch(e.type){case"p":case",":let t=fe("link[rel=prev]");typeof t!="undefined"&<(t);break;case"n":case".":let r=fe("link[rel=next]");typeof r!="undefined"&<(r);break;case"Enter":let o=Ie();o instanceof HTMLLabelElement&&o.click()}});wi({viewport$:Oe,document$:ot});Ti({document$:ot,tablet$:hr});Si({document$:ot});Oi({viewport$:Oe,tablet$:hr});var rt=Kn(Se("header"),{viewport$:Oe}),jt=ot.pipe(m(()=>Se("main")),v(e=>Gn(e,{viewport$:Oe,header$:rt})),G(1)),xs=O(...ae("consent").map(e=>En(e,{target$:Ot})),...ae("dialog").map(e=>qn(e,{alert$:ro})),...ae("palette").map(e=>Jn(e)),...ae("progress").map(e=>Xn(e,{progress$:oo})),...ae("search").map(e=>ui(e,{index$:Ai,keyboard$:to})),...ae("source").map(e=>gi(e))),Es=C(()=>O(...ae("announce").map(e=>xn(e)),...ae("content").map(e=>Nn(e,{viewport$:Oe,target$:Ot,print$:_i})),...ae("content").map(e=>B("search.highlight")?di(e,{index$:Ai,location$:Ft}):S),...ae("header").map(e=>Yn(e,{viewport$:Oe,header$:rt,main$:jt})),...ae("header-title").map(e=>Bn(e,{viewport$:Oe,header$:rt})),...ae("sidebar").map(e=>e.getAttribute("data-md-type")==="navigation"?zr(Mi,()=>Zr(e,{viewport$:Oe,header$:rt,main$:jt})):zr(hr,()=>Zr(e,{viewport$:Oe,header$:rt,main$:jt}))),...ae("tabs").map(e=>yi(e,{viewport$:Oe,header$:rt})),...ae("toc").map(e=>xi(e,{viewport$:Oe,header$:rt,main$:jt,target$:Ot})),...ae("top").map(e=>Ei(e,{viewport$:Oe,header$:rt,main$:jt,target$:Ot})))),Ci=ot.pipe(v(()=>Es),Re(xs),G(1));Ci.subscribe();window.document$=ot;window.location$=Ft;window.target$=Ot;window.keyboard$=to;window.viewport$=Oe;window.tablet$=hr;window.screen$=Mi;window.print$=_i;window.alert$=ro;window.progress$=oo;window.component$=Ci;})(); +//# sourceMappingURL=bundle.13a4f30d.min.js.map diff --git a/HEAD/assets/javascripts/bundle.c8b220af.min.js.map b/HEAD/assets/javascripts/bundle.13a4f30d.min.js.map similarity index 82% rename from HEAD/assets/javascripts/bundle.c8b220af.min.js.map rename to HEAD/assets/javascripts/bundle.13a4f30d.min.js.map index d835be56..8941cb89 100644 --- a/HEAD/assets/javascripts/bundle.c8b220af.min.js.map +++ b/HEAD/assets/javascripts/bundle.13a4f30d.min.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["node_modules/focus-visible/dist/focus-visible.js", "node_modules/escape-html/index.js", "node_modules/clipboard/dist/clipboard.js", "src/templates/assets/javascripts/bundle.ts", "node_modules/tslib/tslib.es6.mjs", "node_modules/rxjs/src/internal/util/isFunction.ts", "node_modules/rxjs/src/internal/util/createErrorClass.ts", "node_modules/rxjs/src/internal/util/UnsubscriptionError.ts", "node_modules/rxjs/src/internal/util/arrRemove.ts", "node_modules/rxjs/src/internal/Subscription.ts", "node_modules/rxjs/src/internal/config.ts", "node_modules/rxjs/src/internal/scheduler/timeoutProvider.ts", "node_modules/rxjs/src/internal/util/reportUnhandledError.ts", "node_modules/rxjs/src/internal/util/noop.ts", "node_modules/rxjs/src/internal/NotificationFactories.ts", "node_modules/rxjs/src/internal/util/errorContext.ts", "node_modules/rxjs/src/internal/Subscriber.ts", "node_modules/rxjs/src/internal/symbol/observable.ts", "node_modules/rxjs/src/internal/util/identity.ts", "node_modules/rxjs/src/internal/util/pipe.ts", "node_modules/rxjs/src/internal/Observable.ts", "node_modules/rxjs/src/internal/util/lift.ts", "node_modules/rxjs/src/internal/operators/OperatorSubscriber.ts", "node_modules/rxjs/src/internal/scheduler/animationFrameProvider.ts", "node_modules/rxjs/src/internal/util/ObjectUnsubscribedError.ts", "node_modules/rxjs/src/internal/Subject.ts", "node_modules/rxjs/src/internal/BehaviorSubject.ts", "node_modules/rxjs/src/internal/scheduler/dateTimestampProvider.ts", "node_modules/rxjs/src/internal/ReplaySubject.ts", "node_modules/rxjs/src/internal/scheduler/Action.ts", "node_modules/rxjs/src/internal/scheduler/intervalProvider.ts", "node_modules/rxjs/src/internal/scheduler/AsyncAction.ts", "node_modules/rxjs/src/internal/Scheduler.ts", "node_modules/rxjs/src/internal/scheduler/AsyncScheduler.ts", "node_modules/rxjs/src/internal/scheduler/async.ts", "node_modules/rxjs/src/internal/scheduler/QueueAction.ts", "node_modules/rxjs/src/internal/scheduler/QueueScheduler.ts", "node_modules/rxjs/src/internal/scheduler/queue.ts", "node_modules/rxjs/src/internal/scheduler/AnimationFrameAction.ts", "node_modules/rxjs/src/internal/scheduler/AnimationFrameScheduler.ts", "node_modules/rxjs/src/internal/scheduler/animationFrame.ts", "node_modules/rxjs/src/internal/observable/empty.ts", "node_modules/rxjs/src/internal/util/isScheduler.ts", "node_modules/rxjs/src/internal/util/args.ts", "node_modules/rxjs/src/internal/util/isArrayLike.ts", "node_modules/rxjs/src/internal/util/isPromise.ts", "node_modules/rxjs/src/internal/util/isInteropObservable.ts", "node_modules/rxjs/src/internal/util/isAsyncIterable.ts", "node_modules/rxjs/src/internal/util/throwUnobservableError.ts", "node_modules/rxjs/src/internal/symbol/iterator.ts", "node_modules/rxjs/src/internal/util/isIterable.ts", "node_modules/rxjs/src/internal/util/isReadableStreamLike.ts", "node_modules/rxjs/src/internal/observable/innerFrom.ts", "node_modules/rxjs/src/internal/util/executeSchedule.ts", "node_modules/rxjs/src/internal/operators/observeOn.ts", "node_modules/rxjs/src/internal/operators/subscribeOn.ts", "node_modules/rxjs/src/internal/scheduled/scheduleObservable.ts", "node_modules/rxjs/src/internal/scheduled/schedulePromise.ts", "node_modules/rxjs/src/internal/scheduled/scheduleArray.ts", "node_modules/rxjs/src/internal/scheduled/scheduleIterable.ts", "node_modules/rxjs/src/internal/scheduled/scheduleAsyncIterable.ts", "node_modules/rxjs/src/internal/scheduled/scheduleReadableStreamLike.ts", "node_modules/rxjs/src/internal/scheduled/scheduled.ts", "node_modules/rxjs/src/internal/observable/from.ts", "node_modules/rxjs/src/internal/observable/of.ts", "node_modules/rxjs/src/internal/observable/throwError.ts", "node_modules/rxjs/src/internal/util/EmptyError.ts", "node_modules/rxjs/src/internal/util/isDate.ts", "node_modules/rxjs/src/internal/operators/map.ts", "node_modules/rxjs/src/internal/util/mapOneOrManyArgs.ts", "node_modules/rxjs/src/internal/util/argsArgArrayOrObject.ts", "node_modules/rxjs/src/internal/util/createObject.ts", "node_modules/rxjs/src/internal/observable/combineLatest.ts", "node_modules/rxjs/src/internal/operators/mergeInternals.ts", "node_modules/rxjs/src/internal/operators/mergeMap.ts", "node_modules/rxjs/src/internal/operators/mergeAll.ts", "node_modules/rxjs/src/internal/operators/concatAll.ts", "node_modules/rxjs/src/internal/observable/concat.ts", "node_modules/rxjs/src/internal/observable/defer.ts", "node_modules/rxjs/src/internal/observable/fromEvent.ts", "node_modules/rxjs/src/internal/observable/fromEventPattern.ts", "node_modules/rxjs/src/internal/observable/timer.ts", "node_modules/rxjs/src/internal/observable/merge.ts", "node_modules/rxjs/src/internal/observable/never.ts", "node_modules/rxjs/src/internal/util/argsOrArgArray.ts", "node_modules/rxjs/src/internal/operators/filter.ts", "node_modules/rxjs/src/internal/observable/zip.ts", "node_modules/rxjs/src/internal/operators/audit.ts", "node_modules/rxjs/src/internal/operators/auditTime.ts", "node_modules/rxjs/src/internal/operators/bufferCount.ts", "node_modules/rxjs/src/internal/operators/catchError.ts", "node_modules/rxjs/src/internal/operators/scanInternals.ts", "node_modules/rxjs/src/internal/operators/combineLatest.ts", "node_modules/rxjs/src/internal/operators/combineLatestWith.ts", "node_modules/rxjs/src/internal/operators/debounce.ts", "node_modules/rxjs/src/internal/operators/debounceTime.ts", "node_modules/rxjs/src/internal/operators/defaultIfEmpty.ts", "node_modules/rxjs/src/internal/operators/take.ts", "node_modules/rxjs/src/internal/operators/ignoreElements.ts", "node_modules/rxjs/src/internal/operators/mapTo.ts", "node_modules/rxjs/src/internal/operators/delayWhen.ts", "node_modules/rxjs/src/internal/operators/delay.ts", "node_modules/rxjs/src/internal/operators/distinctUntilChanged.ts", "node_modules/rxjs/src/internal/operators/distinctUntilKeyChanged.ts", "node_modules/rxjs/src/internal/operators/throwIfEmpty.ts", "node_modules/rxjs/src/internal/operators/endWith.ts", "node_modules/rxjs/src/internal/operators/finalize.ts", "node_modules/rxjs/src/internal/operators/first.ts", "node_modules/rxjs/src/internal/operators/takeLast.ts", "node_modules/rxjs/src/internal/operators/merge.ts", "node_modules/rxjs/src/internal/operators/mergeWith.ts", "node_modules/rxjs/src/internal/operators/repeat.ts", "node_modules/rxjs/src/internal/operators/scan.ts", "node_modules/rxjs/src/internal/operators/share.ts", "node_modules/rxjs/src/internal/operators/shareReplay.ts", "node_modules/rxjs/src/internal/operators/skip.ts", "node_modules/rxjs/src/internal/operators/skipUntil.ts", "node_modules/rxjs/src/internal/operators/startWith.ts", "node_modules/rxjs/src/internal/operators/switchMap.ts", "node_modules/rxjs/src/internal/operators/takeUntil.ts", "node_modules/rxjs/src/internal/operators/takeWhile.ts", "node_modules/rxjs/src/internal/operators/tap.ts", "node_modules/rxjs/src/internal/operators/throttle.ts", "node_modules/rxjs/src/internal/operators/throttleTime.ts", "node_modules/rxjs/src/internal/operators/withLatestFrom.ts", "node_modules/rxjs/src/internal/operators/zip.ts", "node_modules/rxjs/src/internal/operators/zipWith.ts", "src/templates/assets/javascripts/browser/document/index.ts", "src/templates/assets/javascripts/browser/element/_/index.ts", "src/templates/assets/javascripts/browser/element/focus/index.ts", "src/templates/assets/javascripts/browser/element/hover/index.ts", "src/templates/assets/javascripts/utilities/h/index.ts", "src/templates/assets/javascripts/utilities/round/index.ts", "src/templates/assets/javascripts/browser/script/index.ts", "src/templates/assets/javascripts/browser/element/size/_/index.ts", "src/templates/assets/javascripts/browser/element/size/content/index.ts", "src/templates/assets/javascripts/browser/element/offset/_/index.ts", "src/templates/assets/javascripts/browser/element/offset/content/index.ts", "src/templates/assets/javascripts/browser/element/visibility/index.ts", "src/templates/assets/javascripts/browser/toggle/index.ts", "src/templates/assets/javascripts/browser/keyboard/index.ts", "src/templates/assets/javascripts/browser/location/_/index.ts", "src/templates/assets/javascripts/browser/location/hash/index.ts", "src/templates/assets/javascripts/browser/media/index.ts", "src/templates/assets/javascripts/browser/request/index.ts", "src/templates/assets/javascripts/browser/viewport/offset/index.ts", "src/templates/assets/javascripts/browser/viewport/size/index.ts", "src/templates/assets/javascripts/browser/viewport/_/index.ts", "src/templates/assets/javascripts/browser/viewport/at/index.ts", "src/templates/assets/javascripts/browser/worker/index.ts", "src/templates/assets/javascripts/_/index.ts", "src/templates/assets/javascripts/components/_/index.ts", "src/templates/assets/javascripts/components/announce/index.ts", "src/templates/assets/javascripts/components/consent/index.ts", "src/templates/assets/javascripts/templates/tooltip/index.tsx", "src/templates/assets/javascripts/templates/annotation/index.tsx", "src/templates/assets/javascripts/templates/clipboard/index.tsx", "src/templates/assets/javascripts/templates/search/index.tsx", "src/templates/assets/javascripts/templates/source/index.tsx", "src/templates/assets/javascripts/templates/tabbed/index.tsx", "src/templates/assets/javascripts/templates/table/index.tsx", "src/templates/assets/javascripts/templates/version/index.tsx", "src/templates/assets/javascripts/components/tooltip2/index.ts", "src/templates/assets/javascripts/components/content/annotation/_/index.ts", "src/templates/assets/javascripts/components/content/annotation/list/index.ts", "src/templates/assets/javascripts/components/content/annotation/block/index.ts", "src/templates/assets/javascripts/components/content/code/_/index.ts", "src/templates/assets/javascripts/components/content/details/index.ts", "src/templates/assets/javascripts/components/content/mermaid/index.css", "src/templates/assets/javascripts/components/content/mermaid/index.ts", "src/templates/assets/javascripts/components/content/table/index.ts", "src/templates/assets/javascripts/components/content/tabs/index.ts", "src/templates/assets/javascripts/components/content/_/index.ts", "src/templates/assets/javascripts/components/dialog/index.ts", "src/templates/assets/javascripts/components/tooltip/index.ts", "src/templates/assets/javascripts/components/header/_/index.ts", "src/templates/assets/javascripts/components/header/title/index.ts", "src/templates/assets/javascripts/components/main/index.ts", "src/templates/assets/javascripts/components/palette/index.ts", "src/templates/assets/javascripts/components/progress/index.ts", "src/templates/assets/javascripts/integrations/clipboard/index.ts", "src/templates/assets/javascripts/integrations/sitemap/index.ts", "src/templates/assets/javascripts/integrations/instant/index.ts", "src/templates/assets/javascripts/integrations/search/highlighter/index.ts", "src/templates/assets/javascripts/integrations/search/worker/message/index.ts", "src/templates/assets/javascripts/integrations/search/worker/_/index.ts", "src/templates/assets/javascripts/integrations/version/findurl/index.ts", "src/templates/assets/javascripts/integrations/version/index.ts", "src/templates/assets/javascripts/components/search/query/index.ts", "src/templates/assets/javascripts/components/search/result/index.ts", "src/templates/assets/javascripts/components/search/share/index.ts", "src/templates/assets/javascripts/components/search/suggest/index.ts", "src/templates/assets/javascripts/components/search/_/index.ts", "src/templates/assets/javascripts/components/search/highlight/index.ts", "src/templates/assets/javascripts/components/sidebar/index.ts", "src/templates/assets/javascripts/components/source/facts/github/index.ts", "src/templates/assets/javascripts/components/source/facts/gitlab/index.ts", "src/templates/assets/javascripts/components/source/facts/_/index.ts", "src/templates/assets/javascripts/components/source/_/index.ts", "src/templates/assets/javascripts/components/tabs/index.ts", "src/templates/assets/javascripts/components/toc/index.ts", "src/templates/assets/javascripts/components/top/index.ts", "src/templates/assets/javascripts/patches/ellipsis/index.ts", "src/templates/assets/javascripts/patches/indeterminate/index.ts", "src/templates/assets/javascripts/patches/scrollfix/index.ts", "src/templates/assets/javascripts/patches/scrolllock/index.ts", "src/templates/assets/javascripts/polyfills/index.ts"], - "sourcesContent": ["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (factory());\n}(this, (function () { 'use strict';\n\n /**\n * Applies the :focus-visible polyfill at the given scope.\n * A scope in this case is either the top-level Document or a Shadow Root.\n *\n * @param {(Document|ShadowRoot)} scope\n * @see https://github.com/WICG/focus-visible\n */\n function applyFocusVisiblePolyfill(scope) {\n var hadKeyboardEvent = true;\n var hadFocusVisibleRecently = false;\n var hadFocusVisibleRecentlyTimeout = null;\n\n var inputTypesAllowlist = {\n text: true,\n search: true,\n url: true,\n tel: true,\n email: true,\n password: true,\n number: true,\n date: true,\n month: true,\n week: true,\n time: true,\n datetime: true,\n 'datetime-local': true\n };\n\n /**\n * Helper function for legacy browsers and iframes which sometimes focus\n * elements like document, body, and non-interactive SVG.\n * @param {Element} el\n */\n function isValidFocusTarget(el) {\n if (\n el &&\n el !== document &&\n el.nodeName !== 'HTML' &&\n el.nodeName !== 'BODY' &&\n 'classList' in el &&\n 'contains' in el.classList\n ) {\n return true;\n }\n return false;\n }\n\n /**\n * Computes whether the given element should automatically trigger the\n * `focus-visible` class being added, i.e. whether it should always match\n * `:focus-visible` when focused.\n * @param {Element} el\n * @return {boolean}\n */\n function focusTriggersKeyboardModality(el) {\n var type = el.type;\n var tagName = el.tagName;\n\n if (tagName === 'INPUT' && inputTypesAllowlist[type] && !el.readOnly) {\n return true;\n }\n\n if (tagName === 'TEXTAREA' && !el.readOnly) {\n return true;\n }\n\n if (el.isContentEditable) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Add the `focus-visible` class to the given element if it was not added by\n * the author.\n * @param {Element} el\n */\n function addFocusVisibleClass(el) {\n if (el.classList.contains('focus-visible')) {\n return;\n }\n el.classList.add('focus-visible');\n el.setAttribute('data-focus-visible-added', '');\n }\n\n /**\n * Remove the `focus-visible` class from the given element if it was not\n * originally added by the author.\n * @param {Element} el\n */\n function removeFocusVisibleClass(el) {\n if (!el.hasAttribute('data-focus-visible-added')) {\n return;\n }\n el.classList.remove('focus-visible');\n el.removeAttribute('data-focus-visible-added');\n }\n\n /**\n * If the most recent user interaction was via the keyboard;\n * and the key press did not include a meta, alt/option, or control key;\n * then the modality is keyboard. Otherwise, the modality is not keyboard.\n * Apply `focus-visible` to any current active element and keep track\n * of our keyboard modality state with `hadKeyboardEvent`.\n * @param {KeyboardEvent} e\n */\n function onKeyDown(e) {\n if (e.metaKey || e.altKey || e.ctrlKey) {\n return;\n }\n\n if (isValidFocusTarget(scope.activeElement)) {\n addFocusVisibleClass(scope.activeElement);\n }\n\n hadKeyboardEvent = true;\n }\n\n /**\n * If at any point a user clicks with a pointing device, ensure that we change\n * the modality away from keyboard.\n * This avoids the situation where a user presses a key on an already focused\n * element, and then clicks on a different element, focusing it with a\n * pointing device, while we still think we're in keyboard modality.\n * @param {Event} e\n */\n function onPointerDown(e) {\n hadKeyboardEvent = false;\n }\n\n /**\n * On `focus`, add the `focus-visible` class to the target if:\n * - the target received focus as a result of keyboard navigation, or\n * - the event target is an element that will likely require interaction\n * via the keyboard (e.g. a text box)\n * @param {Event} e\n */\n function onFocus(e) {\n // Prevent IE from focusing the document or HTML element.\n if (!isValidFocusTarget(e.target)) {\n return;\n }\n\n if (hadKeyboardEvent || focusTriggersKeyboardModality(e.target)) {\n addFocusVisibleClass(e.target);\n }\n }\n\n /**\n * On `blur`, remove the `focus-visible` class from the target.\n * @param {Event} e\n */\n function onBlur(e) {\n if (!isValidFocusTarget(e.target)) {\n return;\n }\n\n if (\n e.target.classList.contains('focus-visible') ||\n e.target.hasAttribute('data-focus-visible-added')\n ) {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function() {\n hadFocusVisibleRecently = false;\n }, 100);\n removeFocusVisibleClass(e.target);\n }\n }\n\n /**\n * If the user changes tabs, keep track of whether or not the previously\n * focused element had .focus-visible.\n * @param {Event} e\n */\n function onVisibilityChange(e) {\n if (document.visibilityState === 'hidden') {\n // If the tab becomes active again, the browser will handle calling focus\n // on the element (Safari actually calls it twice).\n // If this tab change caused a blur on an element with focus-visible,\n // re-apply the class when the user switches back to the tab.\n if (hadFocusVisibleRecently) {\n hadKeyboardEvent = true;\n }\n addInitialPointerMoveListeners();\n }\n }\n\n /**\n * Add a group of listeners to detect usage of any pointing devices.\n * These listeners will be added when the polyfill first loads, and anytime\n * the window is blurred, so that they are active when the window regains\n * focus.\n */\n function addInitialPointerMoveListeners() {\n document.addEventListener('mousemove', onInitialPointerMove);\n document.addEventListener('mousedown', onInitialPointerMove);\n document.addEventListener('mouseup', onInitialPointerMove);\n document.addEventListener('pointermove', onInitialPointerMove);\n document.addEventListener('pointerdown', onInitialPointerMove);\n document.addEventListener('pointerup', onInitialPointerMove);\n document.addEventListener('touchmove', onInitialPointerMove);\n document.addEventListener('touchstart', onInitialPointerMove);\n document.addEventListener('touchend', onInitialPointerMove);\n }\n\n function removeInitialPointerMoveListeners() {\n document.removeEventListener('mousemove', onInitialPointerMove);\n document.removeEventListener('mousedown', onInitialPointerMove);\n document.removeEventListener('mouseup', onInitialPointerMove);\n document.removeEventListener('pointermove', onInitialPointerMove);\n document.removeEventListener('pointerdown', onInitialPointerMove);\n document.removeEventListener('pointerup', onInitialPointerMove);\n document.removeEventListener('touchmove', onInitialPointerMove);\n document.removeEventListener('touchstart', onInitialPointerMove);\n document.removeEventListener('touchend', onInitialPointerMove);\n }\n\n /**\n * When the polfyill first loads, assume the user is in keyboard modality.\n * If any event is received from a pointing device (e.g. mouse, pointer,\n * touch), turn off keyboard modality.\n * This accounts for situations where focus enters the page from the URL bar.\n * @param {Event} e\n */\n function onInitialPointerMove(e) {\n // Work around a Safari quirk that fires a mousemove on whenever the\n // window blurs, even if you're tabbing out of the page. \u00AF\\_(\u30C4)_/\u00AF\n if (e.target.nodeName && e.target.nodeName.toLowerCase() === 'html') {\n return;\n }\n\n hadKeyboardEvent = false;\n removeInitialPointerMoveListeners();\n }\n\n // For some kinds of state, we are interested in changes at the global scope\n // only. For example, global pointer input, global key presses and global\n // visibility change should affect the state at every scope:\n document.addEventListener('keydown', onKeyDown, true);\n document.addEventListener('mousedown', onPointerDown, true);\n document.addEventListener('pointerdown', onPointerDown, true);\n document.addEventListener('touchstart', onPointerDown, true);\n document.addEventListener('visibilitychange', onVisibilityChange, true);\n\n addInitialPointerMoveListeners();\n\n // For focus and blur, we specifically care about state changes in the local\n // scope. This is because focus / blur events that originate from within a\n // shadow root are not re-dispatched from the host element if it was already\n // the active element in its own scope:\n scope.addEventListener('focus', onFocus, true);\n scope.addEventListener('blur', onBlur, true);\n\n // We detect that a node is a ShadowRoot by ensuring that it is a\n // DocumentFragment and also has a host property. This check covers native\n // implementation and polyfill implementation transparently. If we only cared\n // about the native implementation, we could just check if the scope was\n // an instance of a ShadowRoot.\n if (scope.nodeType === Node.DOCUMENT_FRAGMENT_NODE && scope.host) {\n // Since a ShadowRoot is a special kind of DocumentFragment, it does not\n // have a root element to add a class to. So, we add this attribute to the\n // host element instead:\n scope.host.setAttribute('data-js-focus-visible', '');\n } else if (scope.nodeType === Node.DOCUMENT_NODE) {\n document.documentElement.classList.add('js-focus-visible');\n document.documentElement.setAttribute('data-js-focus-visible', '');\n }\n }\n\n // It is important to wrap all references to global window and document in\n // these checks to support server-side rendering use cases\n // @see https://github.com/WICG/focus-visible/issues/199\n if (typeof window !== 'undefined' && typeof document !== 'undefined') {\n // Make the polyfill helper globally available. This can be used as a signal\n // to interested libraries that wish to coordinate with the polyfill for e.g.,\n // applying the polyfill to a shadow root:\n window.applyFocusVisiblePolyfill = applyFocusVisiblePolyfill;\n\n // Notify interested libraries of the polyfill's presence, in case the\n // polyfill was loaded lazily:\n var event;\n\n try {\n event = new CustomEvent('focus-visible-polyfill-ready');\n } catch (error) {\n // IE11 does not support using CustomEvent as a constructor directly:\n event = document.createEvent('CustomEvent');\n event.initCustomEvent('focus-visible-polyfill-ready', false, false, {});\n }\n\n window.dispatchEvent(event);\n }\n\n if (typeof document !== 'undefined') {\n // Apply the polyfill to the global document, so that no JavaScript\n // coordination is required to use the polyfill in the top-level document:\n applyFocusVisiblePolyfill(document);\n }\n\n})));\n", "/*!\n * escape-html\n * Copyright(c) 2012-2013 TJ Holowaychuk\n * Copyright(c) 2015 Andreas Lubbe\n * Copyright(c) 2015 Tiancheng \"Timothy\" Gu\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module variables.\n * @private\n */\n\nvar matchHtmlRegExp = /[\"'&<>]/;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = escapeHtml;\n\n/**\n * Escape special characters in the given string of html.\n *\n * @param {string} string The string to escape for inserting into HTML\n * @return {string}\n * @public\n */\n\nfunction escapeHtml(string) {\n var str = '' + string;\n var match = matchHtmlRegExp.exec(str);\n\n if (!match) {\n return str;\n }\n\n var escape;\n var html = '';\n var index = 0;\n var lastIndex = 0;\n\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34: // \"\n escape = '"';\n break;\n case 38: // &\n escape = '&';\n break;\n case 39: // '\n escape = ''';\n break;\n case 60: // <\n escape = '<';\n break;\n case 62: // >\n escape = '>';\n break;\n default:\n continue;\n }\n\n if (lastIndex !== index) {\n html += str.substring(lastIndex, index);\n }\n\n lastIndex = index + 1;\n html += escape;\n }\n\n return lastIndex !== index\n ? html + str.substring(lastIndex, index)\n : html;\n}\n", "/*!\n * clipboard.js v2.0.11\n * https://clipboardjs.com/\n *\n * Licensed MIT \u00A9 Zeno Rocha\n */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ClipboardJS\"] = factory();\n\telse\n\t\troot[\"ClipboardJS\"] = factory();\n})(this, function() {\nreturn /******/ (function() { // webpackBootstrap\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ 686:\n/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, {\n \"default\": function() { return /* binding */ clipboard; }\n});\n\n// EXTERNAL MODULE: ./node_modules/tiny-emitter/index.js\nvar tiny_emitter = __webpack_require__(279);\nvar tiny_emitter_default = /*#__PURE__*/__webpack_require__.n(tiny_emitter);\n// EXTERNAL MODULE: ./node_modules/good-listener/src/listen.js\nvar listen = __webpack_require__(370);\nvar listen_default = /*#__PURE__*/__webpack_require__.n(listen);\n// EXTERNAL MODULE: ./node_modules/select/src/select.js\nvar src_select = __webpack_require__(817);\nvar select_default = /*#__PURE__*/__webpack_require__.n(src_select);\n;// CONCATENATED MODULE: ./src/common/command.js\n/**\n * Executes a given operation type.\n * @param {String} type\n * @return {Boolean}\n */\nfunction command(type) {\n try {\n return document.execCommand(type);\n } catch (err) {\n return false;\n }\n}\n;// CONCATENATED MODULE: ./src/actions/cut.js\n\n\n/**\n * Cut action wrapper.\n * @param {String|HTMLElement} target\n * @return {String}\n */\n\nvar ClipboardActionCut = function ClipboardActionCut(target) {\n var selectedText = select_default()(target);\n command('cut');\n return selectedText;\n};\n\n/* harmony default export */ var actions_cut = (ClipboardActionCut);\n;// CONCATENATED MODULE: ./src/common/create-fake-element.js\n/**\n * Creates a fake textarea element with a value.\n * @param {String} value\n * @return {HTMLElement}\n */\nfunction createFakeElement(value) {\n var isRTL = document.documentElement.getAttribute('dir') === 'rtl';\n var fakeElement = document.createElement('textarea'); // Prevent zooming on iOS\n\n fakeElement.style.fontSize = '12pt'; // Reset box model\n\n fakeElement.style.border = '0';\n fakeElement.style.padding = '0';\n fakeElement.style.margin = '0'; // Move element out of screen horizontally\n\n fakeElement.style.position = 'absolute';\n fakeElement.style[isRTL ? 'right' : 'left'] = '-9999px'; // Move element to the same position vertically\n\n var yPosition = window.pageYOffset || document.documentElement.scrollTop;\n fakeElement.style.top = \"\".concat(yPosition, \"px\");\n fakeElement.setAttribute('readonly', '');\n fakeElement.value = value;\n return fakeElement;\n}\n;// CONCATENATED MODULE: ./src/actions/copy.js\n\n\n\n/**\n * Create fake copy action wrapper using a fake element.\n * @param {String} target\n * @param {Object} options\n * @return {String}\n */\n\nvar fakeCopyAction = function fakeCopyAction(value, options) {\n var fakeElement = createFakeElement(value);\n options.container.appendChild(fakeElement);\n var selectedText = select_default()(fakeElement);\n command('copy');\n fakeElement.remove();\n return selectedText;\n};\n/**\n * Copy action wrapper.\n * @param {String|HTMLElement} target\n * @param {Object} options\n * @return {String}\n */\n\n\nvar ClipboardActionCopy = function ClipboardActionCopy(target) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n container: document.body\n };\n var selectedText = '';\n\n if (typeof target === 'string') {\n selectedText = fakeCopyAction(target, options);\n } else if (target instanceof HTMLInputElement && !['text', 'search', 'url', 'tel', 'password'].includes(target === null || target === void 0 ? void 0 : target.type)) {\n // If input type doesn't support `setSelectionRange`. Simulate it. https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange\n selectedText = fakeCopyAction(target.value, options);\n } else {\n selectedText = select_default()(target);\n command('copy');\n }\n\n return selectedText;\n};\n\n/* harmony default export */ var actions_copy = (ClipboardActionCopy);\n;// CONCATENATED MODULE: ./src/actions/default.js\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n\n\n/**\n * Inner function which performs selection from either `text` or `target`\n * properties and then executes copy or cut operations.\n * @param {Object} options\n */\n\nvar ClipboardActionDefault = function ClipboardActionDefault() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n // Defines base properties passed from constructor.\n var _options$action = options.action,\n action = _options$action === void 0 ? 'copy' : _options$action,\n container = options.container,\n target = options.target,\n text = options.text; // Sets the `action` to be performed which can be either 'copy' or 'cut'.\n\n if (action !== 'copy' && action !== 'cut') {\n throw new Error('Invalid \"action\" value, use either \"copy\" or \"cut\"');\n } // Sets the `target` property using an element that will be have its content copied.\n\n\n if (target !== undefined) {\n if (target && _typeof(target) === 'object' && target.nodeType === 1) {\n if (action === 'copy' && target.hasAttribute('disabled')) {\n throw new Error('Invalid \"target\" attribute. Please use \"readonly\" instead of \"disabled\" attribute');\n }\n\n if (action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {\n throw new Error('Invalid \"target\" attribute. You can\\'t cut text from elements with \"readonly\" or \"disabled\" attributes');\n }\n } else {\n throw new Error('Invalid \"target\" value, use a valid Element');\n }\n } // Define selection strategy based on `text` property.\n\n\n if (text) {\n return actions_copy(text, {\n container: container\n });\n } // Defines which selection strategy based on `target` property.\n\n\n if (target) {\n return action === 'cut' ? actions_cut(target) : actions_copy(target, {\n container: container\n });\n }\n};\n\n/* harmony default export */ var actions_default = (ClipboardActionDefault);\n;// CONCATENATED MODULE: ./src/clipboard.js\nfunction clipboard_typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { clipboard_typeof = function _typeof(obj) { return typeof obj; }; } else { clipboard_typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return clipboard_typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (clipboard_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\n\n/**\n * Helper function to retrieve attribute value.\n * @param {String} suffix\n * @param {Element} element\n */\n\nfunction getAttributeValue(suffix, element) {\n var attribute = \"data-clipboard-\".concat(suffix);\n\n if (!element.hasAttribute(attribute)) {\n return;\n }\n\n return element.getAttribute(attribute);\n}\n/**\n * Base class which takes one or more elements, adds event listeners to them,\n * and instantiates a new `ClipboardAction` on each click.\n */\n\n\nvar Clipboard = /*#__PURE__*/function (_Emitter) {\n _inherits(Clipboard, _Emitter);\n\n var _super = _createSuper(Clipboard);\n\n /**\n * @param {String|HTMLElement|HTMLCollection|NodeList} trigger\n * @param {Object} options\n */\n function Clipboard(trigger, options) {\n var _this;\n\n _classCallCheck(this, Clipboard);\n\n _this = _super.call(this);\n\n _this.resolveOptions(options);\n\n _this.listenClick(trigger);\n\n return _this;\n }\n /**\n * Defines if attributes would be resolved using internal setter functions\n * or custom functions that were passed in the constructor.\n * @param {Object} options\n */\n\n\n _createClass(Clipboard, [{\n key: \"resolveOptions\",\n value: function resolveOptions() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this.action = typeof options.action === 'function' ? options.action : this.defaultAction;\n this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;\n this.text = typeof options.text === 'function' ? options.text : this.defaultText;\n this.container = clipboard_typeof(options.container) === 'object' ? options.container : document.body;\n }\n /**\n * Adds a click event listener to the passed trigger.\n * @param {String|HTMLElement|HTMLCollection|NodeList} trigger\n */\n\n }, {\n key: \"listenClick\",\n value: function listenClick(trigger) {\n var _this2 = this;\n\n this.listener = listen_default()(trigger, 'click', function (e) {\n return _this2.onClick(e);\n });\n }\n /**\n * Defines a new `ClipboardAction` on each click event.\n * @param {Event} e\n */\n\n }, {\n key: \"onClick\",\n value: function onClick(e) {\n var trigger = e.delegateTarget || e.currentTarget;\n var action = this.action(trigger) || 'copy';\n var text = actions_default({\n action: action,\n container: this.container,\n target: this.target(trigger),\n text: this.text(trigger)\n }); // Fires an event based on the copy operation result.\n\n this.emit(text ? 'success' : 'error', {\n action: action,\n text: text,\n trigger: trigger,\n clearSelection: function clearSelection() {\n if (trigger) {\n trigger.focus();\n }\n\n window.getSelection().removeAllRanges();\n }\n });\n }\n /**\n * Default `action` lookup function.\n * @param {Element} trigger\n */\n\n }, {\n key: \"defaultAction\",\n value: function defaultAction(trigger) {\n return getAttributeValue('action', trigger);\n }\n /**\n * Default `target` lookup function.\n * @param {Element} trigger\n */\n\n }, {\n key: \"defaultTarget\",\n value: function defaultTarget(trigger) {\n var selector = getAttributeValue('target', trigger);\n\n if (selector) {\n return document.querySelector(selector);\n }\n }\n /**\n * Allow fire programmatically a copy action\n * @param {String|HTMLElement} target\n * @param {Object} options\n * @returns Text copied.\n */\n\n }, {\n key: \"defaultText\",\n\n /**\n * Default `text` lookup function.\n * @param {Element} trigger\n */\n value: function defaultText(trigger) {\n return getAttributeValue('text', trigger);\n }\n /**\n * Destroy lifecycle.\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.listener.destroy();\n }\n }], [{\n key: \"copy\",\n value: function copy(target) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n container: document.body\n };\n return actions_copy(target, options);\n }\n /**\n * Allow fire programmatically a cut action\n * @param {String|HTMLElement} target\n * @returns Text cutted.\n */\n\n }, {\n key: \"cut\",\n value: function cut(target) {\n return actions_cut(target);\n }\n /**\n * Returns the support of the given action, or all actions if no action is\n * given.\n * @param {String} [action]\n */\n\n }, {\n key: \"isSupported\",\n value: function isSupported() {\n var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];\n var actions = typeof action === 'string' ? [action] : action;\n var support = !!document.queryCommandSupported;\n actions.forEach(function (action) {\n support = support && !!document.queryCommandSupported(action);\n });\n return support;\n }\n }]);\n\n return Clipboard;\n}((tiny_emitter_default()));\n\n/* harmony default export */ var clipboard = (Clipboard);\n\n/***/ }),\n\n/***/ 828:\n/***/ (function(module) {\n\nvar DOCUMENT_NODE_TYPE = 9;\n\n/**\n * A polyfill for Element.matches()\n */\nif (typeof Element !== 'undefined' && !Element.prototype.matches) {\n var proto = Element.prototype;\n\n proto.matches = proto.matchesSelector ||\n proto.mozMatchesSelector ||\n proto.msMatchesSelector ||\n proto.oMatchesSelector ||\n proto.webkitMatchesSelector;\n}\n\n/**\n * Finds the closest parent that matches a selector.\n *\n * @param {Element} element\n * @param {String} selector\n * @return {Function}\n */\nfunction closest (element, selector) {\n while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {\n if (typeof element.matches === 'function' &&\n element.matches(selector)) {\n return element;\n }\n element = element.parentNode;\n }\n}\n\nmodule.exports = closest;\n\n\n/***/ }),\n\n/***/ 438:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar closest = __webpack_require__(828);\n\n/**\n * Delegates event to a selector.\n *\n * @param {Element} element\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @param {Boolean} useCapture\n * @return {Object}\n */\nfunction _delegate(element, selector, type, callback, useCapture) {\n var listenerFn = listener.apply(this, arguments);\n\n element.addEventListener(type, listenerFn, useCapture);\n\n return {\n destroy: function() {\n element.removeEventListener(type, listenerFn, useCapture);\n }\n }\n}\n\n/**\n * Delegates event to a selector.\n *\n * @param {Element|String|Array} [elements]\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @param {Boolean} useCapture\n * @return {Object}\n */\nfunction delegate(elements, selector, type, callback, useCapture) {\n // Handle the regular Element usage\n if (typeof elements.addEventListener === 'function') {\n return _delegate.apply(null, arguments);\n }\n\n // Handle Element-less usage, it defaults to global delegation\n if (typeof type === 'function') {\n // Use `document` as the first parameter, then apply arguments\n // This is a short way to .unshift `arguments` without running into deoptimizations\n return _delegate.bind(null, document).apply(null, arguments);\n }\n\n // Handle Selector-based usage\n if (typeof elements === 'string') {\n elements = document.querySelectorAll(elements);\n }\n\n // Handle Array-like based usage\n return Array.prototype.map.call(elements, function (element) {\n return _delegate(element, selector, type, callback, useCapture);\n });\n}\n\n/**\n * Finds closest match and invokes callback.\n *\n * @param {Element} element\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @return {Function}\n */\nfunction listener(element, selector, type, callback) {\n return function(e) {\n e.delegateTarget = closest(e.target, selector);\n\n if (e.delegateTarget) {\n callback.call(element, e);\n }\n }\n}\n\nmodule.exports = delegate;\n\n\n/***/ }),\n\n/***/ 879:\n/***/ (function(__unused_webpack_module, exports) {\n\n/**\n * Check if argument is a HTML element.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.node = function(value) {\n return value !== undefined\n && value instanceof HTMLElement\n && value.nodeType === 1;\n};\n\n/**\n * Check if argument is a list of HTML elements.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.nodeList = function(value) {\n var type = Object.prototype.toString.call(value);\n\n return value !== undefined\n && (type === '[object NodeList]' || type === '[object HTMLCollection]')\n && ('length' in value)\n && (value.length === 0 || exports.node(value[0]));\n};\n\n/**\n * Check if argument is a string.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.string = function(value) {\n return typeof value === 'string'\n || value instanceof String;\n};\n\n/**\n * Check if argument is a function.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.fn = function(value) {\n var type = Object.prototype.toString.call(value);\n\n return type === '[object Function]';\n};\n\n\n/***/ }),\n\n/***/ 370:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar is = __webpack_require__(879);\nvar delegate = __webpack_require__(438);\n\n/**\n * Validates all params and calls the right\n * listener function based on its target type.\n *\n * @param {String|HTMLElement|HTMLCollection|NodeList} target\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listen(target, type, callback) {\n if (!target && !type && !callback) {\n throw new Error('Missing required arguments');\n }\n\n if (!is.string(type)) {\n throw new TypeError('Second argument must be a String');\n }\n\n if (!is.fn(callback)) {\n throw new TypeError('Third argument must be a Function');\n }\n\n if (is.node(target)) {\n return listenNode(target, type, callback);\n }\n else if (is.nodeList(target)) {\n return listenNodeList(target, type, callback);\n }\n else if (is.string(target)) {\n return listenSelector(target, type, callback);\n }\n else {\n throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');\n }\n}\n\n/**\n * Adds an event listener to a HTML element\n * and returns a remove listener function.\n *\n * @param {HTMLElement} node\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenNode(node, type, callback) {\n node.addEventListener(type, callback);\n\n return {\n destroy: function() {\n node.removeEventListener(type, callback);\n }\n }\n}\n\n/**\n * Add an event listener to a list of HTML elements\n * and returns a remove listener function.\n *\n * @param {NodeList|HTMLCollection} nodeList\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenNodeList(nodeList, type, callback) {\n Array.prototype.forEach.call(nodeList, function(node) {\n node.addEventListener(type, callback);\n });\n\n return {\n destroy: function() {\n Array.prototype.forEach.call(nodeList, function(node) {\n node.removeEventListener(type, callback);\n });\n }\n }\n}\n\n/**\n * Add an event listener to a selector\n * and returns a remove listener function.\n *\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenSelector(selector, type, callback) {\n return delegate(document.body, selector, type, callback);\n}\n\nmodule.exports = listen;\n\n\n/***/ }),\n\n/***/ 817:\n/***/ (function(module) {\n\nfunction select(element) {\n var selectedText;\n\n if (element.nodeName === 'SELECT') {\n element.focus();\n\n selectedText = element.value;\n }\n else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {\n var isReadOnly = element.hasAttribute('readonly');\n\n if (!isReadOnly) {\n element.setAttribute('readonly', '');\n }\n\n element.select();\n element.setSelectionRange(0, element.value.length);\n\n if (!isReadOnly) {\n element.removeAttribute('readonly');\n }\n\n selectedText = element.value;\n }\n else {\n if (element.hasAttribute('contenteditable')) {\n element.focus();\n }\n\n var selection = window.getSelection();\n var range = document.createRange();\n\n range.selectNodeContents(element);\n selection.removeAllRanges();\n selection.addRange(range);\n\n selectedText = selection.toString();\n }\n\n return selectedText;\n}\n\nmodule.exports = select;\n\n\n/***/ }),\n\n/***/ 279:\n/***/ (function(module) {\n\nfunction E () {\n // Keep this empty so it's easier to inherit from\n // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)\n}\n\nE.prototype = {\n on: function (name, callback, ctx) {\n var e = this.e || (this.e = {});\n\n (e[name] || (e[name] = [])).push({\n fn: callback,\n ctx: ctx\n });\n\n return this;\n },\n\n once: function (name, callback, ctx) {\n var self = this;\n function listener () {\n self.off(name, listener);\n callback.apply(ctx, arguments);\n };\n\n listener._ = callback\n return this.on(name, listener, ctx);\n },\n\n emit: function (name) {\n var data = [].slice.call(arguments, 1);\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n var i = 0;\n var len = evtArr.length;\n\n for (i; i < len; i++) {\n evtArr[i].fn.apply(evtArr[i].ctx, data);\n }\n\n return this;\n },\n\n off: function (name, callback) {\n var e = this.e || (this.e = {});\n var evts = e[name];\n var liveEvents = [];\n\n if (evts && callback) {\n for (var i = 0, len = evts.length; i < len; i++) {\n if (evts[i].fn !== callback && evts[i].fn._ !== callback)\n liveEvents.push(evts[i]);\n }\n }\n\n // Remove event from queue to prevent memory leak\n // Suggested by https://github.com/lazd\n // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910\n\n (liveEvents.length)\n ? e[name] = liveEvents\n : delete e[name];\n\n return this;\n }\n};\n\nmodule.exports = E;\nmodule.exports.TinyEmitter = E;\n\n\n/***/ })\n\n/******/ \t});\n/************************************************************************/\n/******/ \t// The module cache\n/******/ \tvar __webpack_module_cache__ = {};\n/******/ \t\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(__webpack_module_cache__[moduleId]) {\n/******/ \t\t\treturn __webpack_module_cache__[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = __webpack_module_cache__[moduleId] = {\n/******/ \t\t\t// no module.id needed\n/******/ \t\t\t// no module.loaded needed\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/ \t\n/******/ \t\t// Execute the module function\n/******/ \t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n/******/ \t\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/ \t\n/************************************************************************/\n/******/ \t/* webpack/runtime/compat get default export */\n/******/ \t!function() {\n/******/ \t\t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t\t__webpack_require__.n = function(module) {\n/******/ \t\t\tvar getter = module && module.__esModule ?\n/******/ \t\t\t\tfunction() { return module['default']; } :\n/******/ \t\t\t\tfunction() { return module; };\n/******/ \t\t\t__webpack_require__.d(getter, { a: getter });\n/******/ \t\t\treturn getter;\n/******/ \t\t};\n/******/ \t}();\n/******/ \t\n/******/ \t/* webpack/runtime/define property getters */\n/******/ \t!function() {\n/******/ \t\t// define getter functions for harmony exports\n/******/ \t\t__webpack_require__.d = function(exports, definition) {\n/******/ \t\t\tfor(var key in definition) {\n/******/ \t\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n/******/ \t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t}();\n/******/ \t\n/******/ \t/* webpack/runtime/hasOwnProperty shorthand */\n/******/ \t!function() {\n/******/ \t\t__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }\n/******/ \t}();\n/******/ \t\n/************************************************************************/\n/******/ \t// module exports must be returned from runtime so entry inlining is disabled\n/******/ \t// startup\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(686);\n/******/ })()\n.default;\n});", "/*\n * Copyright (c) 2016-2025 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport \"focus-visible\"\n\nimport {\n EMPTY,\n NEVER,\n Observable,\n Subject,\n defer,\n delay,\n filter,\n map,\n merge,\n mergeWith,\n shareReplay,\n switchMap\n} from \"rxjs\"\n\nimport { configuration, feature } from \"./_\"\nimport {\n at,\n getActiveElement,\n getOptionalElement,\n requestJSON,\n setLocation,\n setToggle,\n watchDocument,\n watchKeyboard,\n watchLocation,\n watchLocationTarget,\n watchMedia,\n watchPrint,\n watchScript,\n watchViewport\n} from \"./browser\"\nimport {\n getComponentElement,\n getComponentElements,\n mountAnnounce,\n mountBackToTop,\n mountConsent,\n mountContent,\n mountDialog,\n mountHeader,\n mountHeaderTitle,\n mountPalette,\n mountProgress,\n mountSearch,\n mountSearchHiglight,\n mountSidebar,\n mountSource,\n mountTableOfContents,\n mountTabs,\n watchHeader,\n watchMain\n} from \"./components\"\nimport {\n SearchIndex,\n setupClipboardJS,\n setupInstantNavigation,\n setupVersionSelector\n} from \"./integrations\"\nimport {\n patchEllipsis,\n patchIndeterminate,\n patchScrollfix,\n patchScrolllock\n} from \"./patches\"\nimport \"./polyfills\"\n\n/* ----------------------------------------------------------------------------\n * Functions - @todo refactor\n * ------------------------------------------------------------------------- */\n\n/**\n * Fetch search index\n *\n * @returns Search index observable\n */\nfunction fetchSearchIndex(): Observable {\n if (location.protocol === \"file:\") {\n return watchScript(\n `${new URL(\"search/search_index.js\", config.base)}`\n )\n .pipe(\n // @ts-ignore - @todo fix typings\n map(() => __index),\n shareReplay(1)\n )\n } else {\n return requestJSON(\n new URL(\"search/search_index.json\", config.base)\n )\n }\n}\n\n/* ----------------------------------------------------------------------------\n * Application\n * ------------------------------------------------------------------------- */\n\n/* Yay, JavaScript is available */\ndocument.documentElement.classList.remove(\"no-js\")\ndocument.documentElement.classList.add(\"js\")\n\n/* Set up navigation observables and subjects */\nconst document$ = watchDocument()\nconst location$ = watchLocation()\nconst target$ = watchLocationTarget(location$)\nconst keyboard$ = watchKeyboard()\n\n/* Set up media observables */\nconst viewport$ = watchViewport()\nconst tablet$ = watchMedia(\"(min-width: 960px)\")\nconst screen$ = watchMedia(\"(min-width: 1220px)\")\nconst print$ = watchPrint()\n\n/* Retrieve search index, if search is enabled */\nconst config = configuration()\nconst index$ = document.forms.namedItem(\"search\")\n ? fetchSearchIndex()\n : NEVER\n\n/* Set up Clipboard.js integration */\nconst alert$ = new Subject()\nsetupClipboardJS({ alert$ })\n\n/* Set up progress indicator */\nconst progress$ = new Subject()\n\n/* Set up instant navigation, if enabled */\nif (feature(\"navigation.instant\"))\n setupInstantNavigation({ location$, viewport$, progress$ })\n .subscribe(document$)\n\n/* Set up version selector */\nif (config.version?.provider === \"mike\")\n setupVersionSelector({ document$ })\n\n/* Always close drawer and search on navigation */\nmerge(location$, target$)\n .pipe(\n delay(125)\n )\n .subscribe(() => {\n setToggle(\"drawer\", false)\n setToggle(\"search\", false)\n })\n\n/* Set up global keyboard handlers */\nkeyboard$\n .pipe(\n filter(({ mode }) => mode === \"global\")\n )\n .subscribe(key => {\n switch (key.type) {\n\n /* Go to previous page */\n case \"p\":\n case \",\":\n const prev = getOptionalElement(\"link[rel=prev]\")\n if (typeof prev !== \"undefined\")\n setLocation(prev)\n break\n\n /* Go to next page */\n case \"n\":\n case \".\":\n const next = getOptionalElement(\"link[rel=next]\")\n if (typeof next !== \"undefined\")\n setLocation(next)\n break\n\n /* Expand navigation, see https://bit.ly/3ZjG5io */\n case \"Enter\":\n const active = getActiveElement()\n if (active instanceof HTMLLabelElement)\n active.click()\n }\n })\n\n/* Set up patches */\npatchEllipsis({ viewport$, document$ })\npatchIndeterminate({ document$, tablet$ })\npatchScrollfix({ document$ })\npatchScrolllock({ viewport$, tablet$ })\n\n/* Set up header and main area observable */\nconst header$ = watchHeader(getComponentElement(\"header\"), { viewport$ })\nconst main$ = document$\n .pipe(\n map(() => getComponentElement(\"main\")),\n switchMap(el => watchMain(el, { viewport$, header$ })),\n shareReplay(1)\n )\n\n/* Set up control component observables */\nconst control$ = merge(\n\n /* Consent */\n ...getComponentElements(\"consent\")\n .map(el => mountConsent(el, { target$ })),\n\n /* Dialog */\n ...getComponentElements(\"dialog\")\n .map(el => mountDialog(el, { alert$ })),\n\n /* Color palette */\n ...getComponentElements(\"palette\")\n .map(el => mountPalette(el)),\n\n /* Progress bar */\n ...getComponentElements(\"progress\")\n .map(el => mountProgress(el, { progress$ })),\n\n /* Search */\n ...getComponentElements(\"search\")\n .map(el => mountSearch(el, { index$, keyboard$ })),\n\n /* Repository information */\n ...getComponentElements(\"source\")\n .map(el => mountSource(el))\n)\n\n/* Set up content component observables */\nconst content$ = defer(() => merge(\n\n /* Announcement bar */\n ...getComponentElements(\"announce\")\n .map(el => mountAnnounce(el)),\n\n /* Content */\n ...getComponentElements(\"content\")\n .map(el => mountContent(el, { viewport$, target$, print$ })),\n\n /* Search highlighting */\n ...getComponentElements(\"content\")\n .map(el => feature(\"search.highlight\")\n ? mountSearchHiglight(el, { index$, location$ })\n : EMPTY\n ),\n\n /* Header */\n ...getComponentElements(\"header\")\n .map(el => mountHeader(el, { viewport$, header$, main$ })),\n\n /* Header title */\n ...getComponentElements(\"header-title\")\n .map(el => mountHeaderTitle(el, { viewport$, header$ })),\n\n /* Sidebar */\n ...getComponentElements(\"sidebar\")\n .map(el => el.getAttribute(\"data-md-type\") === \"navigation\"\n ? at(screen$, () => mountSidebar(el, { viewport$, header$, main$ }))\n : at(tablet$, () => mountSidebar(el, { viewport$, header$, main$ }))\n ),\n\n /* Navigation tabs */\n ...getComponentElements(\"tabs\")\n .map(el => mountTabs(el, { viewport$, header$ })),\n\n /* Table of contents */\n ...getComponentElements(\"toc\")\n .map(el => mountTableOfContents(el, {\n viewport$, header$, main$, target$\n })),\n\n /* Back-to-top button */\n ...getComponentElements(\"top\")\n .map(el => mountBackToTop(el, { viewport$, header$, main$, target$ }))\n))\n\n/* Set up component observables */\nconst component$ = document$\n .pipe(\n switchMap(() => content$),\n mergeWith(control$),\n shareReplay(1)\n )\n\n/* Subscribe to all components */\ncomponent$.subscribe()\n\n/* ----------------------------------------------------------------------------\n * Exports\n * ------------------------------------------------------------------------- */\n\nwindow.document$ = document$ /* Document observable */\nwindow.location$ = location$ /* Location subject */\nwindow.target$ = target$ /* Location target observable */\nwindow.keyboard$ = keyboard$ /* Keyboard observable */\nwindow.viewport$ = viewport$ /* Viewport observable */\nwindow.tablet$ = tablet$ /* Media tablet observable */\nwindow.screen$ = screen$ /* Media screen observable */\nwindow.print$ = print$ /* Media print observable */\nwindow.alert$ = alert$ /* Alert subject */\nwindow.progress$ = progress$ /* Progress indicator subject */\nwindow.component$ = component$ /* Component observable */\n", "/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n", "/**\n * Returns true if the object is a function.\n * @param value The value to check\n */\nexport function isFunction(value: any): value is (...args: any[]) => any {\n return typeof value === 'function';\n}\n", "/**\n * Used to create Error subclasses until the community moves away from ES5.\n *\n * This is because compiling from TypeScript down to ES5 has issues with subclassing Errors\n * as well as other built-in types: https://github.com/Microsoft/TypeScript/issues/12123\n *\n * @param createImpl A factory function to create the actual constructor implementation. The returned\n * function should be a named function that calls `_super` internally.\n */\nexport function createErrorClass(createImpl: (_super: any) => any): T {\n const _super = (instance: any) => {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n\n const ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n", "import { createErrorClass } from './createErrorClass';\n\nexport interface UnsubscriptionError extends Error {\n readonly errors: any[];\n}\n\nexport interface UnsubscriptionErrorCtor {\n /**\n * @deprecated Internal implementation detail. Do not construct error instances.\n * Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269\n */\n new (errors: any[]): UnsubscriptionError;\n}\n\n/**\n * An error thrown when one or more errors have occurred during the\n * `unsubscribe` of a {@link Subscription}.\n */\nexport const UnsubscriptionError: UnsubscriptionErrorCtor = createErrorClass(\n (_super) =>\n function UnsubscriptionErrorImpl(this: any, errors: (Error | string)[]) {\n _super(this);\n this.message = errors\n ? `${errors.length} errors occurred during unsubscription:\n${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\\n ')}`\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n }\n);\n", "/**\n * Removes an item from an array, mutating it.\n * @param arr The array to remove the item from\n * @param item The item to remove\n */\nexport function arrRemove(arr: T[] | undefined | null, item: T) {\n if (arr) {\n const index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n", "import { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { SubscriptionLike, TeardownLogic, Unsubscribable } from './types';\nimport { arrRemove } from './util/arrRemove';\n\n/**\n * Represents a disposable resource, such as the execution of an Observable. A\n * Subscription has one important method, `unsubscribe`, that takes no argument\n * and just disposes the resource held by the subscription.\n *\n * Additionally, subscriptions may be grouped together through the `add()`\n * method, which will attach a child Subscription to the current Subscription.\n * When a Subscription is unsubscribed, all its children (and its grandchildren)\n * will be unsubscribed as well.\n */\nexport class Subscription implements SubscriptionLike {\n public static EMPTY = (() => {\n const empty = new Subscription();\n empty.closed = true;\n return empty;\n })();\n\n /**\n * A flag to indicate whether this Subscription has already been unsubscribed.\n */\n public closed = false;\n\n private _parentage: Subscription[] | Subscription | null = null;\n\n /**\n * The list of registered finalizers to execute upon unsubscription. Adding and removing from this\n * list occurs in the {@link #add} and {@link #remove} methods.\n */\n private _finalizers: Exclude[] | null = null;\n\n /**\n * @param initialTeardown A function executed first as part of the finalization\n * process that is kicked off when {@link #unsubscribe} is called.\n */\n constructor(private initialTeardown?: () => void) {}\n\n /**\n * Disposes the resources held by the subscription. May, for instance, cancel\n * an ongoing Observable execution or cancel any other type of work that\n * started when the Subscription was created.\n */\n unsubscribe(): void {\n let errors: any[] | undefined;\n\n if (!this.closed) {\n this.closed = true;\n\n // Remove this from it's parents.\n const { _parentage } = this;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n for (const parent of _parentage) {\n parent.remove(this);\n }\n } else {\n _parentage.remove(this);\n }\n }\n\n const { initialTeardown: initialFinalizer } = this;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n } catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n\n const { _finalizers } = this;\n if (_finalizers) {\n this._finalizers = null;\n for (const finalizer of _finalizers) {\n try {\n execFinalizer(finalizer);\n } catch (err) {\n errors = errors ?? [];\n if (err instanceof UnsubscriptionError) {\n errors = [...errors, ...err.errors];\n } else {\n errors.push(err);\n }\n }\n }\n }\n\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n }\n\n /**\n * Adds a finalizer to this subscription, so that finalization will be unsubscribed/called\n * when this subscription is unsubscribed. If this subscription is already {@link #closed},\n * because it has already been unsubscribed, then whatever finalizer is passed to it\n * will automatically be executed (unless the finalizer itself is also a closed subscription).\n *\n * Closed Subscriptions cannot be added as finalizers to any subscription. Adding a closed\n * subscription to a any subscription will result in no operation. (A noop).\n *\n * Adding a subscription to itself, or adding `null` or `undefined` will not perform any\n * operation at all. (A noop).\n *\n * `Subscription` instances that are added to this instance will automatically remove themselves\n * if they are unsubscribed. Functions and {@link Unsubscribable} objects that you wish to remove\n * will need to be removed manually with {@link #remove}\n *\n * @param teardown The finalization logic to add to this subscription.\n */\n add(teardown: TeardownLogic): void {\n // Only add the finalizer if it's not undefined\n // and don't add a subscription to itself.\n if (teardown && teardown !== this) {\n if (this.closed) {\n // If this subscription is already closed,\n // execute whatever finalizer is handed to it automatically.\n execFinalizer(teardown);\n } else {\n if (teardown instanceof Subscription) {\n // We don't add closed subscriptions, and we don't add the same subscription\n // twice. Subscription unsubscribe is idempotent.\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = this._finalizers ?? []).push(teardown);\n }\n }\n }\n\n /**\n * Checks to see if a this subscription already has a particular parent.\n * This will signal that this subscription has already been added to the parent in question.\n * @param parent the parent to check for\n */\n private _hasParent(parent: Subscription) {\n const { _parentage } = this;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n }\n\n /**\n * Adds a parent to this subscription so it can be removed from the parent if it\n * unsubscribes on it's own.\n *\n * NOTE: THIS ASSUMES THAT {@link _hasParent} HAS ALREADY BEEN CHECKED.\n * @param parent The parent subscription to add\n */\n private _addParent(parent: Subscription) {\n const { _parentage } = this;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n }\n\n /**\n * Called on a child when it is removed via {@link #remove}.\n * @param parent The parent to remove\n */\n private _removeParent(parent: Subscription) {\n const { _parentage } = this;\n if (_parentage === parent) {\n this._parentage = null;\n } else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n }\n\n /**\n * Removes a finalizer from this subscription that was previously added with the {@link #add} method.\n *\n * Note that `Subscription` instances, when unsubscribed, will automatically remove themselves\n * from every other `Subscription` they have been added to. This means that using the `remove` method\n * is not a common thing and should be used thoughtfully.\n *\n * If you add the same finalizer instance of a function or an unsubscribable object to a `Subscription` instance\n * more than once, you will need to call `remove` the same number of times to remove all instances.\n *\n * All finalizer instances are removed to free up memory upon unsubscription.\n *\n * @param teardown The finalizer to remove from this subscription\n */\n remove(teardown: Exclude): void {\n const { _finalizers } = this;\n _finalizers && arrRemove(_finalizers, teardown);\n\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n }\n}\n\nexport const EMPTY_SUBSCRIPTION = Subscription.EMPTY;\n\nexport function isSubscription(value: any): value is Subscription {\n return (\n value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe))\n );\n}\n\nfunction execFinalizer(finalizer: Unsubscribable | (() => void)) {\n if (isFunction(finalizer)) {\n finalizer();\n } else {\n finalizer.unsubscribe();\n }\n}\n", "import { Subscriber } from './Subscriber';\nimport { ObservableNotification } from './types';\n\n/**\n * The {@link GlobalConfig} object for RxJS. It is used to configure things\n * like how to react on unhandled errors.\n */\nexport const config: GlobalConfig = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n\n/**\n * The global configuration object for RxJS, used to configure things\n * like how to react on unhandled errors. Accessible via {@link config}\n * object.\n */\nexport interface GlobalConfig {\n /**\n * A registration point for unhandled errors from RxJS. These are errors that\n * cannot were not handled by consuming code in the usual subscription path. For\n * example, if you have this configured, and you subscribe to an observable without\n * providing an error handler, errors from that subscription will end up here. This\n * will _always_ be called asynchronously on another job in the runtime. This is because\n * we do not want errors thrown in this user-configured handler to interfere with the\n * behavior of the library.\n */\n onUnhandledError: ((err: any) => void) | null;\n\n /**\n * A registration point for notifications that cannot be sent to subscribers because they\n * have completed, errored or have been explicitly unsubscribed. By default, next, complete\n * and error notifications sent to stopped subscribers are noops. However, sometimes callers\n * might want a different behavior. For example, with sources that attempt to report errors\n * to stopped subscribers, a caller can configure RxJS to throw an unhandled error instead.\n * This will _always_ be called asynchronously on another job in the runtime. This is because\n * we do not want errors thrown in this user-configured handler to interfere with the\n * behavior of the library.\n */\n onStoppedNotification: ((notification: ObservableNotification, subscriber: Subscriber) => void) | null;\n\n /**\n * The promise constructor used by default for {@link Observable#toPromise toPromise} and {@link Observable#forEach forEach}\n * methods.\n *\n * @deprecated As of version 8, RxJS will no longer support this sort of injection of a\n * Promise constructor. If you need a Promise implementation other than native promises,\n * please polyfill/patch Promise as you see appropriate. Will be removed in v8.\n */\n Promise?: PromiseConstructorLike;\n\n /**\n * If true, turns on synchronous error rethrowing, which is a deprecated behavior\n * in v6 and higher. This behavior enables bad patterns like wrapping a subscribe\n * call in a try/catch block. It also enables producer interference, a nasty bug\n * where a multicast can be broken for all observers by a downstream consumer with\n * an unhandled error. DO NOT USE THIS FLAG UNLESS IT'S NEEDED TO BUY TIME\n * FOR MIGRATION REASONS.\n *\n * @deprecated As of version 8, RxJS will no longer support synchronous throwing\n * of unhandled errors. All errors will be thrown on a separate call stack to prevent bad\n * behaviors described above. Will be removed in v8.\n */\n useDeprecatedSynchronousErrorHandling: boolean;\n\n /**\n * If true, enables an as-of-yet undocumented feature from v5: The ability to access\n * `unsubscribe()` via `this` context in `next` functions created in observers passed\n * to `subscribe`.\n *\n * This is being removed because the performance was severely problematic, and it could also cause\n * issues when types other than POJOs are passed to subscribe as subscribers, as they will likely have\n * their `this` context overwritten.\n *\n * @deprecated As of version 8, RxJS will no longer support altering the\n * context of next functions provided as part of an observer to Subscribe. Instead,\n * you will have access to a subscription or a signal or token that will allow you to do things like\n * unsubscribe and test closed status. Will be removed in v8.\n */\n useDeprecatedNextContext: boolean;\n}\n", "import type { TimerHandle } from './timerHandle';\ntype SetTimeoutFunction = (handler: () => void, timeout?: number, ...args: any[]) => TimerHandle;\ntype ClearTimeoutFunction = (handle: TimerHandle) => void;\n\ninterface TimeoutProvider {\n setTimeout: SetTimeoutFunction;\n clearTimeout: ClearTimeoutFunction;\n delegate:\n | {\n setTimeout: SetTimeoutFunction;\n clearTimeout: ClearTimeoutFunction;\n }\n | undefined;\n}\n\nexport const timeoutProvider: TimeoutProvider = {\n // When accessing the delegate, use the variable rather than `this` so that\n // the functions can be called without being bound to the provider.\n setTimeout(handler: () => void, timeout?: number, ...args) {\n const { delegate } = timeoutProvider;\n if (delegate?.setTimeout) {\n return delegate.setTimeout(handler, timeout, ...args);\n }\n return setTimeout(handler, timeout, ...args);\n },\n clearTimeout(handle) {\n const { delegate } = timeoutProvider;\n return (delegate?.clearTimeout || clearTimeout)(handle as any);\n },\n delegate: undefined,\n};\n", "import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\n\n/**\n * Handles an error on another job either with the user-configured {@link onUnhandledError},\n * or by throwing it on that new job so it can be picked up by `window.onerror`, `process.on('error')`, etc.\n *\n * This should be called whenever there is an error that is out-of-band with the subscription\n * or when an error hits a terminal boundary of the subscription and no error handler was provided.\n *\n * @param err the error to report\n */\nexport function reportUnhandledError(err: any) {\n timeoutProvider.setTimeout(() => {\n const { onUnhandledError } = config;\n if (onUnhandledError) {\n // Execute the user-configured error handler.\n onUnhandledError(err);\n } else {\n // Throw so it is picked up by the runtime's uncaught error mechanism.\n throw err;\n }\n });\n}\n", "/* tslint:disable:no-empty */\nexport function noop() { }\n", "import { CompleteNotification, NextNotification, ErrorNotification } from './types';\n\n/**\n * A completion object optimized for memory use and created to be the\n * same \"shape\" as other notifications in v8.\n * @internal\n */\nexport const COMPLETE_NOTIFICATION = (() => createNotification('C', undefined, undefined) as CompleteNotification)();\n\n/**\n * Internal use only. Creates an optimized error notification that is the same \"shape\"\n * as other notifications.\n * @internal\n */\nexport function errorNotification(error: any): ErrorNotification {\n return createNotification('E', undefined, error) as any;\n}\n\n/**\n * Internal use only. Creates an optimized next notification that is the same \"shape\"\n * as other notifications.\n * @internal\n */\nexport function nextNotification(value: T) {\n return createNotification('N', value, undefined) as NextNotification;\n}\n\n/**\n * Ensures that all notifications created internally have the same \"shape\" in v8.\n *\n * TODO: This is only exported to support a crazy legacy test in `groupBy`.\n * @internal\n */\nexport function createNotification(kind: 'N' | 'E' | 'C', value: any, error: any) {\n return {\n kind,\n value,\n error,\n };\n}\n", "import { config } from '../config';\n\nlet context: { errorThrown: boolean; error: any } | null = null;\n\n/**\n * Handles dealing with errors for super-gross mode. Creates a context, in which\n * any synchronously thrown errors will be passed to {@link captureError}. Which\n * will record the error such that it will be rethrown after the call back is complete.\n * TODO: Remove in v8\n * @param cb An immediately executed function.\n */\nexport function errorContext(cb: () => void) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n const isRoot = !context;\n if (isRoot) {\n context = { errorThrown: false, error: null };\n }\n cb();\n if (isRoot) {\n const { errorThrown, error } = context!;\n context = null;\n if (errorThrown) {\n throw error;\n }\n }\n } else {\n // This is the general non-deprecated path for everyone that\n // isn't crazy enough to use super-gross mode (useDeprecatedSynchronousErrorHandling)\n cb();\n }\n}\n\n/**\n * Captures errors only in super-gross mode.\n * @param err the error to capture\n */\nexport function captureError(err: any) {\n if (config.useDeprecatedSynchronousErrorHandling && context) {\n context.errorThrown = true;\n context.error = err;\n }\n}\n", "import { isFunction } from './util/isFunction';\nimport { Observer, ObservableNotification } from './types';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\n\n/**\n * Implements the {@link Observer} interface and extends the\n * {@link Subscription} class. While the {@link Observer} is the public API for\n * consuming the values of an {@link Observable}, all Observers get converted to\n * a Subscriber, in order to provide Subscription-like capabilities such as\n * `unsubscribe`. Subscriber is a common type in RxJS, and crucial for\n * implementing operators, but it is rarely used as a public API.\n */\nexport class Subscriber extends Subscription implements Observer {\n /**\n * A static factory for a Subscriber, given a (potentially partial) definition\n * of an Observer.\n * @param next The `next` callback of an Observer.\n * @param error The `error` callback of an\n * Observer.\n * @param complete The `complete` callback of an\n * Observer.\n * @return A Subscriber wrapping the (partially defined)\n * Observer represented by the given arguments.\n * @deprecated Do not use. Will be removed in v8. There is no replacement for this\n * method, and there is no reason to be creating instances of `Subscriber` directly.\n * If you have a specific use case, please file an issue.\n */\n static create(next?: (x?: T) => void, error?: (e?: any) => void, complete?: () => void): Subscriber {\n return new SafeSubscriber(next, error, complete);\n }\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n protected isStopped: boolean = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n protected destination: Subscriber | Observer; // this `any` is the escape hatch to erase extra type param (e.g. R)\n\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n * There is no reason to directly create an instance of Subscriber. This type is exported for typings reasons.\n */\n constructor(destination?: Subscriber | Observer) {\n super();\n if (destination) {\n this.destination = destination;\n // Automatically chain subscriptions together here.\n // if destination is a Subscription, then it is a Subscriber.\n if (isSubscription(destination)) {\n destination.add(this);\n }\n } else {\n this.destination = EMPTY_OBSERVER;\n }\n }\n\n /**\n * The {@link Observer} callback to receive notifications of type `next` from\n * the Observable, with a value. The Observable may call this method 0 or more\n * times.\n * @param value The `next` value.\n */\n next(value: T): void {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n } else {\n this._next(value!);\n }\n }\n\n /**\n * The {@link Observer} callback to receive notifications of type `error` from\n * the Observable, with an attached `Error`. Notifies the Observer that\n * the Observable has experienced an error condition.\n * @param err The `error` exception.\n */\n error(err?: any): void {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n } else {\n this.isStopped = true;\n this._error(err);\n }\n }\n\n /**\n * The {@link Observer} callback to receive a valueless notification of type\n * `complete` from the Observable. Notifies the Observer that the Observable\n * has finished sending push-based notifications.\n */\n complete(): void {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n } else {\n this.isStopped = true;\n this._complete();\n }\n }\n\n unsubscribe(): void {\n if (!this.closed) {\n this.isStopped = true;\n super.unsubscribe();\n this.destination = null!;\n }\n }\n\n protected _next(value: T): void {\n this.destination.next(value);\n }\n\n protected _error(err: any): void {\n try {\n this.destination.error(err);\n } finally {\n this.unsubscribe();\n }\n }\n\n protected _complete(): void {\n try {\n this.destination.complete();\n } finally {\n this.unsubscribe();\n }\n }\n}\n\n/**\n * This bind is captured here because we want to be able to have\n * compatibility with monoid libraries that tend to use a method named\n * `bind`. In particular, a library called Monio requires this.\n */\nconst _bind = Function.prototype.bind;\n\nfunction bind any>(fn: Fn, thisArg: any): Fn {\n return _bind.call(fn, thisArg);\n}\n\n/**\n * Internal optimization only, DO NOT EXPOSE.\n * @internal\n */\nclass ConsumerObserver implements Observer {\n constructor(private partialObserver: Partial>) {}\n\n next(value: T): void {\n const { partialObserver } = this;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n } catch (error) {\n handleUnhandledError(error);\n }\n }\n }\n\n error(err: any): void {\n const { partialObserver } = this;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n } catch (error) {\n handleUnhandledError(error);\n }\n } else {\n handleUnhandledError(err);\n }\n }\n\n complete(): void {\n const { partialObserver } = this;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n } catch (error) {\n handleUnhandledError(error);\n }\n }\n }\n}\n\nexport class SafeSubscriber extends Subscriber {\n constructor(\n observerOrNext?: Partial> | ((value: T) => void) | null,\n error?: ((e?: any) => void) | null,\n complete?: (() => void) | null\n ) {\n super();\n\n let partialObserver: Partial>;\n if (isFunction(observerOrNext) || !observerOrNext) {\n // The first argument is a function, not an observer. The next\n // two arguments *could* be observers, or they could be empty.\n partialObserver = {\n next: (observerOrNext ?? undefined) as ((value: T) => void) | undefined,\n error: error ?? undefined,\n complete: complete ?? undefined,\n };\n } else {\n // The first argument is a partial observer.\n let context: any;\n if (this && config.useDeprecatedNextContext) {\n // This is a deprecated path that made `this.unsubscribe()` available in\n // next handler functions passed to subscribe. This only exists behind a flag\n // now, as it is *very* slow.\n context = Object.create(observerOrNext);\n context.unsubscribe = () => this.unsubscribe();\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context),\n error: observerOrNext.error && bind(observerOrNext.error, context),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context),\n };\n } else {\n // The \"normal\" path. Just use the partial observer directly.\n partialObserver = observerOrNext;\n }\n }\n\n // Wrap the partial observer to ensure it's a full observer, and\n // make sure proper error handling is accounted for.\n this.destination = new ConsumerObserver(partialObserver);\n }\n}\n\nfunction handleUnhandledError(error: any) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n } else {\n // Ideal path, we report this as an unhandled error,\n // which is thrown on a new call stack.\n reportUnhandledError(error);\n }\n}\n\n/**\n * An error handler used when no error handler was supplied\n * to the SafeSubscriber -- meaning no error handler was supplied\n * do the `subscribe` call on our observable.\n * @param err The error to handle\n */\nfunction defaultErrorHandler(err: any) {\n throw err;\n}\n\n/**\n * A handler for notifications that cannot be sent to a stopped subscriber.\n * @param notification The notification being sent.\n * @param subscriber The stopped subscriber.\n */\nfunction handleStoppedNotification(notification: ObservableNotification, subscriber: Subscriber) {\n const { onStoppedNotification } = config;\n onStoppedNotification && timeoutProvider.setTimeout(() => onStoppedNotification(notification, subscriber));\n}\n\n/**\n * The observer used as a stub for subscriptions where the user did not\n * pass any arguments to `subscribe`. Comes with the default error handling\n * behavior.\n */\nexport const EMPTY_OBSERVER: Readonly> & { closed: true } = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n", "/**\n * Symbol.observable or a string \"@@observable\". Used for interop\n *\n * @deprecated We will no longer be exporting this symbol in upcoming versions of RxJS.\n * Instead polyfill and use Symbol.observable directly *or* use https://www.npmjs.com/package/symbol-observable\n */\nexport const observable: string | symbol = (() => (typeof Symbol === 'function' && Symbol.observable) || '@@observable')();\n", "/**\n * This function takes one parameter and just returns it. Simply put,\n * this is like `(x: T): T => x`.\n *\n * ## Examples\n *\n * This is useful in some cases when using things like `mergeMap`\n *\n * ```ts\n * import { interval, take, map, range, mergeMap, identity } from 'rxjs';\n *\n * const source$ = interval(1000).pipe(take(5));\n *\n * const result$ = source$.pipe(\n * map(i => range(i)),\n * mergeMap(identity) // same as mergeMap(x => x)\n * );\n *\n * result$.subscribe({\n * next: console.log\n * });\n * ```\n *\n * Or when you want to selectively apply an operator\n *\n * ```ts\n * import { interval, take, identity } from 'rxjs';\n *\n * const shouldLimit = () => Math.random() < 0.5;\n *\n * const source$ = interval(1000);\n *\n * const result$ = source$.pipe(shouldLimit() ? take(5) : identity);\n *\n * result$.subscribe({\n * next: console.log\n * });\n * ```\n *\n * @param x Any value that is returned by this function\n * @returns The value passed as the first parameter to this function\n */\nexport function identity(x: T): T {\n return x;\n}\n", "import { identity } from './identity';\nimport { UnaryFunction } from '../types';\n\nexport function pipe(): typeof identity;\nexport function pipe(fn1: UnaryFunction): UnaryFunction;\nexport function pipe(fn1: UnaryFunction, fn2: UnaryFunction): UnaryFunction;\nexport function pipe(fn1: UnaryFunction, fn2: UnaryFunction, fn3: UnaryFunction): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction\n): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction,\n fn5: UnaryFunction\n): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction,\n fn5: UnaryFunction,\n fn6: UnaryFunction\n): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction,\n fn5: UnaryFunction,\n fn6: UnaryFunction,\n fn7: UnaryFunction\n): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction,\n fn5: UnaryFunction,\n fn6: UnaryFunction,\n fn7: UnaryFunction,\n fn8: UnaryFunction\n): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction,\n fn5: UnaryFunction,\n fn6: UnaryFunction,\n fn7: UnaryFunction,\n fn8: UnaryFunction,\n fn9: UnaryFunction\n): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction,\n fn5: UnaryFunction,\n fn6: UnaryFunction,\n fn7: UnaryFunction,\n fn8: UnaryFunction,\n fn9: UnaryFunction,\n ...fns: UnaryFunction[]\n): UnaryFunction;\n\n/**\n * pipe() can be called on one or more functions, each of which can take one argument (\"UnaryFunction\")\n * and uses it to return a value.\n * It returns a function that takes one argument, passes it to the first UnaryFunction, and then\n * passes the result to the next one, passes that result to the next one, and so on. \n */\nexport function pipe(...fns: Array>): UnaryFunction {\n return pipeFromArray(fns);\n}\n\n/** @internal */\nexport function pipeFromArray(fns: Array>): UnaryFunction {\n if (fns.length === 0) {\n return identity as UnaryFunction;\n }\n\n if (fns.length === 1) {\n return fns[0];\n }\n\n return function piped(input: T): R {\n return fns.reduce((prev: any, fn: UnaryFunction) => fn(prev), input as any);\n };\n}\n", "import { Operator } from './Operator';\nimport { SafeSubscriber, Subscriber } from './Subscriber';\nimport { isSubscription, Subscription } from './Subscription';\nimport { TeardownLogic, OperatorFunction, Subscribable, Observer } from './types';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nimport { isFunction } from './util/isFunction';\nimport { errorContext } from './util/errorContext';\n\n/**\n * A representation of any set of values over any amount of time. This is the most basic building block\n * of RxJS.\n */\nexport class Observable implements Subscribable {\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n */\n source: Observable | undefined;\n\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n */\n operator: Operator | undefined;\n\n /**\n * @param subscribe The function that is called when the Observable is\n * initially subscribed to. This function is given a Subscriber, to which new values\n * can be `next`ed, or an `error` method can be called to raise an error, or\n * `complete` can be called to notify of a successful completion.\n */\n constructor(subscribe?: (this: Observable, subscriber: Subscriber) => TeardownLogic) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n\n // HACK: Since TypeScript inherits static properties too, we have to\n // fight against TypeScript here so Subject can have a different static create signature\n /**\n * Creates a new Observable by calling the Observable constructor\n * @param subscribe the subscriber function to be passed to the Observable constructor\n * @return A new observable.\n * @deprecated Use `new Observable()` instead. Will be removed in v8.\n */\n static create: (...args: any[]) => any = (subscribe?: (subscriber: Subscriber) => TeardownLogic) => {\n return new Observable(subscribe);\n };\n\n /**\n * Creates a new Observable, with this Observable instance as the source, and the passed\n * operator defined as the new observable's operator.\n * @param operator the operator defining the operation to take on the observable\n * @return A new observable with the Operator applied.\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n * If you have implemented an operator using `lift`, it is recommended that you create an\n * operator by simply returning `new Observable()` directly. See \"Creating new operators from\n * scratch\" section here: https://rxjs.dev/guide/operators\n */\n lift(operator?: Operator): Observable {\n const observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n }\n\n subscribe(observerOrNext?: Partial> | ((value: T) => void)): Subscription;\n /** @deprecated Instead of passing separate callback arguments, use an observer argument. Signatures taking separate callback arguments will be removed in v8. Details: https://rxjs.dev/deprecations/subscribe-arguments */\n subscribe(next?: ((value: T) => void) | null, error?: ((error: any) => void) | null, complete?: (() => void) | null): Subscription;\n /**\n * Invokes an execution of an Observable and registers Observer handlers for notifications it will emit.\n *\n * Use it when you have all these Observables, but still nothing is happening.\n *\n * `subscribe` is not a regular operator, but a method that calls Observable's internal `subscribe` function. It\n * might be for example a function that you passed to Observable's constructor, but most of the time it is\n * a library implementation, which defines what will be emitted by an Observable, and when it be will emitted. This means\n * that calling `subscribe` is actually the moment when Observable starts its work, not when it is created, as it is often\n * the thought.\n *\n * Apart from starting the execution of an Observable, this method allows you to listen for values\n * that an Observable emits, as well as for when it completes or errors. You can achieve this in two\n * of the following ways.\n *\n * The first way is creating an object that implements {@link Observer} interface. It should have methods\n * defined by that interface, but note that it should be just a regular JavaScript object, which you can create\n * yourself in any way you want (ES6 class, classic function constructor, object literal etc.). In particular, do\n * not attempt to use any RxJS implementation details to create Observers - you don't need them. Remember also\n * that your object does not have to implement all methods. If you find yourself creating a method that doesn't\n * do anything, you can simply omit it. Note however, if the `error` method is not provided and an error happens,\n * it will be thrown asynchronously. Errors thrown asynchronously cannot be caught using `try`/`catch`. Instead,\n * use the {@link onUnhandledError} configuration option or use a runtime handler (like `window.onerror` or\n * `process.on('error)`) to be notified of unhandled errors. Because of this, it's recommended that you provide\n * an `error` method to avoid missing thrown errors.\n *\n * The second way is to give up on Observer object altogether and simply provide callback functions in place of its methods.\n * This means you can provide three functions as arguments to `subscribe`, where the first function is equivalent\n * of a `next` method, the second of an `error` method and the third of a `complete` method. Just as in case of an Observer,\n * if you do not need to listen for something, you can omit a function by passing `undefined` or `null`,\n * since `subscribe` recognizes these functions by where they were placed in function call. When it comes\n * to the `error` function, as with an Observer, if not provided, errors emitted by an Observable will be thrown asynchronously.\n *\n * You can, however, subscribe with no parameters at all. This may be the case where you're not interested in terminal events\n * and you also handled emissions internally by using operators (e.g. using `tap`).\n *\n * Whichever style of calling `subscribe` you use, in both cases it returns a Subscription object.\n * This object allows you to call `unsubscribe` on it, which in turn will stop the work that an Observable does and will clean\n * up all resources that an Observable used. Note that cancelling a subscription will not call `complete` callback\n * provided to `subscribe` function, which is reserved for a regular completion signal that comes from an Observable.\n *\n * Remember that callbacks provided to `subscribe` are not guaranteed to be called asynchronously.\n * It is an Observable itself that decides when these functions will be called. For example {@link of}\n * by default emits all its values synchronously. Always check documentation for how given Observable\n * will behave when subscribed and if its default behavior can be modified with a `scheduler`.\n *\n * #### Examples\n *\n * Subscribe with an {@link guide/observer Observer}\n *\n * ```ts\n * import { of } from 'rxjs';\n *\n * const sumObserver = {\n * sum: 0,\n * next(value) {\n * console.log('Adding: ' + value);\n * this.sum = this.sum + value;\n * },\n * error() {\n * // We actually could just remove this method,\n * // since we do not really care about errors right now.\n * },\n * complete() {\n * console.log('Sum equals: ' + this.sum);\n * }\n * };\n *\n * of(1, 2, 3) // Synchronously emits 1, 2, 3 and then completes.\n * .subscribe(sumObserver);\n *\n * // Logs:\n * // 'Adding: 1'\n * // 'Adding: 2'\n * // 'Adding: 3'\n * // 'Sum equals: 6'\n * ```\n *\n * Subscribe with functions ({@link deprecations/subscribe-arguments deprecated})\n *\n * ```ts\n * import { of } from 'rxjs'\n *\n * let sum = 0;\n *\n * of(1, 2, 3).subscribe(\n * value => {\n * console.log('Adding: ' + value);\n * sum = sum + value;\n * },\n * undefined,\n * () => console.log('Sum equals: ' + sum)\n * );\n *\n * // Logs:\n * // 'Adding: 1'\n * // 'Adding: 2'\n * // 'Adding: 3'\n * // 'Sum equals: 6'\n * ```\n *\n * Cancel a subscription\n *\n * ```ts\n * import { interval } from 'rxjs';\n *\n * const subscription = interval(1000).subscribe({\n * next(num) {\n * console.log(num)\n * },\n * complete() {\n * // Will not be called, even when cancelling subscription.\n * console.log('completed!');\n * }\n * });\n *\n * setTimeout(() => {\n * subscription.unsubscribe();\n * console.log('unsubscribed!');\n * }, 2500);\n *\n * // Logs:\n * // 0 after 1s\n * // 1 after 2s\n * // 'unsubscribed!' after 2.5s\n * ```\n *\n * @param observerOrNext Either an {@link Observer} with some or all callback methods,\n * or the `next` handler that is called for each value emitted from the subscribed Observable.\n * @param error A handler for a terminal event resulting from an error. If no error handler is provided,\n * the error will be thrown asynchronously as unhandled.\n * @param complete A handler for a terminal event resulting from successful completion.\n * @return A subscription reference to the registered handlers.\n */\n subscribe(\n observerOrNext?: Partial> | ((value: T) => void) | null,\n error?: ((error: any) => void) | null,\n complete?: (() => void) | null\n ): Subscription {\n const subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);\n\n errorContext(() => {\n const { operator, source } = this;\n subscriber.add(\n operator\n ? // We're dealing with a subscription in the\n // operator chain to one of our lifted operators.\n operator.call(subscriber, source)\n : source\n ? // If `source` has a value, but `operator` does not, something that\n // had intimate knowledge of our API, like our `Subject`, must have\n // set it. We're going to just call `_subscribe` directly.\n this._subscribe(subscriber)\n : // In all other cases, we're likely wrapping a user-provided initializer\n // function, so we need to catch errors and handle them appropriately.\n this._trySubscribe(subscriber)\n );\n });\n\n return subscriber;\n }\n\n /** @internal */\n protected _trySubscribe(sink: Subscriber): TeardownLogic {\n try {\n return this._subscribe(sink);\n } catch (err) {\n // We don't need to return anything in this case,\n // because it's just going to try to `add()` to a subscription\n // above.\n sink.error(err);\n }\n }\n\n /**\n * Used as a NON-CANCELLABLE means of subscribing to an observable, for use with\n * APIs that expect promises, like `async/await`. You cannot unsubscribe from this.\n *\n * **WARNING**: Only use this with observables you *know* will complete. If the source\n * observable does not complete, you will end up with a promise that is hung up, and\n * potentially all of the state of an async function hanging out in memory. To avoid\n * this situation, look into adding something like {@link timeout}, {@link take},\n * {@link takeWhile}, or {@link takeUntil} amongst others.\n *\n * #### Example\n *\n * ```ts\n * import { interval, take } from 'rxjs';\n *\n * const source$ = interval(1000).pipe(take(4));\n *\n * async function getTotal() {\n * let total = 0;\n *\n * await source$.forEach(value => {\n * total += value;\n * console.log('observable -> ' + value);\n * });\n *\n * return total;\n * }\n *\n * getTotal().then(\n * total => console.log('Total: ' + total)\n * );\n *\n * // Expected:\n * // 'observable -> 0'\n * // 'observable -> 1'\n * // 'observable -> 2'\n * // 'observable -> 3'\n * // 'Total: 6'\n * ```\n *\n * @param next A handler for each value emitted by the observable.\n * @return A promise that either resolves on observable completion or\n * rejects with the handled error.\n */\n forEach(next: (value: T) => void): Promise;\n\n /**\n * @param next a handler for each value emitted by the observable\n * @param promiseCtor a constructor function used to instantiate the Promise\n * @return a promise that either resolves on observable completion or\n * rejects with the handled error\n * @deprecated Passing a Promise constructor will no longer be available\n * in upcoming versions of RxJS. This is because it adds weight to the library, for very\n * little benefit. If you need this functionality, it is recommended that you either\n * polyfill Promise, or you create an adapter to convert the returned native promise\n * to whatever promise implementation you wanted. Will be removed in v8.\n */\n forEach(next: (value: T) => void, promiseCtor: PromiseConstructorLike): Promise;\n\n forEach(next: (value: T) => void, promiseCtor?: PromiseConstructorLike): Promise {\n promiseCtor = getPromiseCtor(promiseCtor);\n\n return new promiseCtor((resolve, reject) => {\n const subscriber = new SafeSubscriber({\n next: (value) => {\n try {\n next(value);\n } catch (err) {\n reject(err);\n subscriber.unsubscribe();\n }\n },\n error: reject,\n complete: resolve,\n });\n this.subscribe(subscriber);\n }) as Promise;\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber): TeardownLogic {\n return this.source?.subscribe(subscriber);\n }\n\n /**\n * An interop point defined by the es7-observable spec https://github.com/zenparsing/es-observable\n * @return This instance of the observable.\n */\n [Symbol_observable]() {\n return this;\n }\n\n /* tslint:disable:max-line-length */\n pipe(): Observable;\n pipe(op1: OperatorFunction): Observable;\n pipe(op1: OperatorFunction, op2: OperatorFunction): Observable;\n pipe(op1: OperatorFunction, op2: OperatorFunction, op3: OperatorFunction): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction\n ): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction,\n op5: OperatorFunction\n ): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction,\n op5: OperatorFunction,\n op6: OperatorFunction\n ): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction,\n op5: OperatorFunction,\n op6: OperatorFunction,\n op7: OperatorFunction\n ): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction,\n op5: OperatorFunction,\n op6: OperatorFunction,\n op7: OperatorFunction,\n op8: OperatorFunction\n ): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction,\n op5: OperatorFunction,\n op6: OperatorFunction,\n op7: OperatorFunction,\n op8: OperatorFunction,\n op9: OperatorFunction\n ): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction,\n op5: OperatorFunction,\n op6: OperatorFunction,\n op7: OperatorFunction,\n op8: OperatorFunction,\n op9: OperatorFunction,\n ...operations: OperatorFunction[]\n ): Observable;\n /* tslint:enable:max-line-length */\n\n /**\n * Used to stitch together functional operators into a chain.\n *\n * ## Example\n *\n * ```ts\n * import { interval, filter, map, scan } from 'rxjs';\n *\n * interval(1000)\n * .pipe(\n * filter(x => x % 2 === 0),\n * map(x => x + x),\n * scan((acc, x) => acc + x)\n * )\n * .subscribe(x => console.log(x));\n * ```\n *\n * @return The Observable result of all the operators having been called\n * in the order they were passed in.\n */\n pipe(...operations: OperatorFunction[]): Observable {\n return pipeFromArray(operations)(this);\n }\n\n /* tslint:disable:max-line-length */\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(): Promise;\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(PromiseCtor: typeof Promise): Promise;\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(PromiseCtor: PromiseConstructorLike): Promise;\n /* tslint:enable:max-line-length */\n\n /**\n * Subscribe to this Observable and get a Promise resolving on\n * `complete` with the last emission (if any).\n *\n * **WARNING**: Only use this with observables you *know* will complete. If the source\n * observable does not complete, you will end up with a promise that is hung up, and\n * potentially all of the state of an async function hanging out in memory. To avoid\n * this situation, look into adding something like {@link timeout}, {@link take},\n * {@link takeWhile}, or {@link takeUntil} amongst others.\n *\n * @param [promiseCtor] a constructor function used to instantiate\n * the Promise\n * @return A Promise that resolves with the last value emit, or\n * rejects on an error. If there were no emissions, Promise\n * resolves with undefined.\n * @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise\n */\n toPromise(promiseCtor?: PromiseConstructorLike): Promise {\n promiseCtor = getPromiseCtor(promiseCtor);\n\n return new promiseCtor((resolve, reject) => {\n let value: T | undefined;\n this.subscribe(\n (x: T) => (value = x),\n (err: any) => reject(err),\n () => resolve(value)\n );\n }) as Promise;\n }\n}\n\n/**\n * Decides between a passed promise constructor from consuming code,\n * A default configured promise constructor, and the native promise\n * constructor and returns it. If nothing can be found, it will throw\n * an error.\n * @param promiseCtor The optional promise constructor to passed by consuming code\n */\nfunction getPromiseCtor(promiseCtor: PromiseConstructorLike | undefined) {\n return promiseCtor ?? config.Promise ?? Promise;\n}\n\nfunction isObserver(value: any): value is Observer {\n return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);\n}\n\nfunction isSubscriber(value: any): value is Subscriber {\n return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));\n}\n", "import { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { OperatorFunction } from '../types';\nimport { isFunction } from './isFunction';\n\n/**\n * Used to determine if an object is an Observable with a lift function.\n */\nexport function hasLift(source: any): source is { lift: InstanceType['lift'] } {\n return isFunction(source?.lift);\n}\n\n/**\n * Creates an `OperatorFunction`. Used to define operators throughout the library in a concise way.\n * @param init The logic to connect the liftedSource to the subscriber at the moment of subscription.\n */\nexport function operate(\n init: (liftedSource: Observable, subscriber: Subscriber) => (() => void) | void\n): OperatorFunction {\n return (source: Observable) => {\n if (hasLift(source)) {\n return source.lift(function (this: Subscriber, liftedSource: Observable) {\n try {\n return init(liftedSource, this);\n } catch (err) {\n this.error(err);\n }\n });\n }\n throw new TypeError('Unable to lift unknown Observable type');\n };\n}\n", "import { Subscriber } from '../Subscriber';\n\n/**\n * Creates an instance of an `OperatorSubscriber`.\n * @param destination The downstream subscriber.\n * @param onNext Handles next values, only called if this subscriber is not stopped or closed. Any\n * error that occurs in this function is caught and sent to the `error` method of this subscriber.\n * @param onError Handles errors from the subscription, any errors that occur in this handler are caught\n * and send to the `destination` error handler.\n * @param onComplete Handles completion notification from the subscription. Any errors that occur in\n * this handler are sent to the `destination` error handler.\n * @param onFinalize Additional teardown logic here. This will only be called on teardown if the\n * subscriber itself is not already closed. This is called after all other teardown logic is executed.\n */\nexport function createOperatorSubscriber(\n destination: Subscriber,\n onNext?: (value: T) => void,\n onComplete?: () => void,\n onError?: (err: any) => void,\n onFinalize?: () => void\n): Subscriber {\n return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);\n}\n\n/**\n * A generic helper for allowing operators to be created with a Subscriber and\n * use closures to capture necessary state from the operator function itself.\n */\nexport class OperatorSubscriber extends Subscriber {\n /**\n * Creates an instance of an `OperatorSubscriber`.\n * @param destination The downstream subscriber.\n * @param onNext Handles next values, only called if this subscriber is not stopped or closed. Any\n * error that occurs in this function is caught and sent to the `error` method of this subscriber.\n * @param onError Handles errors from the subscription, any errors that occur in this handler are caught\n * and send to the `destination` error handler.\n * @param onComplete Handles completion notification from the subscription. Any errors that occur in\n * this handler are sent to the `destination` error handler.\n * @param onFinalize Additional finalization logic here. This will only be called on finalization if the\n * subscriber itself is not already closed. This is called after all other finalization logic is executed.\n * @param shouldUnsubscribe An optional check to see if an unsubscribe call should truly unsubscribe.\n * NOTE: This currently **ONLY** exists to support the strange behavior of {@link groupBy}, where unsubscription\n * to the resulting observable does not actually disconnect from the source if there are active subscriptions\n * to any grouped observable. (DO NOT EXPOSE OR USE EXTERNALLY!!!)\n */\n constructor(\n destination: Subscriber,\n onNext?: (value: T) => void,\n onComplete?: () => void,\n onError?: (err: any) => void,\n private onFinalize?: () => void,\n private shouldUnsubscribe?: () => boolean\n ) {\n // It's important - for performance reasons - that all of this class's\n // members are initialized and that they are always initialized in the same\n // order. This will ensure that all OperatorSubscriber instances have the\n // same hidden class in V8. This, in turn, will help keep the number of\n // hidden classes involved in property accesses within the base class as\n // low as possible. If the number of hidden classes involved exceeds four,\n // the property accesses will become megamorphic and performance penalties\n // will be incurred - i.e. inline caches won't be used.\n //\n // The reasons for ensuring all instances have the same hidden class are\n // further discussed in this blog post from Benedikt Meurer:\n // https://benediktmeurer.de/2018/03/23/impact-of-polymorphism-on-component-based-frameworks-like-react/\n super(destination);\n this._next = onNext\n ? function (this: OperatorSubscriber, value: T) {\n try {\n onNext(value);\n } catch (err) {\n destination.error(err);\n }\n }\n : super._next;\n this._error = onError\n ? function (this: OperatorSubscriber, err: any) {\n try {\n onError(err);\n } catch (err) {\n // Send any errors that occur down stream.\n destination.error(err);\n } finally {\n // Ensure finalization.\n this.unsubscribe();\n }\n }\n : super._error;\n this._complete = onComplete\n ? function (this: OperatorSubscriber) {\n try {\n onComplete();\n } catch (err) {\n // Send any errors that occur down stream.\n destination.error(err);\n } finally {\n // Ensure finalization.\n this.unsubscribe();\n }\n }\n : super._complete;\n }\n\n unsubscribe() {\n if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {\n const { closed } = this;\n super.unsubscribe();\n // Execute additional teardown if we have any and we didn't already do so.\n !closed && this.onFinalize?.();\n }\n }\n}\n", "import { Subscription } from '../Subscription';\n\ninterface AnimationFrameProvider {\n schedule(callback: FrameRequestCallback): Subscription;\n requestAnimationFrame: typeof requestAnimationFrame;\n cancelAnimationFrame: typeof cancelAnimationFrame;\n delegate:\n | {\n requestAnimationFrame: typeof requestAnimationFrame;\n cancelAnimationFrame: typeof cancelAnimationFrame;\n }\n | undefined;\n}\n\nexport const animationFrameProvider: AnimationFrameProvider = {\n // When accessing the delegate, use the variable rather than `this` so that\n // the functions can be called without being bound to the provider.\n schedule(callback) {\n let request = requestAnimationFrame;\n let cancel: typeof cancelAnimationFrame | undefined = cancelAnimationFrame;\n const { delegate } = animationFrameProvider;\n if (delegate) {\n request = delegate.requestAnimationFrame;\n cancel = delegate.cancelAnimationFrame;\n }\n const handle = request((timestamp) => {\n // Clear the cancel function. The request has been fulfilled, so\n // attempting to cancel the request upon unsubscription would be\n // pointless.\n cancel = undefined;\n callback(timestamp);\n });\n return new Subscription(() => cancel?.(handle));\n },\n requestAnimationFrame(...args) {\n const { delegate } = animationFrameProvider;\n return (delegate?.requestAnimationFrame || requestAnimationFrame)(...args);\n },\n cancelAnimationFrame(...args) {\n const { delegate } = animationFrameProvider;\n return (delegate?.cancelAnimationFrame || cancelAnimationFrame)(...args);\n },\n delegate: undefined,\n};\n", "import { createErrorClass } from './createErrorClass';\n\nexport interface ObjectUnsubscribedError extends Error {}\n\nexport interface ObjectUnsubscribedErrorCtor {\n /**\n * @deprecated Internal implementation detail. Do not construct error instances.\n * Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269\n */\n new (): ObjectUnsubscribedError;\n}\n\n/**\n * An error thrown when an action is invalid because the object has been\n * unsubscribed.\n *\n * @see {@link Subject}\n * @see {@link BehaviorSubject}\n *\n * @class ObjectUnsubscribedError\n */\nexport const ObjectUnsubscribedError: ObjectUnsubscribedErrorCtor = createErrorClass(\n (_super) =>\n function ObjectUnsubscribedErrorImpl(this: any) {\n _super(this);\n this.name = 'ObjectUnsubscribedError';\n this.message = 'object unsubscribed';\n }\n);\n", "import { Operator } from './Operator';\nimport { Observable } from './Observable';\nimport { Subscriber } from './Subscriber';\nimport { Subscription, EMPTY_SUBSCRIPTION } from './Subscription';\nimport { Observer, SubscriptionLike, TeardownLogic } from './types';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { arrRemove } from './util/arrRemove';\nimport { errorContext } from './util/errorContext';\n\n/**\n * A Subject is a special type of Observable that allows values to be\n * multicasted to many Observers. Subjects are like EventEmitters.\n *\n * Every Subject is an Observable and an Observer. You can subscribe to a\n * Subject, and you can call next to feed values as well as error and complete.\n */\nexport class Subject extends Observable implements SubscriptionLike {\n closed = false;\n\n private currentObservers: Observer[] | null = null;\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n observers: Observer[] = [];\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n isStopped = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n hasError = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n thrownError: any = null;\n\n /**\n * Creates a \"subject\" by basically gluing an observer to an observable.\n *\n * @deprecated Recommended you do not use. Will be removed at some point in the future. Plans for replacement still under discussion.\n */\n static create: (...args: any[]) => any = (destination: Observer, source: Observable): AnonymousSubject => {\n return new AnonymousSubject(destination, source);\n };\n\n constructor() {\n // NOTE: This must be here to obscure Observable's constructor.\n super();\n }\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n lift(operator: Operator): Observable {\n const subject = new AnonymousSubject(this, this);\n subject.operator = operator as any;\n return subject as any;\n }\n\n /** @internal */\n protected _throwIfClosed() {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n }\n\n next(value: T) {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n if (!this.currentObservers) {\n this.currentObservers = Array.from(this.observers);\n }\n for (const observer of this.currentObservers) {\n observer.next(value);\n }\n }\n });\n }\n\n error(err: any) {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n this.hasError = this.isStopped = true;\n this.thrownError = err;\n const { observers } = this;\n while (observers.length) {\n observers.shift()!.error(err);\n }\n }\n });\n }\n\n complete() {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n this.isStopped = true;\n const { observers } = this;\n while (observers.length) {\n observers.shift()!.complete();\n }\n }\n });\n }\n\n unsubscribe() {\n this.isStopped = this.closed = true;\n this.observers = this.currentObservers = null!;\n }\n\n get observed() {\n return this.observers?.length > 0;\n }\n\n /** @internal */\n protected _trySubscribe(subscriber: Subscriber): TeardownLogic {\n this._throwIfClosed();\n return super._trySubscribe(subscriber);\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber): Subscription {\n this._throwIfClosed();\n this._checkFinalizedStatuses(subscriber);\n return this._innerSubscribe(subscriber);\n }\n\n /** @internal */\n protected _innerSubscribe(subscriber: Subscriber) {\n const { hasError, isStopped, observers } = this;\n if (hasError || isStopped) {\n return EMPTY_SUBSCRIPTION;\n }\n this.currentObservers = null;\n observers.push(subscriber);\n return new Subscription(() => {\n this.currentObservers = null;\n arrRemove(observers, subscriber);\n });\n }\n\n /** @internal */\n protected _checkFinalizedStatuses(subscriber: Subscriber) {\n const { hasError, thrownError, isStopped } = this;\n if (hasError) {\n subscriber.error(thrownError);\n } else if (isStopped) {\n subscriber.complete();\n }\n }\n\n /**\n * Creates a new Observable with this Subject as the source. You can do this\n * to create custom Observer-side logic of the Subject and conceal it from\n * code that uses the Observable.\n * @return Observable that this Subject casts to.\n */\n asObservable(): Observable {\n const observable: any = new Observable();\n observable.source = this;\n return observable;\n }\n}\n\nexport class AnonymousSubject extends Subject {\n constructor(\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n public destination?: Observer,\n source?: Observable\n ) {\n super();\n this.source = source;\n }\n\n next(value: T) {\n this.destination?.next?.(value);\n }\n\n error(err: any) {\n this.destination?.error?.(err);\n }\n\n complete() {\n this.destination?.complete?.();\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber): Subscription {\n return this.source?.subscribe(subscriber) ?? EMPTY_SUBSCRIPTION;\n }\n}\n", "import { Subject } from './Subject';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\n\n/**\n * A variant of Subject that requires an initial value and emits its current\n * value whenever it is subscribed to.\n */\nexport class BehaviorSubject extends Subject {\n constructor(private _value: T) {\n super();\n }\n\n get value(): T {\n return this.getValue();\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber): Subscription {\n const subscription = super._subscribe(subscriber);\n !subscription.closed && subscriber.next(this._value);\n return subscription;\n }\n\n getValue(): T {\n const { hasError, thrownError, _value } = this;\n if (hasError) {\n throw thrownError;\n }\n this._throwIfClosed();\n return _value;\n }\n\n next(value: T): void {\n super.next((this._value = value));\n }\n}\n", "import { TimestampProvider } from '../types';\n\ninterface DateTimestampProvider extends TimestampProvider {\n delegate: TimestampProvider | undefined;\n}\n\nexport const dateTimestampProvider: DateTimestampProvider = {\n now() {\n // Use the variable rather than `this` so that the function can be called\n // without being bound to the provider.\n return (dateTimestampProvider.delegate || Date).now();\n },\n delegate: undefined,\n};\n", "import { Subject } from './Subject';\nimport { TimestampProvider } from './types';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\nimport { dateTimestampProvider } from './scheduler/dateTimestampProvider';\n\n/**\n * A variant of {@link Subject} that \"replays\" old values to new subscribers by emitting them when they first subscribe.\n *\n * `ReplaySubject` has an internal buffer that will store a specified number of values that it has observed. Like `Subject`,\n * `ReplaySubject` \"observes\" values by having them passed to its `next` method. When it observes a value, it will store that\n * value for a time determined by the configuration of the `ReplaySubject`, as passed to its constructor.\n *\n * When a new subscriber subscribes to the `ReplaySubject` instance, it will synchronously emit all values in its buffer in\n * a First-In-First-Out (FIFO) manner. The `ReplaySubject` will also complete, if it has observed completion; and it will\n * error if it has observed an error.\n *\n * There are two main configuration items to be concerned with:\n *\n * 1. `bufferSize` - This will determine how many items are stored in the buffer, defaults to infinite.\n * 2. `windowTime` - The amount of time to hold a value in the buffer before removing it from the buffer.\n *\n * Both configurations may exist simultaneously. So if you would like to buffer a maximum of 3 values, as long as the values\n * are less than 2 seconds old, you could do so with a `new ReplaySubject(3, 2000)`.\n *\n * ### Differences with BehaviorSubject\n *\n * `BehaviorSubject` is similar to `new ReplaySubject(1)`, with a couple of exceptions:\n *\n * 1. `BehaviorSubject` comes \"primed\" with a single value upon construction.\n * 2. `ReplaySubject` will replay values, even after observing an error, where `BehaviorSubject` will not.\n *\n * @see {@link Subject}\n * @see {@link BehaviorSubject}\n * @see {@link shareReplay}\n */\nexport class ReplaySubject extends Subject {\n private _buffer: (T | number)[] = [];\n private _infiniteTimeWindow = true;\n\n /**\n * @param _bufferSize The size of the buffer to replay on subscription\n * @param _windowTime The amount of time the buffered items will stay buffered\n * @param _timestampProvider An object with a `now()` method that provides the current timestamp. This is used to\n * calculate the amount of time something has been buffered.\n */\n constructor(\n private _bufferSize = Infinity,\n private _windowTime = Infinity,\n private _timestampProvider: TimestampProvider = dateTimestampProvider\n ) {\n super();\n this._infiniteTimeWindow = _windowTime === Infinity;\n this._bufferSize = Math.max(1, _bufferSize);\n this._windowTime = Math.max(1, _windowTime);\n }\n\n next(value: T): void {\n const { isStopped, _buffer, _infiniteTimeWindow, _timestampProvider, _windowTime } = this;\n if (!isStopped) {\n _buffer.push(value);\n !_infiniteTimeWindow && _buffer.push(_timestampProvider.now() + _windowTime);\n }\n this._trimBuffer();\n super.next(value);\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber): Subscription {\n this._throwIfClosed();\n this._trimBuffer();\n\n const subscription = this._innerSubscribe(subscriber);\n\n const { _infiniteTimeWindow, _buffer } = this;\n // We use a copy here, so reentrant code does not mutate our array while we're\n // emitting it to a new subscriber.\n const copy = _buffer.slice();\n for (let i = 0; i < copy.length && !subscriber.closed; i += _infiniteTimeWindow ? 1 : 2) {\n subscriber.next(copy[i] as T);\n }\n\n this._checkFinalizedStatuses(subscriber);\n\n return subscription;\n }\n\n private _trimBuffer() {\n const { _bufferSize, _timestampProvider, _buffer, _infiniteTimeWindow } = this;\n // If we don't have an infinite buffer size, and we're over the length,\n // use splice to truncate the old buffer values off. Note that we have to\n // double the size for instances where we're not using an infinite time window\n // because we're storing the values and the timestamps in the same array.\n const adjustedBufferSize = (_infiniteTimeWindow ? 1 : 2) * _bufferSize;\n _bufferSize < Infinity && adjustedBufferSize < _buffer.length && _buffer.splice(0, _buffer.length - adjustedBufferSize);\n\n // Now, if we're not in an infinite time window, remove all values where the time is\n // older than what is allowed.\n if (!_infiniteTimeWindow) {\n const now = _timestampProvider.now();\n let last = 0;\n // Search the array for the first timestamp that isn't expired and\n // truncate the buffer up to that point.\n for (let i = 1; i < _buffer.length && (_buffer[i] as number) <= now; i += 2) {\n last = i;\n }\n last && _buffer.splice(0, last + 1);\n }\n }\n}\n", "import { Scheduler } from '../Scheduler';\nimport { Subscription } from '../Subscription';\nimport { SchedulerAction } from '../types';\n\n/**\n * A unit of work to be executed in a `scheduler`. An action is typically\n * created from within a {@link SchedulerLike} and an RxJS user does not need to concern\n * themselves about creating and manipulating an Action.\n *\n * ```ts\n * class Action extends Subscription {\n * new (scheduler: Scheduler, work: (state?: T) => void);\n * schedule(state?: T, delay: number = 0): Subscription;\n * }\n * ```\n */\nexport class Action extends Subscription {\n constructor(scheduler: Scheduler, work: (this: SchedulerAction, state?: T) => void) {\n super();\n }\n /**\n * Schedules this action on its parent {@link SchedulerLike} for execution. May be passed\n * some context object, `state`. May happen at some point in the future,\n * according to the `delay` parameter, if specified.\n * @param state Some contextual data that the `work` function uses when called by the\n * Scheduler.\n * @param delay Time to wait before executing the work, where the time unit is implicit\n * and defined by the Scheduler.\n * @return A subscription in order to be able to unsubscribe the scheduled work.\n */\n public schedule(state?: T, delay: number = 0): Subscription {\n return this;\n }\n}\n", "import type { TimerHandle } from './timerHandle';\ntype SetIntervalFunction = (handler: () => void, timeout?: number, ...args: any[]) => TimerHandle;\ntype ClearIntervalFunction = (handle: TimerHandle) => void;\n\ninterface IntervalProvider {\n setInterval: SetIntervalFunction;\n clearInterval: ClearIntervalFunction;\n delegate:\n | {\n setInterval: SetIntervalFunction;\n clearInterval: ClearIntervalFunction;\n }\n | undefined;\n}\n\nexport const intervalProvider: IntervalProvider = {\n // When accessing the delegate, use the variable rather than `this` so that\n // the functions can be called without being bound to the provider.\n setInterval(handler: () => void, timeout?: number, ...args) {\n const { delegate } = intervalProvider;\n if (delegate?.setInterval) {\n return delegate.setInterval(handler, timeout, ...args);\n }\n return setInterval(handler, timeout, ...args);\n },\n clearInterval(handle) {\n const { delegate } = intervalProvider;\n return (delegate?.clearInterval || clearInterval)(handle as any);\n },\n delegate: undefined,\n};\n", "import { Action } from './Action';\nimport { SchedulerAction } from '../types';\nimport { Subscription } from '../Subscription';\nimport { AsyncScheduler } from './AsyncScheduler';\nimport { intervalProvider } from './intervalProvider';\nimport { arrRemove } from '../util/arrRemove';\nimport { TimerHandle } from './timerHandle';\n\nexport class AsyncAction extends Action {\n public id: TimerHandle | undefined;\n public state?: T;\n // @ts-ignore: Property has no initializer and is not definitely assigned\n public delay: number;\n protected pending: boolean = false;\n\n constructor(protected scheduler: AsyncScheduler, protected work: (this: SchedulerAction, state?: T) => void) {\n super(scheduler, work);\n }\n\n public schedule(state?: T, delay: number = 0): Subscription {\n if (this.closed) {\n return this;\n }\n\n // Always replace the current state with the new state.\n this.state = state;\n\n const id = this.id;\n const scheduler = this.scheduler;\n\n //\n // Important implementation note:\n //\n // Actions only execute once by default, unless rescheduled from within the\n // scheduled callback. This allows us to implement single and repeat\n // actions via the same code path, without adding API surface area, as well\n // as mimic traditional recursion but across asynchronous boundaries.\n //\n // However, JS runtimes and timers distinguish between intervals achieved by\n // serial `setTimeout` calls vs. a single `setInterval` call. An interval of\n // serial `setTimeout` calls can be individually delayed, which delays\n // scheduling the next `setTimeout`, and so on. `setInterval` attempts to\n // guarantee the interval callback will be invoked more precisely to the\n // interval period, regardless of load.\n //\n // Therefore, we use `setInterval` to schedule single and repeat actions.\n // If the action reschedules itself with the same delay, the interval is not\n // canceled. If the action doesn't reschedule, or reschedules with a\n // different delay, the interval will be canceled after scheduled callback\n // execution.\n //\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, delay);\n }\n\n // Set the pending flag indicating that this action has been scheduled, or\n // has recursively rescheduled itself.\n this.pending = true;\n\n this.delay = delay;\n // If this action has already an async Id, don't request a new one.\n this.id = this.id ?? this.requestAsyncId(scheduler, this.id, delay);\n\n return this;\n }\n\n protected requestAsyncId(scheduler: AsyncScheduler, _id?: TimerHandle, delay: number = 0): TimerHandle {\n return intervalProvider.setInterval(scheduler.flush.bind(scheduler, this), delay);\n }\n\n protected recycleAsyncId(_scheduler: AsyncScheduler, id?: TimerHandle, delay: number | null = 0): TimerHandle | undefined {\n // If this action is rescheduled with the same delay time, don't clear the interval id.\n if (delay != null && this.delay === delay && this.pending === false) {\n return id;\n }\n // Otherwise, if the action's delay time is different from the current delay,\n // or the action has been rescheduled before it's executed, clear the interval id\n if (id != null) {\n intervalProvider.clearInterval(id);\n }\n\n return undefined;\n }\n\n /**\n * Immediately executes this action and the `work` it contains.\n */\n public execute(state: T, delay: number): any {\n if (this.closed) {\n return new Error('executing a cancelled action');\n }\n\n this.pending = false;\n const error = this._execute(state, delay);\n if (error) {\n return error;\n } else if (this.pending === false && this.id != null) {\n // Dequeue if the action didn't reschedule itself. Don't call\n // unsubscribe(), because the action could reschedule later.\n // For example:\n // ```\n // scheduler.schedule(function doWork(counter) {\n // /* ... I'm a busy worker bee ... */\n // var originalAction = this;\n // /* wait 100ms before rescheduling the action */\n // setTimeout(function () {\n // originalAction.schedule(counter + 1);\n // }, 100);\n // }, 1000);\n // ```\n this.id = this.recycleAsyncId(this.scheduler, this.id, null);\n }\n }\n\n protected _execute(state: T, _delay: number): any {\n let errored: boolean = false;\n let errorValue: any;\n try {\n this.work(state);\n } catch (e) {\n errored = true;\n // HACK: Since code elsewhere is relying on the \"truthiness\" of the\n // return here, we can't have it return \"\" or 0 or false.\n // TODO: Clean this up when we refactor schedulers mid-version-8 or so.\n errorValue = e ? e : new Error('Scheduled action threw falsy error');\n }\n if (errored) {\n this.unsubscribe();\n return errorValue;\n }\n }\n\n unsubscribe() {\n if (!this.closed) {\n const { id, scheduler } = this;\n const { actions } = scheduler;\n\n this.work = this.state = this.scheduler = null!;\n this.pending = false;\n\n arrRemove(actions, this);\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, null);\n }\n\n this.delay = null!;\n super.unsubscribe();\n }\n }\n}\n", "import { Action } from './scheduler/Action';\nimport { Subscription } from './Subscription';\nimport { SchedulerLike, SchedulerAction } from './types';\nimport { dateTimestampProvider } from './scheduler/dateTimestampProvider';\n\n/**\n * An execution context and a data structure to order tasks and schedule their\n * execution. Provides a notion of (potentially virtual) time, through the\n * `now()` getter method.\n *\n * Each unit of work in a Scheduler is called an `Action`.\n *\n * ```ts\n * class Scheduler {\n * now(): number;\n * schedule(work, delay?, state?): Subscription;\n * }\n * ```\n *\n * @deprecated Scheduler is an internal implementation detail of RxJS, and\n * should not be used directly. Rather, create your own class and implement\n * {@link SchedulerLike}. Will be made internal in v8.\n */\nexport class Scheduler implements SchedulerLike {\n public static now: () => number = dateTimestampProvider.now;\n\n constructor(private schedulerActionCtor: typeof Action, now: () => number = Scheduler.now) {\n this.now = now;\n }\n\n /**\n * A getter method that returns a number representing the current time\n * (at the time this function was called) according to the scheduler's own\n * internal clock.\n * @return A number that represents the current time. May or may not\n * have a relation to wall-clock time. May or may not refer to a time unit\n * (e.g. milliseconds).\n */\n public now: () => number;\n\n /**\n * Schedules a function, `work`, for execution. May happen at some point in\n * the future, according to the `delay` parameter, if specified. May be passed\n * some context object, `state`, which will be passed to the `work` function.\n *\n * The given arguments will be processed an stored as an Action object in a\n * queue of actions.\n *\n * @param work A function representing a task, or some unit of work to be\n * executed by the Scheduler.\n * @param delay Time to wait before executing the work, where the time unit is\n * implicit and defined by the Scheduler itself.\n * @param state Some contextual data that the `work` function uses when called\n * by the Scheduler.\n * @return A subscription in order to be able to unsubscribe the scheduled work.\n */\n public schedule(work: (this: SchedulerAction, state?: T) => void, delay: number = 0, state?: T): Subscription {\n return new this.schedulerActionCtor(this, work).schedule(state, delay);\n }\n}\n", "import { Scheduler } from '../Scheduler';\nimport { Action } from './Action';\nimport { AsyncAction } from './AsyncAction';\nimport { TimerHandle } from './timerHandle';\n\nexport class AsyncScheduler extends Scheduler {\n public actions: Array> = [];\n /**\n * A flag to indicate whether the Scheduler is currently executing a batch of\n * queued actions.\n * @internal\n */\n public _active: boolean = false;\n /**\n * An internal ID used to track the latest asynchronous task such as those\n * coming from `setTimeout`, `setInterval`, `requestAnimationFrame`, and\n * others.\n * @internal\n */\n public _scheduled: TimerHandle | undefined;\n\n constructor(SchedulerAction: typeof Action, now: () => number = Scheduler.now) {\n super(SchedulerAction, now);\n }\n\n public flush(action: AsyncAction): void {\n const { actions } = this;\n\n if (this._active) {\n actions.push(action);\n return;\n }\n\n let error: any;\n this._active = true;\n\n do {\n if ((error = action.execute(action.state, action.delay))) {\n break;\n }\n } while ((action = actions.shift()!)); // exhaust the scheduler queue\n\n this._active = false;\n\n if (error) {\n while ((action = actions.shift()!)) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\n", "import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\n\n/**\n *\n * Async Scheduler\n *\n * Schedule task as if you used setTimeout(task, duration)\n *\n * `async` scheduler schedules tasks asynchronously, by putting them on the JavaScript\n * event loop queue. It is best used to delay tasks in time or to schedule tasks repeating\n * in intervals.\n *\n * If you just want to \"defer\" task, that is to perform it right after currently\n * executing synchronous code ends (commonly achieved by `setTimeout(deferredTask, 0)`),\n * better choice will be the {@link asapScheduler} scheduler.\n *\n * ## Examples\n * Use async scheduler to delay task\n * ```ts\n * import { asyncScheduler } from 'rxjs';\n *\n * const task = () => console.log('it works!');\n *\n * asyncScheduler.schedule(task, 2000);\n *\n * // After 2 seconds logs:\n * // \"it works!\"\n * ```\n *\n * Use async scheduler to repeat task in intervals\n * ```ts\n * import { asyncScheduler } from 'rxjs';\n *\n * function task(state) {\n * console.log(state);\n * this.schedule(state + 1, 1000); // `this` references currently executing Action,\n * // which we reschedule with new state and delay\n * }\n *\n * asyncScheduler.schedule(task, 3000, 0);\n *\n * // Logs:\n * // 0 after 3s\n * // 1 after 4s\n * // 2 after 5s\n * // 3 after 6s\n * ```\n */\n\nexport const asyncScheduler = new AsyncScheduler(AsyncAction);\n\n/**\n * @deprecated Renamed to {@link asyncScheduler}. Will be removed in v8.\n */\nexport const async = asyncScheduler;\n", "import { AsyncAction } from './AsyncAction';\nimport { Subscription } from '../Subscription';\nimport { QueueScheduler } from './QueueScheduler';\nimport { SchedulerAction } from '../types';\nimport { TimerHandle } from './timerHandle';\n\nexport class QueueAction extends AsyncAction {\n constructor(protected scheduler: QueueScheduler, protected work: (this: SchedulerAction, state?: T) => void) {\n super(scheduler, work);\n }\n\n public schedule(state?: T, delay: number = 0): Subscription {\n if (delay > 0) {\n return super.schedule(state, delay);\n }\n this.delay = delay;\n this.state = state;\n this.scheduler.flush(this);\n return this;\n }\n\n public execute(state: T, delay: number): any {\n return delay > 0 || this.closed ? super.execute(state, delay) : this._execute(state, delay);\n }\n\n protected requestAsyncId(scheduler: QueueScheduler, id?: TimerHandle, delay: number = 0): TimerHandle {\n // If delay exists and is greater than 0, or if the delay is null (the\n // action wasn't rescheduled) but was originally scheduled as an async\n // action, then recycle as an async action.\n\n if ((delay != null && delay > 0) || (delay == null && this.delay > 0)) {\n return super.requestAsyncId(scheduler, id, delay);\n }\n\n // Otherwise flush the scheduler starting with this action.\n scheduler.flush(this);\n\n // HACK: In the past, this was returning `void`. However, `void` isn't a valid\n // `TimerHandle`, and generally the return value here isn't really used. So the\n // compromise is to return `0` which is both \"falsy\" and a valid `TimerHandle`,\n // as opposed to refactoring every other instanceo of `requestAsyncId`.\n return 0;\n }\n}\n", "import { AsyncScheduler } from './AsyncScheduler';\n\nexport class QueueScheduler extends AsyncScheduler {\n}\n", "import { QueueAction } from './QueueAction';\nimport { QueueScheduler } from './QueueScheduler';\n\n/**\n *\n * Queue Scheduler\n *\n * Put every next task on a queue, instead of executing it immediately\n *\n * `queue` scheduler, when used with delay, behaves the same as {@link asyncScheduler} scheduler.\n *\n * When used without delay, it schedules given task synchronously - executes it right when\n * it is scheduled. However when called recursively, that is when inside the scheduled task,\n * another task is scheduled with queue scheduler, instead of executing immediately as well,\n * that task will be put on a queue and wait for current one to finish.\n *\n * This means that when you execute task with `queue` scheduler, you are sure it will end\n * before any other task scheduled with that scheduler will start.\n *\n * ## Examples\n * Schedule recursively first, then do something\n * ```ts\n * import { queueScheduler } from 'rxjs';\n *\n * queueScheduler.schedule(() => {\n * queueScheduler.schedule(() => console.log('second')); // will not happen now, but will be put on a queue\n *\n * console.log('first');\n * });\n *\n * // Logs:\n * // \"first\"\n * // \"second\"\n * ```\n *\n * Reschedule itself recursively\n * ```ts\n * import { queueScheduler } from 'rxjs';\n *\n * queueScheduler.schedule(function(state) {\n * if (state !== 0) {\n * console.log('before', state);\n * this.schedule(state - 1); // `this` references currently executing Action,\n * // which we reschedule with new state\n * console.log('after', state);\n * }\n * }, 0, 3);\n *\n * // In scheduler that runs recursively, you would expect:\n * // \"before\", 3\n * // \"before\", 2\n * // \"before\", 1\n * // \"after\", 1\n * // \"after\", 2\n * // \"after\", 3\n *\n * // But with queue it logs:\n * // \"before\", 3\n * // \"after\", 3\n * // \"before\", 2\n * // \"after\", 2\n * // \"before\", 1\n * // \"after\", 1\n * ```\n */\n\nexport const queueScheduler = new QueueScheduler(QueueAction);\n\n/**\n * @deprecated Renamed to {@link queueScheduler}. Will be removed in v8.\n */\nexport const queue = queueScheduler;\n", "import { AsyncAction } from './AsyncAction';\nimport { AnimationFrameScheduler } from './AnimationFrameScheduler';\nimport { SchedulerAction } from '../types';\nimport { animationFrameProvider } from './animationFrameProvider';\nimport { TimerHandle } from './timerHandle';\n\nexport class AnimationFrameAction extends AsyncAction {\n constructor(protected scheduler: AnimationFrameScheduler, protected work: (this: SchedulerAction, state?: T) => void) {\n super(scheduler, work);\n }\n\n protected requestAsyncId(scheduler: AnimationFrameScheduler, id?: TimerHandle, delay: number = 0): TimerHandle {\n // If delay is greater than 0, request as an async action.\n if (delay !== null && delay > 0) {\n return super.requestAsyncId(scheduler, id, delay);\n }\n // Push the action to the end of the scheduler queue.\n scheduler.actions.push(this);\n // If an animation frame has already been requested, don't request another\n // one. If an animation frame hasn't been requested yet, request one. Return\n // the current animation frame request id.\n return scheduler._scheduled || (scheduler._scheduled = animationFrameProvider.requestAnimationFrame(() => scheduler.flush(undefined)));\n }\n\n protected recycleAsyncId(scheduler: AnimationFrameScheduler, id?: TimerHandle, delay: number = 0): TimerHandle | undefined {\n // If delay exists and is greater than 0, or if the delay is null (the\n // action wasn't rescheduled) but was originally scheduled as an async\n // action, then recycle as an async action.\n if (delay != null ? delay > 0 : this.delay > 0) {\n return super.recycleAsyncId(scheduler, id, delay);\n }\n // If the scheduler queue has no remaining actions with the same async id,\n // cancel the requested animation frame and set the scheduled flag to\n // undefined so the next AnimationFrameAction will request its own.\n const { actions } = scheduler;\n if (id != null && id === scheduler._scheduled && actions[actions.length - 1]?.id !== id) {\n animationFrameProvider.cancelAnimationFrame(id as number);\n scheduler._scheduled = undefined;\n }\n // Return undefined so the action knows to request a new async id if it's rescheduled.\n return undefined;\n }\n}\n", "import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\n\nexport class AnimationFrameScheduler extends AsyncScheduler {\n public flush(action?: AsyncAction): void {\n this._active = true;\n // The async id that effects a call to flush is stored in _scheduled.\n // Before executing an action, it's necessary to check the action's async\n // id to determine whether it's supposed to be executed in the current\n // flush.\n // Previous implementations of this method used a count to determine this,\n // but that was unsound, as actions that are unsubscribed - i.e. cancelled -\n // are removed from the actions array and that can shift actions that are\n // scheduled to be executed in a subsequent flush into positions at which\n // they are executed within the current flush.\n let flushId;\n if (action) {\n flushId = action.id;\n } else {\n flushId = this._scheduled;\n this._scheduled = undefined;\n }\n\n const { actions } = this;\n let error: any;\n action = action || actions.shift()!;\n\n do {\n if ((error = action.execute(action.state, action.delay))) {\n break;\n }\n } while ((action = actions[0]) && action.id === flushId && actions.shift());\n\n this._active = false;\n\n if (error) {\n while ((action = actions[0]) && action.id === flushId && actions.shift()) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\n", "import { AnimationFrameAction } from './AnimationFrameAction';\nimport { AnimationFrameScheduler } from './AnimationFrameScheduler';\n\n/**\n *\n * Animation Frame Scheduler\n *\n * Perform task when `window.requestAnimationFrame` would fire\n *\n * When `animationFrame` scheduler is used with delay, it will fall back to {@link asyncScheduler} scheduler\n * behaviour.\n *\n * Without delay, `animationFrame` scheduler can be used to create smooth browser animations.\n * It makes sure scheduled task will happen just before next browser content repaint,\n * thus performing animations as efficiently as possible.\n *\n * ## Example\n * Schedule div height animation\n * ```ts\n * // html:
\n * import { animationFrameScheduler } from 'rxjs';\n *\n * const div = document.querySelector('div');\n *\n * animationFrameScheduler.schedule(function(height) {\n * div.style.height = height + \"px\";\n *\n * this.schedule(height + 1); // `this` references currently executing Action,\n * // which we reschedule with new state\n * }, 0, 0);\n *\n * // You will see a div element growing in height\n * ```\n */\n\nexport const animationFrameScheduler = new AnimationFrameScheduler(AnimationFrameAction);\n\n/**\n * @deprecated Renamed to {@link animationFrameScheduler}. Will be removed in v8.\n */\nexport const animationFrame = animationFrameScheduler;\n", "import { Observable } from '../Observable';\nimport { SchedulerLike } from '../types';\n\n/**\n * A simple Observable that emits no items to the Observer and immediately\n * emits a complete notification.\n *\n * Just emits 'complete', and nothing else.\n *\n * ![](empty.png)\n *\n * A simple Observable that only emits the complete notification. It can be used\n * for composing with other Observables, such as in a {@link mergeMap}.\n *\n * ## Examples\n *\n * Log complete notification\n *\n * ```ts\n * import { EMPTY } from 'rxjs';\n *\n * EMPTY.subscribe({\n * next: () => console.log('Next'),\n * complete: () => console.log('Complete!')\n * });\n *\n * // Outputs\n * // Complete!\n * ```\n *\n * Emit the number 7, then complete\n *\n * ```ts\n * import { EMPTY, startWith } from 'rxjs';\n *\n * const result = EMPTY.pipe(startWith(7));\n * result.subscribe(x => console.log(x));\n *\n * // Outputs\n * // 7\n * ```\n *\n * Map and flatten only odd numbers to the sequence `'a'`, `'b'`, `'c'`\n *\n * ```ts\n * import { interval, mergeMap, of, EMPTY } from 'rxjs';\n *\n * const interval$ = interval(1000);\n * const result = interval$.pipe(\n * mergeMap(x => x % 2 === 1 ? of('a', 'b', 'c') : EMPTY),\n * );\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following to the console:\n * // x is equal to the count on the interval, e.g. (0, 1, 2, 3, ...)\n * // x will occur every 1000ms\n * // if x % 2 is equal to 1, print a, b, c (each on its own)\n * // if x % 2 is not equal to 1, nothing will be output\n * ```\n *\n * @see {@link Observable}\n * @see {@link NEVER}\n * @see {@link of}\n * @see {@link throwError}\n */\nexport const EMPTY = new Observable((subscriber) => subscriber.complete());\n\n/**\n * @param scheduler A {@link SchedulerLike} to use for scheduling\n * the emission of the complete notification.\n * @deprecated Replaced with the {@link EMPTY} constant or {@link scheduled} (e.g. `scheduled([], scheduler)`). Will be removed in v8.\n */\nexport function empty(scheduler?: SchedulerLike) {\n return scheduler ? emptyScheduled(scheduler) : EMPTY;\n}\n\nfunction emptyScheduled(scheduler: SchedulerLike) {\n return new Observable((subscriber) => scheduler.schedule(() => subscriber.complete()));\n}\n", "import { SchedulerLike } from '../types';\nimport { isFunction } from './isFunction';\n\nexport function isScheduler(value: any): value is SchedulerLike {\n return value && isFunction(value.schedule);\n}\n", "import { SchedulerLike } from '../types';\nimport { isFunction } from './isFunction';\nimport { isScheduler } from './isScheduler';\n\nfunction last(arr: T[]): T | undefined {\n return arr[arr.length - 1];\n}\n\nexport function popResultSelector(args: any[]): ((...args: unknown[]) => unknown) | undefined {\n return isFunction(last(args)) ? args.pop() : undefined;\n}\n\nexport function popScheduler(args: any[]): SchedulerLike | undefined {\n return isScheduler(last(args)) ? args.pop() : undefined;\n}\n\nexport function popNumber(args: any[], defaultValue: number): number {\n return typeof last(args) === 'number' ? args.pop()! : defaultValue;\n}\n", "export const isArrayLike = ((x: any): x is ArrayLike => x && typeof x.length === 'number' && typeof x !== 'function');", "import { isFunction } from \"./isFunction\";\n\n/**\n * Tests to see if the object is \"thennable\".\n * @param value the object to test\n */\nexport function isPromise(value: any): value is PromiseLike {\n return isFunction(value?.then);\n}\n", "import { InteropObservable } from '../types';\nimport { observable as Symbol_observable } from '../symbol/observable';\nimport { isFunction } from './isFunction';\n\n/** Identifies an input as being Observable (but not necessary an Rx Observable) */\nexport function isInteropObservable(input: any): input is InteropObservable {\n return isFunction(input[Symbol_observable]);\n}\n", "import { isFunction } from './isFunction';\n\nexport function isAsyncIterable(obj: any): obj is AsyncIterable {\n return Symbol.asyncIterator && isFunction(obj?.[Symbol.asyncIterator]);\n}\n", "/**\n * Creates the TypeError to throw if an invalid object is passed to `from` or `scheduled`.\n * @param input The object that was passed.\n */\nexport function createInvalidObservableTypeError(input: any) {\n // TODO: We should create error codes that can be looked up, so this can be less verbose.\n return new TypeError(\n `You provided ${\n input !== null && typeof input === 'object' ? 'an invalid object' : `'${input}'`\n } where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`\n );\n}\n", "export function getSymbolIterator(): symbol {\n if (typeof Symbol !== 'function' || !Symbol.iterator) {\n return '@@iterator' as any;\n }\n\n return Symbol.iterator;\n}\n\nexport const iterator = getSymbolIterator();\n", "import { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { isFunction } from './isFunction';\n\n/** Identifies an input as being an Iterable */\nexport function isIterable(input: any): input is Iterable {\n return isFunction(input?.[Symbol_iterator]);\n}\n", "import { ReadableStreamLike } from '../types';\nimport { isFunction } from './isFunction';\n\nexport async function* readableStreamLikeToAsyncGenerator(readableStream: ReadableStreamLike): AsyncGenerator {\n const reader = readableStream.getReader();\n try {\n while (true) {\n const { value, done } = await reader.read();\n if (done) {\n return;\n }\n yield value!;\n }\n } finally {\n reader.releaseLock();\n }\n}\n\nexport function isReadableStreamLike(obj: any): obj is ReadableStreamLike {\n // We don't want to use instanceof checks because they would return\n // false for instances from another Realm, like an