Files
mp-units/head/api_reference/gen/qty.traits.html
T
2024-11-05 18:52:17 +01:00

17 lines
4.4 KiB
HTML

<!DOCTYPE html><html lang='en'><head><title>[qty.traits]</title><meta charset='UTF-8'/><link rel='stylesheet' type='text/css' href='14882.css'/><link rel='stylesheet' type='text/css' href='https://fonts.googleapis.com/css2?family=Noto+Serif'/><link rel='stylesheet' type='text/css' href='https://fonts.googleapis.com/css2?family=Noto+Sans'/><link rel='stylesheet' type='text/css' href='https://fonts.googleapis.com/css2?family=Noto+Sans+Mono'/><link rel='icon' href='icon.png'/><link rel='stylesheet' type='text/css' href='expanded.css' title='Normal'/><link rel='alternate stylesheet' type='text/css' href='colored.css' title='Notes and examples colored'/><link rel='alternate stylesheet' type='text/css' href='normative-only.css' title='Notes and examples hidden'/></head><body><div class='wrapper'><h1 ><a class='secnum' style='min-width:50pt'>5</a> Quantities library <a class='abbr_ref' href='index.html#qties'>[qties]</a></h1><h2 ><a class='secnum' style='min-width:65pt'>5.6</a> Traits <a class='abbr_ref'>[qty.traits]</a></h2><div class='texpara'><div class='itemdecl' id='itemdecl:1'><div class='marginalizedparent'><a class='itemDeclLink' href='#itemdecl:1'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>typename</span> Rep<span class='anglebracket'>&gt;</span>
<span class='keyword'>constexpr</span> <span class='keyword'>bool</span> <span id='lib:is_scalar'><a class='hidden_link' href='#lib:is_scalar' title='5.6&emsp;Traits&emsp;[qty.traits]'>is_scalar</a></span> <span class='operator'>=</span>
std<span class='operator'>::</span>is_floating_point_v<span class='anglebracket'>&lt;</span>Rep<span class='anglebracket'>&gt;</span> <span class='operator'>|</span><span class='operator'>|</span> <span class='parenthesis'>(</span>std<span class='operator'>::</span>is_integral_v<span class='anglebracket'>&lt;</span>Rep<span class='anglebracket'>&gt;</span> <span class='operator'>&amp;</span><span class='operator'>&amp;</span> <span class='operator'>!</span>is_same_v<span class='anglebracket'>&lt;</span>Rep, <span class='keyword'>bool</span><span class='anglebracket'>&gt;</span><span class='parenthesis'>)</span>;
<span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>typename</span> Rep<span class='anglebracket'>&gt;</span>
<span class='keyword'>constexpr</span> <span class='keyword'>bool</span> <span id='lib:is_vector'><a class='hidden_link' href='#lib:is_vector' title='5.6&emsp;Traits&emsp;[qty.traits]'>is_vector</a></span> <span class='operator'>=</span> <span class='literal'>false</span>;
<span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>typename</span> Rep<span class='anglebracket'>&gt;</span>
<span class='keyword'>constexpr</span> <span class='keyword'>bool</span> <span id='lib:is_tensor'><a class='hidden_link' href='#lib:is_tensor' title='5.6&emsp;Traits&emsp;[qty.traits]'>is_tensor</a></span> <span class='operator'>=</span> <span class='literal'>false</span>;
</code></div></div><div class='para' id='1'><div class='marginalizedparent'><a class='marginalized' href='#1'>1</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/mpusz/mp-units26d2fc47f2a7c0139c7e73c74c9e1c3916bf93b4/source/quantities.tex#L149'>#</a></div><div class='texpara'><div id='1.sentence-1' class='sentence'><i >Remarks</i>: Pursuant to <a href="https://wg21.link/namespace.std">N4971, [namespace.std]</a> (<a href='spec.ext.html' title='4.1&emsp;External'>[spec.<span class='shy'></span>ext]</a>),
users may specialize <span class='texttt'>is_<span class='shy'></span>scalar</span>, <span class='texttt'>is_<span class='shy'></span>vector</span>, and <span class='texttt'>is_<span class='shy'></span>tensor</span> to <span class='texttt'><span class='literal'>true</span></span>
for cv-unqualified program-defined types
which respectively represent
a scalar (<a href="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=102-02-18">IEC 60050, 102-02-18</a>),
a vector (<a href="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=102-03-04">IEC 60050, 102-03-04</a>), and
a tensor,
and <span class='texttt'><span class='literal'>false</span></span> for types which respectively do not<a class='hidden_link' href='#1.sentence-1'>.</a></div></div></div></div></div></body></html>