Deployed 8b2613da to HEAD with MkDocs 1.6.1 and mike 2.1.3
This commit is contained in:
1 parent
7c3f9f4e99
commit
361de6a579
8 files changed
+124
-13
No files matched your search
@@ -2399,7 +2399,7 @@ You're not viewing the latest version.
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 20a8 8 0 0 0 8-8 8 8 0 0 0-8-8 8 8 0 0 0-8 8 8 8 0 0 0 8 8m0-18a10 10 0 0 1 10 10 10 10 0 0 1-10 10C6.47 22 2 17.5 2 12A10 10 0 0 1 12 2m.5 5v5.25l4.5 2.67-.75 1.23L11 13V7z"/></svg>
|
||||
<span class="md-ellipsis">
|
||||
|
||||
6 min read
|
||||
7 min read
|
||||
|
||||
</span>
|
||||
</div>
|
||||
@@ -2461,6 +2461,39 @@ You're not viewing the latest version.
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#arithmetic" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
Arithmetic
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<nav class="md-nav" aria-label="Arithmetic">
|
||||
<ul class="md-nav__list">
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#addition" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
Addition
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#subtraction" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
Subtraction
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
@@ -2678,11 +2711,11 @@ will not need any specifier to denote them.</p>
|
||||
<p>For example:</p>
|
||||
<div class="language-cpp highlight"><pre><span></span><code><span id="__span-1-1"><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a><span class="kr">inline</span><span class="w"> </span><span class="k">constexpr</span><span class="w"> </span><span class="k">struct</span><span class="w"> </span><span class="nc">tare</span><span class="w"> </span><span class="k">final</span><span class="w"> </span><span class="o">:</span><span class="w"> </span><span class="n">relative_point_origin</span><span class="o"><</span><span class="n">quantity_point</span><span class="p">{</span><span class="mi">2</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">kg</span><span class="p">}</span><span class="o">></span><span class="w"> </span><span class="p">{}</span><span class="w"> </span><span class="n">tare</span><span class="p">;</span>
|
||||
</span><span id="__span-1-2"><a id="__codelineno-1-2" name="__codelineno-1-2" href="#__codelineno-1-2"></a>
|
||||
</span><span id="__span-1-3"><a id="__codelineno-1-3" name="__codelineno-1-3" href="#__codelineno-1-3"></a><span class="n">quantity</span><span class="o"><</span><span class="n">point</span><span class="o"><</span><span class="n">isq</span><span class="o">::</span><span class="n">mass</span><span class="o">>></span><span class="w"> </span><span class="n">m1</span><span class="p">(</span><span class="mi">10</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">kg</span><span class="p">);</span><span class="w"> </span><span class="c1">// point quantity with an implicit point origin</span>
|
||||
</span><span id="__span-1-4"><a id="__codelineno-1-4" name="__codelineno-1-4" href="#__codelineno-1-4"></a><span class="n">quantity</span><span class="o"><</span><span class="n">point</span><span class="o"><</span><span class="n">isq</span><span class="o">::</span><span class="n">mass</span><span class="o">>></span><span class="w"> </span><span class="n">m2</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">tare</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="mi">8</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">kg</span><span class="p">;</span><span class="w"> </span><span class="c1">// point quantity with an explicit relative point origin</span>
|
||||
</span><span id="__span-1-5"><a id="__codelineno-1-5" name="__codelineno-1-5" href="#__codelineno-1-5"></a><span class="n">quantity</span><span class="o"><</span><span class="n">isq</span><span class="o">::</span><span class="n">mass</span><span class="o">></span><span class="w"> </span><span class="n">m3</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">15</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">kg</span><span class="p">;</span><span class="w"> </span><span class="c1">// absolute quantity (e.g., non-negative)</span>
|
||||
</span><span id="__span-1-6"><a id="__codelineno-1-6" name="__codelineno-1-6" href="#__codelineno-1-6"></a><span class="n">quantity</span><span class="o"><</span><span class="n">delta</span><span class="o"><</span><span class="n">isq</span><span class="o">::</span><span class="n">mass</span><span class="o">>></span><span class="w"> </span><span class="n">m13</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">m1</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">m3</span><span class="p">;</span><span class="w"> </span><span class="c1">// delta quantity (e.g., may be negative)</span>
|
||||
</span><span id="__span-1-7"><a id="__codelineno-1-7" name="__codelineno-1-7" href="#__codelineno-1-7"></a><span class="n">quantity</span><span class="o"><</span><span class="n">delta</span><span class="o"><</span><span class="n">isq</span><span class="o">::</span><span class="n">mass</span><span class="o">>></span><span class="w"> </span><span class="n">m23</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">m2</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">m3</span><span class="p">;</span><span class="w"> </span><span class="c1">// delta quantity (e.g., may be negative)</span>
|
||||
</span><span id="__span-1-3"><a id="__codelineno-1-3" name="__codelineno-1-3" href="#__codelineno-1-3"></a><span class="n">quantity</span><span class="o"><</span><span class="n">point</span><span class="o"><</span><span class="n">isq</span><span class="o">::</span><span class="n">mass</span><span class="o">>></span><span class="w"> </span><span class="n">m1</span><span class="p">(</span><span class="mi">10</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">kg</span><span class="p">);</span><span class="w"> </span><span class="c1">// point quantity with an implicit point origin</span>
|
||||
</span><span id="__span-1-4"><a id="__codelineno-1-4" name="__codelineno-1-4" href="#__codelineno-1-4"></a><span class="n">quantity</span><span class="o"><</span><span class="n">point</span><span class="o"><</span><span class="n">isq</span><span class="o">::</span><span class="n">mass</span><span class="p">,</span><span class="w"> </span><span class="n">tare</span><span class="o">>></span><span class="w"> </span><span class="n">m2</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">tare</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="mi">8</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">kg</span><span class="p">;</span><span class="w"> </span><span class="c1">// point quantity with an explicit relative point origin</span>
|
||||
</span><span id="__span-1-5"><a id="__codelineno-1-5" name="__codelineno-1-5" href="#__codelineno-1-5"></a><span class="n">quantity</span><span class="o"><</span><span class="n">isq</span><span class="o">::</span><span class="n">mass</span><span class="o">></span><span class="w"> </span><span class="n">m3</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">15</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">kg</span><span class="p">;</span><span class="w"> </span><span class="c1">// absolute quantity (e.g., non-negative)</span>
|
||||
</span><span id="__span-1-6"><a id="__codelineno-1-6" name="__codelineno-1-6" href="#__codelineno-1-6"></a><span class="n">quantity</span><span class="o"><</span><span class="n">delta</span><span class="o"><</span><span class="n">isq</span><span class="o">::</span><span class="n">mass</span><span class="o">>></span><span class="w"> </span><span class="n">m13</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">m1</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">m3</span><span class="p">;</span><span class="w"> </span><span class="c1">// delta quantity (e.g., may be negative)</span>
|
||||
</span><span id="__span-1-7"><a id="__codelineno-1-7" name="__codelineno-1-7" href="#__codelineno-1-7"></a><span class="n">quantity</span><span class="o"><</span><span class="n">delta</span><span class="o"><</span><span class="n">isq</span><span class="o">::</span><span class="n">mass</span><span class="o">>></span><span class="w"> </span><span class="n">m23</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">m2</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">m3</span><span class="p">;</span><span class="w"> </span><span class="c1">// delta quantity (e.g., may be negative)</span>
|
||||
</span></code></pre></div>
|
||||
<p>With the above, the initial example may be refactored to:</p>
|
||||
<div class="language-cpp highlight"><pre><span></span><code><span id="__span-2-1"><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a><span class="n">quantity</span><span class="w"> </span><span class="n">m1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">2</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">kg</span><span class="p">;</span>
|
||||
@@ -2695,6 +2728,84 @@ will not need any specifier to denote them.</p>
|
||||
</span><span id="__span-2-8"><a id="__codelineno-2-8" name="__codelineno-2-8" href="#__codelineno-2-8"></a><span class="n">std</span><span class="o">::</span><span class="n">cout</span><span class="w"> </span><span class="o"><<</span><span class="w"> </span><span class="s">"Velocity: "</span><span class="w"> </span><span class="o"><<</span><span class="w"> </span><span class="n">d_v</span><span class="w"> </span><span class="o"><<</span><span class="w"> </span><span class="s">"</span><span class="se">\n</span><span class="s">"</span><span class="p">;</span>
|
||||
</span><span id="__span-2-9"><a id="__codelineno-2-9" name="__codelineno-2-9" href="#__codelineno-2-9"></a><span class="n">std</span><span class="o">::</span><span class="n">cout</span><span class="w"> </span><span class="o"><<</span><span class="w"> </span><span class="s">"Kinetic energy: "</span><span class="w"> </span><span class="o"><<</span><span class="w"> </span><span class="n">E_k</span><span class="p">.</span><span class="n">in</span><span class="o"><</span><span class="kt">double</span><span class="o">></span><span class="p">(</span><span class="n">J</span><span class="p">)</span><span class="w"> </span><span class="o"><<</span><span class="w"> </span><span class="s">"</span><span class="se">\n</span><span class="s">"</span><span class="p">;</span>
|
||||
</span></code></pre></div>
|
||||
<h2 id="arithmetic">Arithmetic<a class="headerlink" href="#arithmetic" title="Permanent link">¶</a></h2>
|
||||
<p>Affine space arithmetic is well-defined. However, we are adding a new type to the library
|
||||
that lands between points and deltas. This is why we must agree on the arithmetic for all
|
||||
possible combinations.</p>
|
||||
<p>Let's try to define them here, assuming that points and absolute values share
|
||||
a common origin.</p>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">Note</p>
|
||||
<p>If points and absolute values do not share a common absolute point origin
|
||||
the operation should fail to compile.</p>
|
||||
</div>
|
||||
<h3 id="addition">Addition<a class="headerlink" href="#addition" title="Permanent link">¶</a></h3>
|
||||
<p>In case of addition, a more constrained type is preserved (except for adding two points,
|
||||
which is undefined):</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Lhs \ Rhs</th>
|
||||
<th style="text-align: center;">Point</th>
|
||||
<th style="text-align: center;">Absolute</th>
|
||||
<th style="text-align: center;">Delta</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><strong>Point</strong></td>
|
||||
<td style="text-align: center;"><span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 6.91 17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12z"/></svg></span></td>
|
||||
<td style="text-align: center;">Point</td>
|
||||
<td style="text-align: center;">Point</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Absolute</strong></td>
|
||||
<td style="text-align: center;">Point</td>
|
||||
<td style="text-align: center;">Absolute</td>
|
||||
<td style="text-align: center;">Absolute</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Delta</strong></td>
|
||||
<td style="text-align: center;">Point</td>
|
||||
<td style="text-align: center;">Absolute</td>
|
||||
<td style="text-align: center;">Delta</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 id="subtraction">Subtraction<a class="headerlink" href="#subtraction" title="Permanent link">¶</a></h3>
|
||||
<p>Subtraction is more tricky. To verify the logic below, it might be helpful to ask whether
|
||||
a result may be negative when two arguments are non-negative. If the answer is true,
|
||||
the result should be a delta quantity.</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Lhs \ Rhs</th>
|
||||
<th style="text-align: center;">Point</th>
|
||||
<th style="text-align: center;">Absolute</th>
|
||||
<th style="text-align: center;">Delta</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><strong>Point</strong></td>
|
||||
<td style="text-align: center;">Delta</td>
|
||||
<td style="text-align: center;">Point</td>
|
||||
<td style="text-align: center;">Point</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Absolute</strong></td>
|
||||
<td style="text-align: center;">Delta</td>
|
||||
<td style="text-align: center;">Delta</td>
|
||||
<td style="text-align: center;">Absolute</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Delta</strong></td>
|
||||
<td style="text-align: center;"><span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 6.91 17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12z"/></svg></span></td>
|
||||
<td style="text-align: center;">Delta</td>
|
||||
<td style="text-align: center;">Delta</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h2 id="new-opportunities">New opportunities<a class="headerlink" href="#new-opportunities" title="Permanent link">¶</a></h2>
|
||||
<p>The new syntax simplifies API as one <code>quantity</code> class template will now serve all quantity
|
||||
variations (possibly even more in the future). It also allows us to model quantities that
|
||||
|
||||
@@ -2375,7 +2375,7 @@ You're not viewing the latest version.
|
||||
|
||||
<li class="md-meta__item">
|
||||
|
||||
6 min read
|
||||
7 min read
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
@@ -2375,7 +2375,7 @@ You're not viewing the latest version.
|
||||
|
||||
<li class="md-meta__item">
|
||||
|
||||
6 min read
|
||||
7 min read
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
@@ -2361,7 +2361,7 @@ You're not viewing the latest version.
|
||||
|
||||
<li class="md-meta__item">
|
||||
|
||||
6 min read
|
||||
7 min read
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version": "https://jsonfeed.org/version/1", "title": "mp-units", "home_page_url": "https://mpusz.github.io/mp-units/HEAD/", "feed_url": "https://mpusz.github.io/mp-units/HEAD/feed_json_updated.json", "description": "The quantities and units library for C++", "icon": null, "authors": [{"name": "mp-units Team"}], "language": "en", "items": [{"id": "https://mpusz.github.io/mp-units/HEAD/blog/2025/06/16/introducing-absolute-quantities/", "url": "https://mpusz.github.io/mp-units/HEAD/blog/2025/06/16/introducing-absolute-quantities/", "title": "Introducing absolute quantities", "content_html": "<h1>Introducing absolute quantities</h1>\n<p>This post introduces a new abstraction called an absolute quantity. It complements affine\nspace abstractions (point and delta) and will most probably be a new default in the library\nwhen we release V3.</p>", "image": "https://mpusz.github.io/mp-units/HEADassets/images/social/blog/posts/introducing-absolute-quantities.png", "date_modified": "2025-06-17T06:34:55+00:00", "authors": [{"name": "Mateusz Pusz"}], "tags": ["Metrology"]}, {"id": "https://mpusz.github.io/mp-units/HEAD/blog/2025/01/15/bringing-quantity-safety-to-the-next-level/", "url": "https://mpusz.github.io/mp-units/HEAD/blog/2025/01/15/bringing-quantity-safety-to-the-next-level/", "title": "Bringing Quantity-Safety To The Next Level", "content_html": "<h1>Bringing Quantity-Safety To The Next Level</h1>\n<p>All quantities and units libraries need to be unit-safe. Most of the libraries on the market do\nthis correctly. Some of them are also dimension-safe, which adds another level of protection for\ntheir users.</p>\n<p><strong>mp-units</strong> is probably the only library on the market that additionally is quantity-safe. This\ngives a new quality and possibilities. I've described the major idea behind it, implementation\ndetails, and benefits to the users in the <a href=\"isq-part-5-benefits.md\">series of posts about the International System of Quantities</a>.</p>\n<p>However, this is only the beginning. We've always planned more and worked on the extensions in our\nfree time. In this post, I will describe:</p>\n<ul>\n<li>What a quantity character is?</li>\n<li>The importance of using proper representation types for the quantities.</li>\n<li>The power of providing character-specific operations for the quantities.</li>\n<li>Discuss implementation challenges and possible solutions.</li>\n</ul>", "image": "https://mpusz.github.io/mp-units/HEADassets/images/social/blog/posts/bringing-quantity-safety-to-the-next-level.png", "date_modified": "2025-02-11T16:26:19+00:00", "authors": [{"name": "Mateusz Pusz"}], "tags": ["Metrology"]}, {"id": "https://mpusz.github.io/mp-units/HEAD/blog/2024/10/28/international-system-of-quantities-isq-part-4---implementing-isq/", "url": "https://mpusz.github.io/mp-units/HEAD/blog/2024/10/28/international-system-of-quantities-isq-part-4---implementing-isq/", "title": "International System of Quantities (ISQ): Part 4 - Implementing ISQ", "content_html": "<h1>International System of Quantities (ISQ): Part 4 - Implementing ISQ</h1>\n<p>Up until now, we have introduced the International System of Quantities and described how we can\nmodel its main aspects. This article will present how to implement those models in a programming\nlanguage, and we will point out some of the first issues that stand in our way.</p>", "image": "https://mpusz.github.io/mp-units/HEADassets/images/social/blog/posts/isq-part-4-implemeting-isq.png", "date_modified": "2025-02-11T16:26:19+00:00", "authors": [{"name": "Mateusz Pusz"}], "tags": ["Metrology"]}, {"id": "https://mpusz.github.io/mp-units/HEAD/blog/2024/11/11/international-system-of-quantities-isq-part-6---challenges/", "url": "https://mpusz.github.io/mp-units/HEAD/blog/2024/11/11/international-system-of-quantities-isq-part-6---challenges/", "title": "International System of Quantities (ISQ): Part 6 - Challenges", "content_html": "<h1>International System of Quantities (ISQ): Part 6 - Challenges</h1>\n<p>This article might be the last one from our series. This time, we will discuss the challenges and\nissues with modeling of the ISQ in software.</p>", "image": "https://mpusz.github.io/mp-units/HEADassets/images/social/blog/posts/isq-part-6-challenges.png", "date_modified": "2025-02-11T16:26:19+00:00", "authors": [{"name": "Mateusz Pusz"}], "tags": ["Metrology"]}, {"id": "https://mpusz.github.io/mp-units/HEAD/blog/2024/11/25/report-from-the-wroc%C5%82aw-2024-iso-c-committee-meeting/", "url": "https://mpusz.github.io/mp-units/HEAD/blog/2024/11/25/report-from-the-wroc%C5%82aw-2024-iso-c-committee-meeting/", "title": "Report from the Wroc\u0142aw 2024 ISO C++ Committee meeting", "content_html": "<h1>Report from the Wroc\u0142aw 2024 ISO C++ Committee meeting</h1>\n<p>The Wroc\u0142aw 2024 meeting was another efficient step in the standardization of this library.\nWe've spent the entire day on the joint LEWGI and SG6 discussion and got lots of feedback.\nWe've also iLine truncated
|
||||
{"version": "https://jsonfeed.org/version/1", "title": "mp-units", "home_page_url": "https://mpusz.github.io/mp-units/HEAD/", "feed_url": "https://mpusz.github.io/mp-units/HEAD/feed_json_updated.json", "description": "The quantities and units library for C++", "icon": null, "authors": [{"name": "mp-units Team"}], "language": "en", "items": [{"id": "https://mpusz.github.io/mp-units/HEAD/blog/2025/06/16/introducing-absolute-quantities/", "url": "https://mpusz.github.io/mp-units/HEAD/blog/2025/06/16/introducing-absolute-quantities/", "title": "Introducing absolute quantities", "content_html": "<h1>Introducing absolute quantities</h1>\n<p>This post introduces a new abstraction called an absolute quantity. It complements affine\nspace abstractions (point and delta) and will most probably be a new default in the library\nwhen we release V3.</p>", "image": "https://mpusz.github.io/mp-units/HEADassets/images/social/blog/posts/introducing-absolute-quantities.png", "date_modified": "2025-06-17T08:09:11+00:00", "authors": [{"name": "Mateusz Pusz"}], "tags": ["Metrology"]}, {"id": "https://mpusz.github.io/mp-units/HEAD/blog/2025/01/15/bringing-quantity-safety-to-the-next-level/", "url": "https://mpusz.github.io/mp-units/HEAD/blog/2025/01/15/bringing-quantity-safety-to-the-next-level/", "title": "Bringing Quantity-Safety To The Next Level", "content_html": "<h1>Bringing Quantity-Safety To The Next Level</h1>\n<p>All quantities and units libraries need to be unit-safe. Most of the libraries on the market do\nthis correctly. Some of them are also dimension-safe, which adds another level of protection for\ntheir users.</p>\n<p><strong>mp-units</strong> is probably the only library on the market that additionally is quantity-safe. This\ngives a new quality and possibilities. I've described the major idea behind it, implementation\ndetails, and benefits to the users in the <a href=\"isq-part-5-benefits.md\">series of posts about the International System of Quantities</a>.</p>\n<p>However, this is only the beginning. We've always planned more and worked on the extensions in our\nfree time. In this post, I will describe:</p>\n<ul>\n<li>What a quantity character is?</li>\n<li>The importance of using proper representation types for the quantities.</li>\n<li>The power of providing character-specific operations for the quantities.</li>\n<li>Discuss implementation challenges and possible solutions.</li>\n</ul>", "image": "https://mpusz.github.io/mp-units/HEADassets/images/social/blog/posts/bringing-quantity-safety-to-the-next-level.png", "date_modified": "2025-02-11T16:26:19+00:00", "authors": [{"name": "Mateusz Pusz"}], "tags": ["Metrology"]}, {"id": "https://mpusz.github.io/mp-units/HEAD/blog/2024/10/28/international-system-of-quantities-isq-part-4---implementing-isq/", "url": "https://mpusz.github.io/mp-units/HEAD/blog/2024/10/28/international-system-of-quantities-isq-part-4---implementing-isq/", "title": "International System of Quantities (ISQ): Part 4 - Implementing ISQ", "content_html": "<h1>International System of Quantities (ISQ): Part 4 - Implementing ISQ</h1>\n<p>Up until now, we have introduced the International System of Quantities and described how we can\nmodel its main aspects. This article will present how to implement those models in a programming\nlanguage, and we will point out some of the first issues that stand in our way.</p>", "image": "https://mpusz.github.io/mp-units/HEADassets/images/social/blog/posts/isq-part-4-implemeting-isq.png", "date_modified": "2025-02-11T16:26:19+00:00", "authors": [{"name": "Mateusz Pusz"}], "tags": ["Metrology"]}, {"id": "https://mpusz.github.io/mp-units/HEAD/blog/2024/11/11/international-system-of-quantities-isq-part-6---challenges/", "url": "https://mpusz.github.io/mp-units/HEAD/blog/2024/11/11/international-system-of-quantities-isq-part-6---challenges/", "title": "International System of Quantities (ISQ): Part 6 - Challenges", "content_html": "<h1>International System of Quantities (ISQ): Part 6 - Challenges</h1>\n<p>This article might be the last one from our series. This time, we will discuss the challenges and\nissues with modeling of the ISQ in software.</p>", "image": "https://mpusz.github.io/mp-units/HEADassets/images/social/blog/posts/isq-part-6-challenges.png", "date_modified": "2025-02-11T16:26:19+00:00", "authors": [{"name": "Mateusz Pusz"}], "tags": ["Metrology"]}, {"id": "https://mpusz.github.io/mp-units/HEAD/blog/2024/11/25/report-from-the-wroc%C5%82aw-2024-iso-c-committee-meeting/", "url": "https://mpusz.github.io/mp-units/HEAD/blog/2024/11/25/report-from-the-wroc%C5%82aw-2024-iso-c-committee-meeting/", "title": "Report from the Wroc\u0142aw 2024 ISO C++ Committee meeting", "content_html": "<h1>Report from the Wroc\u0142aw 2024 ISO C++ Committee meeting</h1>\n<p>The Wroc\u0142aw 2024 meeting was another efficient step in the standardization of this library.\nWe've spent the entire day on the joint LEWGI and SG6 discussion and got lots of feedback.\nWe've also iLine truncated
|
||||
@@ -1 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"> <channel><title>mp-units</title><description>The quantities and units library for C++</description><link>https://mpusz.github.io/mp-units/HEAD/</link><atom:link href="https://mpusz.github.io/mp-units/HEAD/feed_rss_created.xml" rel="self" type="application/rss+xml" /><managingEditor>mp-units Team</managingEditor><docs>https://github.com/mpusz/mp-units</docs><language>en</language> <pubDate>Tue, 17 Jun 2025 06:39:05 -0000</pubDate> <lastBuildDate>Tue, 17 Jun 2025 06:39:05 -0000</lastBuildDate> <ttl>1440</ttl> <generator>MkDocs RSS plugin - v1.17.3</generator> <image> <url>None</url> <title>mp-units</title><link>https://mpusz.github.io/mp-units/HEAD/</link> </image> <item> <title>Introducing absolute quantities</title> <author>Mateusz Pusz</author> <category>Metrology</category> <description><h1>Introducing absolute quantities</h1><p>This post introduces a new abstraction called an absolute quantity. It complements affinespace abstractions (point and delta) and will most probably be a new default in the librarywhen we release V3.</p></description><link>https://mpusz.github.io/mp-units/HEAD/blog/2025/06/16/introducing-absolute-quantities/</link> <pubDate>Mon, 16 Jun 2025 00:00:00 +0000</pubDate><source url="https://mpusz.github.io/mp-units/HEAD/feed_rss_created.xml">mp-units</source><guid isPermaLink="true">https://mpusz.github.io/mp-units/HEAD/blog/2025/06/16/introducing-absolute-quantities/</guid> <enclosure url="https://mpusz.github.io/mp-units/HEADassets/images/social/blog/posts/introducing-absolute-quantities.png" type="image/png" length="39574" /> </item> <item> <title>Bringing Quantity-Safety To The Next Level</title> <author>Mateusz Pusz</author> <category>Metrology</category> <description><h1>Bringing Quantity-Safety To The Next Level</h1><p>All quantities and units libraries need to be unit-safe. Most of the libraries on the market dothis correctly. Some of them are also dimension-safe, which adds another level of protection fortheir users.</p><p><strong>mp-units</strong> is probably the only library on the market that additionally is quantity-safe. Thisgives a new quality and possibilities. I've described the major idea behind it, implementationdetails, and benefits to the users in the <a href="isq-part-5-benefits.md">series of posts about the International System of Quantities</a>.</p><p>However, this is only the beginning. We've always planned more and worked on the extensions in ourfree time. In this post, I will describe:</p><ul><li>What a quantity character is?</li><li>The importance of using proper representation types for the quantities.</li><li>The power of providing character-specific operations for the quantities.</li><li>Discuss implementation challenges and possible solutions.</li></ul></description><link>https://mpusz.github.io/mp-units/HEAD/blog/2025/01/15/bringing-quantity-safety-to-the-next-level/</link> <pubDate>Wed, 15 Jan 2025 00:00:00 +0000</pubDate><source url="https://mpusz.github.io/mp-units/HEAD/feed_rss_created.xml">mp-units</source><guid isPermaLink="true">https://mpusz.github.io/mp-units/HEAD/blog/2025/01/15/bringing-quantity-safety-to-the-next-level/</guid> <enclosure url="https://mpusz.github.io/mp-units/HEADassets/images/social/blog/posts/bringing-quantity-safety-to-the-next-level.png" type="image/png" length="45128" /> </item> <item> <title>Report from the Wrocław 2024 ISO C++ Committee meeting</title> <author>Mateusz Pusz</author> <category>WG21 Updates</category> <description><h1>Report from the Wrocław 2024 ISO C++ Committee meeting</h1><p>The Wrocław 2024 meeting was another efficient step in the standardization of this library.We've spent the entire day on the joint LEWGI and SG6 discussion and got lots of feedback.We've also introduced <code>std::fixed_string</code> to LEWG for C++26.</p></description><link>https://mpusz.github.io/mp-units/HEAD/blog/2024/11/25/report-from-the-wroc%C5%82aw-2024-iso-c-committee-meeting/</link> <pubDate>Mon, 25 Nov 2024 00:00:00 +0000</pubDate><source url="https://mpusz.github.io/mp-units/HEAD/feed_rss_created.xml">mp-units</source><guid isPermaLink="true">https://mpusz.github.io/mp-units/HEAD/blog/2024/11/25/report-from-the-wroc%C5%82aw-2024-iso-c-committee-meeting/</guid> <enclosure url="https://mpusz.github.io/mp-units/HEADassets/images/social/blog/posts/wrocław-2024-report.png" type="image/png" length="53358" /> </item> <item> <title>International System of Quantities (ISQ): Part 6 - Challenges</title> <author>Mateusz Pusz</author> <category>Metrology</category> <description><h1>International System of Quantities (ISQ): Part 6 - Challenges</h1><p>This arLine truncated
|
||||
<?xml version="1.0" encoding="UTF-8" ?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"> <channel><title>mp-units</title><description>The quantities and units library for C++</description><link>https://mpusz.github.io/mp-units/HEAD/</link><atom:link href="https://mpusz.github.io/mp-units/HEAD/feed_rss_created.xml" rel="self" type="application/rss+xml" /><managingEditor>mp-units Team</managingEditor><docs>https://github.com/mpusz/mp-units</docs><language>en</language> <pubDate>Tue, 17 Jun 2025 08:13:50 -0000</pubDate> <lastBuildDate>Tue, 17 Jun 2025 08:13:50 -0000</lastBuildDate> <ttl>1440</ttl> <generator>MkDocs RSS plugin - v1.17.3</generator> <image> <url>None</url> <title>mp-units</title><link>https://mpusz.github.io/mp-units/HEAD/</link> </image> <item> <title>Introducing absolute quantities</title> <author>Mateusz Pusz</author> <category>Metrology</category> <description><h1>Introducing absolute quantities</h1><p>This post introduces a new abstraction called an absolute quantity. It complements affinespace abstractions (point and delta) and will most probably be a new default in the librarywhen we release V3.</p></description><link>https://mpusz.github.io/mp-units/HEAD/blog/2025/06/16/introducing-absolute-quantities/</link> <pubDate>Mon, 16 Jun 2025 00:00:00 +0000</pubDate><source url="https://mpusz.github.io/mp-units/HEAD/feed_rss_created.xml">mp-units</source><guid isPermaLink="true">https://mpusz.github.io/mp-units/HEAD/blog/2025/06/16/introducing-absolute-quantities/</guid> <enclosure url="https://mpusz.github.io/mp-units/HEADassets/images/social/blog/posts/introducing-absolute-quantities.png" type="image/png" length="39574" /> </item> <item> <title>Bringing Quantity-Safety To The Next Level</title> <author>Mateusz Pusz</author> <category>Metrology</category> <description><h1>Bringing Quantity-Safety To The Next Level</h1><p>All quantities and units libraries need to be unit-safe. Most of the libraries on the market dothis correctly. Some of them are also dimension-safe, which adds another level of protection fortheir users.</p><p><strong>mp-units</strong> is probably the only library on the market that additionally is quantity-safe. Thisgives a new quality and possibilities. I've described the major idea behind it, implementationdetails, and benefits to the users in the <a href="isq-part-5-benefits.md">series of posts about the International System of Quantities</a>.</p><p>However, this is only the beginning. We've always planned more and worked on the extensions in ourfree time. In this post, I will describe:</p><ul><li>What a quantity character is?</li><li>The importance of using proper representation types for the quantities.</li><li>The power of providing character-specific operations for the quantities.</li><li>Discuss implementation challenges and possible solutions.</li></ul></description><link>https://mpusz.github.io/mp-units/HEAD/blog/2025/01/15/bringing-quantity-safety-to-the-next-level/</link> <pubDate>Wed, 15 Jan 2025 00:00:00 +0000</pubDate><source url="https://mpusz.github.io/mp-units/HEAD/feed_rss_created.xml">mp-units</source><guid isPermaLink="true">https://mpusz.github.io/mp-units/HEAD/blog/2025/01/15/bringing-quantity-safety-to-the-next-level/</guid> <enclosure url="https://mpusz.github.io/mp-units/HEADassets/images/social/blog/posts/bringing-quantity-safety-to-the-next-level.png" type="image/png" length="45128" /> </item> <item> <title>Report from the Wrocław 2024 ISO C++ Committee meeting</title> <author>Mateusz Pusz</author> <category>WG21 Updates</category> <description><h1>Report from the Wrocław 2024 ISO C++ Committee meeting</h1><p>The Wrocław 2024 meeting was another efficient step in the standardization of this library.We've spent the entire day on the joint LEWGI and SG6 discussion and got lots of feedback.We've also introduced <code>std::fixed_string</code> to LEWG for C++26.</p></description><link>https://mpusz.github.io/mp-units/HEAD/blog/2024/11/25/report-from-the-wroc%C5%82aw-2024-iso-c-committee-meeting/</link> <pubDate>Mon, 25 Nov 2024 00:00:00 +0000</pubDate><source url="https://mpusz.github.io/mp-units/HEAD/feed_rss_created.xml">mp-units</source><guid isPermaLink="true">https://mpusz.github.io/mp-units/HEAD/blog/2024/11/25/report-from-the-wroc%C5%82aw-2024-iso-c-committee-meeting/</guid> <enclosure url="https://mpusz.github.io/mp-units/HEADassets/images/social/blog/posts/wrocław-2024-report.png" type="image/png" length="53358" /> </item> <item> <title>International System of Quantities (ISQ): Part 6 - Challenges</title> <author>Mateusz Pusz</author> <category>Metrology</category> <description><h1>International System of Quantities (ISQ): Part 6 - Challenges</h1><p>This arLine truncated
|
||||
@@ -1 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"> <channel><title>mp-units</title><description>The quantities and units library for C++</description><link>https://mpusz.github.io/mp-units/HEAD/</link><atom:link href="https://mpusz.github.io/mp-units/HEAD/feed_rss_updated.xml" rel="self" type="application/rss+xml" /><managingEditor>mp-units Team</managingEditor><docs>https://github.com/mpusz/mp-units</docs><language>en</language> <pubDate>Tue, 17 Jun 2025 06:39:05 -0000</pubDate> <lastBuildDate>Tue, 17 Jun 2025 06:39:05 -0000</lastBuildDate> <ttl>1440</ttl> <generator>MkDocs RSS plugin - v1.17.3</generator> <image> <url>None</url> <title>mp-units</title><link>https://mpusz.github.io/mp-units/HEAD/</link> </image> <item> <title>Introducing absolute quantities</title> <author>Mateusz Pusz</author> <category>Metrology</category> <description><h1>Introducing absolute quantities</h1><p>This post introduces a new abstraction called an absolute quantity. It complements affinespace abstractions (point and delta) and will most probably be a new default in the librarywhen we release V3.</p></description><link>https://mpusz.github.io/mp-units/HEAD/blog/2025/06/16/introducing-absolute-quantities/</link> <pubDate>Tue, 17 Jun 2025 06:34:55 +0000</pubDate><source url="https://mpusz.github.io/mp-units/HEAD/feed_rss_updated.xml">mp-units</source><guid isPermaLink="true">https://mpusz.github.io/mp-units/HEAD/blog/2025/06/16/introducing-absolute-quantities/</guid> <enclosure url="https://mpusz.github.io/mp-units/HEADassets/images/social/blog/posts/introducing-absolute-quantities.png" type="image/png" length="39574" /> </item> <item> <title>Bringing Quantity-Safety To The Next Level</title> <author>Mateusz Pusz</author> <category>Metrology</category> <description><h1>Bringing Quantity-Safety To The Next Level</h1><p>All quantities and units libraries need to be unit-safe. Most of the libraries on the market dothis correctly. Some of them are also dimension-safe, which adds another level of protection fortheir users.</p><p><strong>mp-units</strong> is probably the only library on the market that additionally is quantity-safe. Thisgives a new quality and possibilities. I've described the major idea behind it, implementationdetails, and benefits to the users in the <a href="isq-part-5-benefits.md">series of posts about the International System of Quantities</a>.</p><p>However, this is only the beginning. We've always planned more and worked on the extensions in ourfree time. In this post, I will describe:</p><ul><li>What a quantity character is?</li><li>The importance of using proper representation types for the quantities.</li><li>The power of providing character-specific operations for the quantities.</li><li>Discuss implementation challenges and possible solutions.</li></ul></description><link>https://mpusz.github.io/mp-units/HEAD/blog/2025/01/15/bringing-quantity-safety-to-the-next-level/</link> <pubDate>Tue, 11 Feb 2025 16:26:19 +0000</pubDate><source url="https://mpusz.github.io/mp-units/HEAD/feed_rss_updated.xml">mp-units</source><guid isPermaLink="true">https://mpusz.github.io/mp-units/HEAD/blog/2025/01/15/bringing-quantity-safety-to-the-next-level/</guid> <enclosure url="https://mpusz.github.io/mp-units/HEADassets/images/social/blog/posts/bringing-quantity-safety-to-the-next-level.png" type="image/png" length="45128" /> </item> <item> <title>International System of Quantities (ISQ): Part 4 - Implementing ISQ</title> <author>Mateusz Pusz</author> <category>Metrology</category> <description><h1>International System of Quantities (ISQ): Part 4 - Implementing ISQ</h1><p>Up until now, we have introduced the International System of Quantities and described how we canmodel its main aspects. This article will present how to implement those models in a programminglanguage, and we will point out some of the first issues that stand in our way.</p></description><link>https://mpusz.github.io/mp-units/HEAD/blog/2024/10/28/international-system-of-quantities-isq-part-4---implementing-isq/</link> <pubDate>Tue, 11 Feb 2025 16:26:19 +0000</pubDate><source url="https://mpusz.github.io/mp-units/HEAD/feed_rss_updated.xml">mp-units</source><guid isPermaLink="true">https://mpusz.github.io/mp-units/HEAD/blog/2024/10/28/international-system-of-quantities-isq-part-4---implementing-isq/</guid> <enclosure url="https://mpusz.github.io/mp-units/HEADassets/images/social/blog/posts/isq-part-4-implemeting-isq.png" type="image/png" length="52250" /> </item> <item> <title>International System of Quantities (ISQ): Part 6 - Challenges</title> <author>Mateusz Pusz</author> <category>Metrology</category> <description><h1>International System of Quantities (ISQ): Part 6 Line truncated
|
||||
<?xml version="1.0" encoding="UTF-8" ?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"> <channel><title>mp-units</title><description>The quantities and units library for C++</description><link>https://mpusz.github.io/mp-units/HEAD/</link><atom:link href="https://mpusz.github.io/mp-units/HEAD/feed_rss_updated.xml" rel="self" type="application/rss+xml" /><managingEditor>mp-units Team</managingEditor><docs>https://github.com/mpusz/mp-units</docs><language>en</language> <pubDate>Tue, 17 Jun 2025 08:13:50 -0000</pubDate> <lastBuildDate>Tue, 17 Jun 2025 08:13:50 -0000</lastBuildDate> <ttl>1440</ttl> <generator>MkDocs RSS plugin - v1.17.3</generator> <image> <url>None</url> <title>mp-units</title><link>https://mpusz.github.io/mp-units/HEAD/</link> </image> <item> <title>Introducing absolute quantities</title> <author>Mateusz Pusz</author> <category>Metrology</category> <description><h1>Introducing absolute quantities</h1><p>This post introduces a new abstraction called an absolute quantity. It complements affinespace abstractions (point and delta) and will most probably be a new default in the librarywhen we release V3.</p></description><link>https://mpusz.github.io/mp-units/HEAD/blog/2025/06/16/introducing-absolute-quantities/</link> <pubDate>Tue, 17 Jun 2025 08:09:11 +0000</pubDate><source url="https://mpusz.github.io/mp-units/HEAD/feed_rss_updated.xml">mp-units</source><guid isPermaLink="true">https://mpusz.github.io/mp-units/HEAD/blog/2025/06/16/introducing-absolute-quantities/</guid> <enclosure url="https://mpusz.github.io/mp-units/HEADassets/images/social/blog/posts/introducing-absolute-quantities.png" type="image/png" length="39574" /> </item> <item> <title>Bringing Quantity-Safety To The Next Level</title> <author>Mateusz Pusz</author> <category>Metrology</category> <description><h1>Bringing Quantity-Safety To The Next Level</h1><p>All quantities and units libraries need to be unit-safe. Most of the libraries on the market dothis correctly. Some of them are also dimension-safe, which adds another level of protection fortheir users.</p><p><strong>mp-units</strong> is probably the only library on the market that additionally is quantity-safe. Thisgives a new quality and possibilities. I've described the major idea behind it, implementationdetails, and benefits to the users in the <a href="isq-part-5-benefits.md">series of posts about the International System of Quantities</a>.</p><p>However, this is only the beginning. We've always planned more and worked on the extensions in ourfree time. In this post, I will describe:</p><ul><li>What a quantity character is?</li><li>The importance of using proper representation types for the quantities.</li><li>The power of providing character-specific operations for the quantities.</li><li>Discuss implementation challenges and possible solutions.</li></ul></description><link>https://mpusz.github.io/mp-units/HEAD/blog/2025/01/15/bringing-quantity-safety-to-the-next-level/</link> <pubDate>Tue, 11 Feb 2025 16:26:19 +0000</pubDate><source url="https://mpusz.github.io/mp-units/HEAD/feed_rss_updated.xml">mp-units</source><guid isPermaLink="true">https://mpusz.github.io/mp-units/HEAD/blog/2025/01/15/bringing-quantity-safety-to-the-next-level/</guid> <enclosure url="https://mpusz.github.io/mp-units/HEADassets/images/social/blog/posts/bringing-quantity-safety-to-the-next-level.png" type="image/png" length="45128" /> </item> <item> <title>International System of Quantities (ISQ): Part 4 - Implementing ISQ</title> <author>Mateusz Pusz</author> <category>Metrology</category> <description><h1>International System of Quantities (ISQ): Part 4 - Implementing ISQ</h1><p>Up until now, we have introduced the International System of Quantities and described how we canmodel its main aspects. This article will present how to implement those models in a programminglanguage, and we will point out some of the first issues that stand in our way.</p></description><link>https://mpusz.github.io/mp-units/HEAD/blog/2024/10/28/international-system-of-quantities-isq-part-4---implementing-isq/</link> <pubDate>Tue, 11 Feb 2025 16:26:19 +0000</pubDate><source url="https://mpusz.github.io/mp-units/HEAD/feed_rss_updated.xml">mp-units</source><guid isPermaLink="true">https://mpusz.github.io/mp-units/HEAD/blog/2024/10/28/international-system-of-quantities-isq-part-4---implementing-isq/</guid> <enclosure url="https://mpusz.github.io/mp-units/HEADassets/images/social/blog/posts/isq-part-4-implemeting-isq.png" type="image/png" length="52250" /> </item> <item> <title>International System of Quantities (ISQ): Part 6 - Challenges</title> <author>Mateusz Pusz</author> <category>Metrology</category> <description><h1>International System of Quantities (ISQ): Part 6 Line truncated
|
||||
@@ -1 +1 @@
|
||||
{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Welcome to mp-units!","text":"<p>mp-units is a compile-time enabled feature-rich Modern C++ modular/header-only library that provides compile-time dimensional analysis and unit/quantity manipulation. Its key strengths include safety, performance, and developer experience.</p> <p>It is the first library on the market that, besides being unit-safe and dimension-safe, is also quantity-safe.</p> <p>The library source code is hosted on GitHub with a permissive MIT license.</p> Supported compilers <p>This library tries to provide the best user experience possible with the C++ language. To achieve that, it extensively uses the latest C++ language features.</p> <p>Even though the library benefits from the latest C++ versions (if available), C++20 is enough to compile and use all of the library's functionality.</p> <p>Please refer to C++ compiler support chapter for more details.</p> C++ modulesHeader files <pre><code>#include <iostream>\n#include <print>\nimport mp_units;\n\nusing namespace mp_units;\n\ninline constexpr struct smoot final : named_unit<\"smoot\", mag<67> * usc::inch> {} smoot;\n\nint main()\n{\n constexpr quantity dist = 364.4 * smoot;\n std::println(\"Harvard Bridge length = {::N[.1f]} ({::N[.1f]}, {::N[.2f]}) \u00b1 1 \u03b5ar\",\n dist, dist.in(usc::foot), dist.in(si::metre));\n}\n</code></pre> <pre><code>#include <mp-units/format.h>\n#include <mp-units/systems/si.h>\n#include <mp-units/systems/usc.h>\n#include <print>\n\nusing namespace mp_units;\n\ninline constexpr struct smoot final : named_unit<\"smoot\", mag<67> * usc::inch> {} smoot;\n\nint main()\n{\n constexpr quantity dist = 364.4 * smoot;\n std::println(\"Harvard Bridge length = {::N[.1f]} ({::N[.1f]}, {::N[.2f]}) \u00b1 1 \u03b5ar\",\n dist, dist.in(usc::foot), dist.in(si::metre));\n}\n</code></pre> <p>Output:</p> <pre><code>Harvard Bridge length = 364.4 smoot (2034.6 ft, 620.14 m) \u00b1 1 \u03b5ar\n</code></pre> <p>Try it on Compiler Explorer</p> What is <code>smoot</code>? <p>The smoot (/\u02c8smu\u02d0t/) is a nonstandard unit of length created as part of an MIT fraternity prank. It is named after Oliver R. Smoot, a fraternity pledge to Lambda Chi Alpha, who, in October 1958, lay on the Harvard Bridge (between Boston and Cambridge, Massachusetts) and was used by his fraternity brothers to measure the length of the bridge.</p> <p>One smoot equals Oliver Smoot's height at the time of the prank (five feet and seven inches). The bridge's length was measured to be 364.4 smoots plus or minus one ear, with the \"plus or minus\" intended to express the measurement uncertainty.</p> <p>Oliver Smoot graduated from MIT with the class of 1962, became a lawyer, and later became chairman of the American National Standards Institute (ANSI) and president of the International Organization for Standardization (ISO).</p> <p>More on the smoot unit of length can be found at https://en.wikipedia.org/wiki/Smoot.</p> <p>Important: Help needed!</p> <p>The mp-units library might be the subject of ISO standardization for C++29. More on this can be found in the following ISO C++ proposals:</p> <ul> <li>P1935: A C++ Approach to Physical Units,</li> <li>P2980: A motivation, scope, and plan for a physical quantities and units library,</li> <li>P3045: Quantities and units library.</li> </ul> <p>We are actively looking for parties interested in field-trialing the library.</p>"},{"location":"api_reference/","title":"API Reference - mp-units","text":""},{"location":"release_notes/","title":"Release Notes","text":""},{"location":"release_notes/#mp-units","title":"mp-units","text":""},{"location":"release_notes/#2.5.0","title":"2.5.0 WIP","text":"<ul> <li>(!) feat: representation concepts improved</li> <li>(!) feat: <code>representation_of</code> concept now also accepts a <code>quantity_spec</code> and accepts any representation character for quantity kinds</li> <li>(!) feat: <code>quantity::one()</code> removed</li> <li>(!) feat: <code>Representation</code> concept removed</li> <li>feat: <code>SymbolicArg</code> applied to expression templates</li> <li>feat: <code>per</code> and <code>power</code> made <code>final</code></li> <li>feat: <code>derived_XXX</code> are now constrained with <code>SymbolicConstant</code></li> <li>feat: prime factorization extended to any magnitude (thanks @chiphogg)</li> <li>feat: <code>cartesian_vector</code> added</li> <li>feat: <code>equivalent</code> now accept any units (even non-convertible)</li> <li>feat: text output should fallback to the portable mode when UTF-8 is not used for <code>text_encoding</code></li> <li>feat: precondition added to <code>to_u8string</code></li> <li>feat: text output of scaled units is now enclosed in parenthesis <code>(...)</code> instead of brackets <code>[...]</code></li> <li>feat: <code>abs(quantity)</Line truncated
|
||||
{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Welcome to mp-units!","text":"<p>mp-units is a compile-time enabled feature-rich Modern C++ modular/header-only library that provides compile-time dimensional analysis and unit/quantity manipulation. Its key strengths include safety, performance, and developer experience.</p> <p>It is the first library on the market that, besides being unit-safe and dimension-safe, is also quantity-safe.</p> <p>The library source code is hosted on GitHub with a permissive MIT license.</p> Supported compilers <p>This library tries to provide the best user experience possible with the C++ language. To achieve that, it extensively uses the latest C++ language features.</p> <p>Even though the library benefits from the latest C++ versions (if available), C++20 is enough to compile and use all of the library's functionality.</p> <p>Please refer to C++ compiler support chapter for more details.</p> C++ modulesHeader files <pre><code>#include <iostream>\n#include <print>\nimport mp_units;\n\nusing namespace mp_units;\n\ninline constexpr struct smoot final : named_unit<\"smoot\", mag<67> * usc::inch> {} smoot;\n\nint main()\n{\n constexpr quantity dist = 364.4 * smoot;\n std::println(\"Harvard Bridge length = {::N[.1f]} ({::N[.1f]}, {::N[.2f]}) \u00b1 1 \u03b5ar\",\n dist, dist.in(usc::foot), dist.in(si::metre));\n}\n</code></pre> <pre><code>#include <mp-units/format.h>\n#include <mp-units/systems/si.h>\n#include <mp-units/systems/usc.h>\n#include <print>\n\nusing namespace mp_units;\n\ninline constexpr struct smoot final : named_unit<\"smoot\", mag<67> * usc::inch> {} smoot;\n\nint main()\n{\n constexpr quantity dist = 364.4 * smoot;\n std::println(\"Harvard Bridge length = {::N[.1f]} ({::N[.1f]}, {::N[.2f]}) \u00b1 1 \u03b5ar\",\n dist, dist.in(usc::foot), dist.in(si::metre));\n}\n</code></pre> <p>Output:</p> <pre><code>Harvard Bridge length = 364.4 smoot (2034.6 ft, 620.14 m) \u00b1 1 \u03b5ar\n</code></pre> <p>Try it on Compiler Explorer</p> What is <code>smoot</code>? <p>The smoot (/\u02c8smu\u02d0t/) is a nonstandard unit of length created as part of an MIT fraternity prank. It is named after Oliver R. Smoot, a fraternity pledge to Lambda Chi Alpha, who, in October 1958, lay on the Harvard Bridge (between Boston and Cambridge, Massachusetts) and was used by his fraternity brothers to measure the length of the bridge.</p> <p>One smoot equals Oliver Smoot's height at the time of the prank (five feet and seven inches). The bridge's length was measured to be 364.4 smoots plus or minus one ear, with the \"plus or minus\" intended to express the measurement uncertainty.</p> <p>Oliver Smoot graduated from MIT with the class of 1962, became a lawyer, and later became chairman of the American National Standards Institute (ANSI) and president of the International Organization for Standardization (ISO).</p> <p>More on the smoot unit of length can be found at https://en.wikipedia.org/wiki/Smoot.</p> <p>Important: Help needed!</p> <p>The mp-units library might be the subject of ISO standardization for C++29. More on this can be found in the following ISO C++ proposals:</p> <ul> <li>P1935: A C++ Approach to Physical Units,</li> <li>P2980: A motivation, scope, and plan for a physical quantities and units library,</li> <li>P3045: Quantities and units library.</li> </ul> <p>We are actively looking for parties interested in field-trialing the library.</p>"},{"location":"api_reference/","title":"API Reference - mp-units","text":""},{"location":"release_notes/","title":"Release Notes","text":""},{"location":"release_notes/#mp-units","title":"mp-units","text":""},{"location":"release_notes/#2.5.0","title":"2.5.0 WIP","text":"<ul> <li>(!) feat: representation concepts improved</li> <li>(!) feat: <code>representation_of</code> concept now also accepts a <code>quantity_spec</code> and accepts any representation character for quantity kinds</li> <li>(!) feat: <code>quantity::one()</code> removed</li> <li>(!) feat: <code>Representation</code> concept removed</li> <li>feat: <code>SymbolicArg</code> applied to expression templates</li> <li>feat: <code>per</code> and <code>power</code> made <code>final</code></li> <li>feat: <code>derived_XXX</code> are now constrained with <code>SymbolicConstant</code></li> <li>feat: prime factorization extended to any magnitude (thanks @chiphogg)</li> <li>feat: <code>cartesian_vector</code> added</li> <li>feat: <code>equivalent</code> now accept any units (even non-convertible)</li> <li>feat: text output should fallback to the portable mode when UTF-8 is not used for <code>text_encoding</code></li> <li>feat: precondition added to <code>to_u8string</code></li> <li>feat: text output of scaled units is now enclosed in parenthesis <code>(...)</code> instead of brackets <code>[...]</code></li> <li>feat: <code>abs(quantity)</Line truncated
|
||||
Reference in new issue
Block a user