Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/mpl/doc/refmanual/bitor.html @ 29

Last change on this file since 29 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 10.0 KB
Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4<!-- Copyright Aleksey Gurtovoy 2006. Distributed under the Boost -->
5<!-- Software License, Version 1.0. (See accompanying -->
6<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
7<head>
8<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9<meta name="generator" content="Docutils 0.3.6: http://docutils.sourceforge.net/" />
10<title>The MPL Reference Manual: bitor_</title>
11<link rel="stylesheet" href="../style.css" type="text/css" />
12</head>
13<body class="docframe refmanual">
14<table class="header"><tr class="header"><td class="header-group navigation-bar"><span class="navigation-group"><a href="./bitand.html" class="navigation-link">Prev</a>&nbsp;<a href="./bitxor.html" class="navigation-link">Next</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./bitand.html" class="navigation-link">Back</a>&nbsp;<a href="./bitxor.html" class="navigation-link">Along</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./bitwise-operations.html" class="navigation-link">Up</a>&nbsp;<a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./refmanual_toc.html" class="navigation-link">Full TOC</a></span></td>
15<td class="header-group page-location"><a href="../refmanual.html" class="navigation-link">Front Page</a> / <a href="./metafunctions.html" class="navigation-link">Metafunctions</a> / <a href="./bitwise-operations.html" class="navigation-link">Bitwise Operations</a> / <a href="./bitor.html" class="navigation-link">bitor_</a></td>
16</tr></table><div class="header-separator"></div>
17<div class="section" id="bitor">
18<h1><a class="toc-backref" href="./bitwise-operations.html#id481" name="bitor">bitor_</a></h1>
19<div class="section" id="bitor-synopsis">
20<h3><a class="subsection-title" href="#synopsis" name="synopsis">Synopsis</a></h3>
21<pre class="literal-block">
22template&lt;
23      typename T1
24    , typename T2
25    , typename T3 = <em>unspecified</em>
26    <em>...</em>
27    , typename T<em>n</em> = <em>unspecified</em>
28    &gt;
29struct <a href="./bitor.html" class="identifier">bitor_</a>
30{
31    typedef <em>unspecified</em> type;
32};
33</pre>
34</div>
35<div class="section" id="bitor-description">
36<h3><a class="subsection-title" href="#description" name="description">Description</a></h3>
37<p>Returns the result of <em>bitwise or</em> (<tt class="literal"><span class="pre">|</span></tt>) operation of its arguments.</p>
38</div>
39<div class="section" id="bitor-header">
40<h3><a class="subsection-title" href="#header" name="header">Header</a></h3>
41<pre class="literal-block">
42#include &lt;<a href="../../../../boost/mpl/bitor.hpp" class="header">boost/mpl/bitor.hpp</a>&gt;
43#include &lt;<a href="../../../../boost/mpl/bitwise.hpp" class="header">boost/mpl/bitwise.hpp</a>&gt;
44</pre>
45</div>
46<div class="section" id="bitor-model-of">
47<h3><a class="subsection-title" href="#model-of" name="model-of">Model of</a></h3>
48<p><a class="reference" href="./numeric-metafunction.html">Numeric Metafunction</a></p>
49</div>
50<div class="section" id="bitor-parameters">
51<h3><a class="subsection-title" href="#parameters" name="parameters">Parameters</a></h3>
52<table border="1" class="table">
53<colgroup>
54<col width="17%" />
55<col width="30%" />
56<col width="53%" />
57</colgroup>
58<thead valign="bottom">
59<tr><th>Parameter</th>
60<th>Requirement</th>
61<th>Description</th>
62</tr>
63</thead>
64<tbody valign="top">
65<tr><td><tt class="literal"><span class="pre">T1</span></tt>, <tt class="literal"><span class="pre">T2</span></tt>,... <tt class="literal"><span class="pre">Tn</span></tt></td>
66<td><a class="reference" href="./integral-constant.html">Integral Constant</a></td>
67<td>Operation's arguments.</td>
68</tr>
69</tbody>
70</table>
71<p>[<em>Note:</em> The requirements listed in this specification
72are the ones imposed by the default implementation. See <a class="reference" href="./numeric-metafunction.html">Numeric Metafunction</a> concept
73for the details on how to provide an implementation for a user-defined numeric type
74that does not satisfy the <a class="reference" href="./integral-constant.html">Integral Constant</a> requirements. — <em>end note</em>]</p>
75</div>
76<div class="section" id="bitor-expression-semantics">
77<h3><a class="subsection-title" href="#expression-semantics" name="expression-semantics">Expression semantics</a></h3>
78<p>For any <a class="reference" href="./integral-constant.html">Integral Constant</a>s <em>c</em><sub>1</sub>,<em>c</em><sub>2</sub>,... <em>c</em><sub>n</sub>:</p>
79<pre class="literal-block">
80typedef <a href="./bitor.html" class="identifier">bitor_</a>&lt;c1,<em>...</em>c<em>n</em>&gt;::type r;
81</pre>
82<table class="field-list" frame="void" rules="none">
83<col class="field-name" />
84<col class="field-body" />
85<tbody valign="top">
86<tr class="field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference" href="./integral-constant.html">Integral Constant</a>.</td>
87</tr>
88<tr class="field"><th class="field-name">Semantics:</th><td class="field-body"><p class="first">Equivalent to</p>
89<pre class="last literal-block">
90typedef <a href="./integral-c.html" class="identifier">integral_c</a>&lt;
91      typeof(c1::value | c2::value)
92    , ( c1::value | c2::value )
93    &gt; c;
94   
95typedef <a href="./bitor.html" class="identifier">bitor_</a>&lt;c,c3,<em>...</em>c<em>n</em>&gt;::type r;
96</pre>
97</td>
98</tr>
99</tbody>
100</table>
101<!-- .......................................................................... -->
102<pre class="literal-block">
103typedef <a href="./bitor.html" class="identifier">bitor_</a>&lt;c1,<em>...</em>c<em>n</em>&gt; r;
104</pre>
105<table class="field-list" frame="void" rules="none">
106<col class="field-name" />
107<col class="field-body" />
108<tbody valign="top">
109<tr class="field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference" href="./integral-constant.html">Integral Constant</a>.</td>
110</tr>
111<tr class="field"><th class="field-name">Semantics:</th><td class="field-body"><p class="first">Equivalent to</p>
112<pre class="last literal-block">
113struct r : <a href="./bitor.html" class="identifier">bitor_</a>&lt;c1,<em>...</em>c<em>n</em>&gt;::type {};
114</pre>
115</td>
116</tr>
117</tbody>
118</table>
119</div>
120<div class="section" id="bitor-complexity">
121<h3><a class="subsection-title" href="#complexity" name="complexity">Complexity</a></h3>
122<p>Amortized constant time.</p>
123</div>
124<div class="section" id="bitor-example">
125<h3><a class="subsection-title" href="#example" name="example">Example</a></h3>
126<pre class="literal-block">
127typedef <a href="./integral-c.html" class="identifier">integral_c</a>&lt;unsigned,0&gt; u0;
128typedef <a href="./integral-c.html" class="identifier">integral_c</a>&lt;unsigned,1&gt; u1;
129typedef <a href="./integral-c.html" class="identifier">integral_c</a>&lt;unsigned,2&gt; u2;
130typedef <a href="./integral-c.html" class="identifier">integral_c</a>&lt;unsigned,8&gt; u8;
131typedef <a href="./integral-c.html" class="identifier">integral_c</a>&lt;unsigned,0xffffffff&gt; uffffffff;
132
133<a href="./assert-relation.html" class="identifier">BOOST_MPL_ASSERT_RELATION</a>( (<a href="./bitor.html" class="identifier">bitor_</a>&lt;u0,u0&gt;::value), ==, 0 );
134<a href="./assert-relation.html" class="identifier">BOOST_MPL_ASSERT_RELATION</a>( (<a href="./bitor.html" class="identifier">bitor_</a>&lt;u1,u0&gt;::value), ==, 1 );
135<a href="./assert-relation.html" class="identifier">BOOST_MPL_ASSERT_RELATION</a>( (<a href="./bitor.html" class="identifier">bitor_</a>&lt;u0,u1&gt;::value), ==, 1 );
136<a href="./assert-relation.html" class="identifier">BOOST_MPL_ASSERT_RELATION</a>( (<a href="./bitor.html" class="identifier">bitor_</a>&lt;u0,uffffffff&gt;::value), ==, 0xffffffff );
137<a href="./assert-relation.html" class="identifier">BOOST_MPL_ASSERT_RELATION</a>( (<a href="./bitor.html" class="identifier">bitor_</a>&lt;u1,uffffffff&gt;::value), ==, 0xffffffff );
138<a href="./assert-relation.html" class="identifier">BOOST_MPL_ASSERT_RELATION</a>( (<a href="./bitor.html" class="identifier">bitor_</a>&lt;u8,uffffffff&gt;::value), ==, 0xffffffff );
139</pre>
140</div>
141<div class="section" id="bitor-see-also">
142<h3><a class="subsection-title" href="#see-also" name="see-also">See also</a></h3>
143<p><a class="reference" href="./bitwise-operations.html">Bitwise Operations</a>, <a class="reference" href="./numeric-metafunction.html">Numeric Metafunction</a>, <a class="refentry reference" href="./numeric-cast.html"><tt class="refentry literal"><span class="pre">numeric_cast</span></tt></a>, <a class="refentry reference" href="./bitand.html"><tt class="refentry literal"><span class="pre">bitand_</span></tt></a>, <a class="refentry reference" href="./bitxor.html"><tt class="refentry literal"><span class="pre">bitxor_</span></tt></a>, <a class="refentry reference" href="./shift-left.html"><tt class="refentry literal"><span class="pre">shift_left</span></tt></a></p>
144<!-- modtime: November 10, 2004 05:04:32 +0000 -->
145<!-- Metafunctions/Bitwise Operations//bitxor_ -->
146</div>
147</div>
148
149<div class="footer-separator"></div>
150<table class="footer"><tr class="footer"><td class="header-group navigation-bar"><span class="navigation-group"><a href="./bitand.html" class="navigation-link">Prev</a>&nbsp;<a href="./bitxor.html" class="navigation-link">Next</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./bitand.html" class="navigation-link">Back</a>&nbsp;<a href="./bitxor.html" class="navigation-link">Along</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./bitwise-operations.html" class="navigation-link">Up</a>&nbsp;<a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./refmanual_toc.html" class="navigation-link">Full TOC</a></span></td>
151</tr></table></body>
152</html>
Note: See TracBrowser for help on using the repository browser.