Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
<?xml version="1.0"?>
<clause number="14.11" title="Conditional logical operators">
<paragraph>The &amp;&amp; and || operators are called the conditional logical operators. They are also called the &quot;short-circuiting&quot; logical operators. <grammar_production><name><non_terminal where="14.11">conditional-and-expression</non_terminal></name> : <rhs><non_terminal where="14.10">inclusive-or-expression</non_terminal></rhs><rhs><non_terminal where="14.11">conditional-and-expression</non_terminal><terminal>&amp;&amp;</terminal><non_terminal where="14.10">inclusive-or-expression</non_terminal></rhs></grammar_production><grammar_production><name><non_terminal where="14.11">conditional-or-expression</non_terminal></name> : <rhs><non_terminal where="14.11">conditional-and-expression</non_terminal></rhs><rhs><non_terminal where="14.11">conditional-or-expression</non_terminal><terminal>||</terminal><non_terminal where="14.11">conditional-and-expression</non_terminal></rhs></grammar_production></paragraph>
<paragraph>The &amp;&amp; and || operators are conditional versions of the &amp; and | operators: <list><list_item> The operation x &amp;&amp; y corresponds to the operation x &amp; y, except that y is evaluated only if x is true. </list_item><list_item> The operation x || y corresponds to the operation x | y, except that y is evaluated only if x is false. </list_item></list></paragraph>
<paragraph>An operation of the form x &amp;&amp; y or x || y is processed by applying overload resolution (<hyperlink>14.2.4</hyperlink>) as if the operation was written x &amp; y or x | y. Then, <list><list_item> If overload resolution fails to find a single best operator, or if overload resolution selects one of the predefined integer logical operators, a compile-time error occurs. </list_item><list_item> Otherwise, if the selected operator is one of the predefined boolean logical operators (<hyperlink>14.10.2</hyperlink>), the operation is processed as described in <hyperlink>14.11.1</hyperlink>. </list_item><list_item> Otherwise, the selected operator is a user-defined operator, and the operation is processed as described in <hyperlink>14.11.2</hyperlink>. </list_item></list></paragraph>
<paragraph>It is not possible to directly overload the conditional logical operators. However, because the conditional logical operators are evaluated in terms of the regular logical operators, overloads of the regular logical operators are, with certain restrictions, also considered overloads of the conditional logical operators. This is described further in <hyperlink>14.11.2</hyperlink>. </paragraph>
</clause>