This file is indexed.

/usr/share/doc/libbobcat4-dev/man/binopsbase.3.html is in libbobcat-dev 4.08.02-2build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
<!DOCTYPE html><html><head>
<meta charset="UTF-8">
<title>binopsbase(3bobcat)</title>
<style type="text/css">
    figure {text-align: center;}
    img {vertical-align: center;}
    .XXfc {margin-left:auto;margin-right:auto;}
    .XXtc {text-align: center;}
    .XXtl {text-align: left;}
    .XXtr {text-align: right;}
    .XXvt {vertical-align: top;}
    .XXvb {vertical-align: bottom;}
</style>
<link rev="made" href="mailto:Frank B. Brokken: f.b.brokken@rug.nl">
</head>
<body text="#27408B" bgcolor="#FFFAF0">
<hr/>
<h1 id="title">binopsbase(3bobcat)</h1>
<h2 id="author">Binary Operators<br/>(libbobcat-dev_4.08.02-x.tar.gz)</h2>
<h2 id="date">2005-2017</h2>


<p>
<h2 >NAME</h2>BinopsBase - Class template offering class-type binary operators
<p>
<h2 >SYNOPSIS</h2>
    <strong >#include &lt;bobcat/binopsbase&gt;</strong><br/>
<p>
<h2 >DESCRIPTION</h2>
    Classes may overload binary operators. A class named <em >Derived</em> may
overload binary operators to suit its own needs. It could, e.g., allow two
<em >Derived</em> class objects to be added together, or it could define a
shift-operation given a <em >size_t</em> right-hand side (rhs) argument.
<p>
The available binary operators are *, /, %, +, -, &lt;&lt;, &gt;&gt;, &amp;, |, and ^ (in this
man-page they are generically indicated as the `<em >@</em>' operator). In addition,
overloaded <em >operator&lt;&lt;</em> and <em >operator&gt;&gt;</em> for stream insertion and
extraction are frequently defined.
<p>
If a class <em >Derived</em> supports copy and/or move construction and if it offers
a swap member (<em >void Derived::swap(Derived &amp;rhs)</em>), and is publicly derived
from <em >FBB::BinopsBase&lt;Derived&gt;</em> then once <em >Derived</em> defines a member
        <pre>

    void Class::operator@=(Rhs const &amp;rhs) &amp;&amp;
        
</pre>
 
    defining the compound <em >@</em>-operator for anonymous, temporary <em >Derived</em>
objects and a <em >Rhs</em> type for its right-hand side operand the following
operators are also available:
        <pre>

    Derived &amp;operator@=(Rhs const &amp;rhs) &amp;

    Derived operator@(Derived &amp;&amp;lhs, Rhs const &amp;rhs);
    Derived operator@(Derived const &amp;lhs, Rhs const &amp;rhs);
        
</pre>

<p>
A similar procedure applies to the insertion and extraction
operators. Insertion and extraction operators become available once
<em >BinopsBase&lt;Derived&gt;</em> is declared a friend class of <em >Derived</em>.  To make
the insertion operator available a private member
        <pre>

    void Derived::insert(std::ostream &amp;out) const
        
</pre>

    must then also be defined, inserting the calling object into
<em >out</em>. Analogously, to make the extraction operator available a private
member
        <pre>

    void Derived::extract(std::istream &amp;in)
        
</pre>
 
    must be defined extrating the calling object from <em >in</em>.
<p>
<h2 >INHERITS FROM</h2>
<p>
--
<p>
<h2 >OVERLOADED OPERATORS</h2>
<p>
For each defined <em >Derived &amp;&amp;operator@=(Rhs const &amp;rhs) &amp;&amp;</em>, defined in
the class <em >Derived</em> the following operators are automatically also available:
        <pre>

    Derived operator@(Derived &amp;&amp;lhs, Rhs const &amp;rhs);
    Derived operator@(Derived const &amp;lhs, Rhs const &amp;rhs);
        
</pre>

and
        <pre>

    Derived &amp;operator@=(Rhs const &amp;rhs) &amp;;
        
</pre>

<p>
The insertion operator becomew available once
        <pre>

    void Derived::insert(std::ostream &amp;out) const
        
</pre>

    (inserting the calling object into <em >out</em>) has been defined. Analogously,
the extraction operator becomes available after defining a private member
        <pre>

    void Derived::extract(std::istream &amp;in)
        
</pre>
 
    (extracting the calling object from <em >in</em>).
<p>
<h2 >FRIEND DECLARATION</h2>
<p>
To make the insertion and/or extraction operators available the class
<em >Derived</em> must also declare
        <pre>

    friend FBB::BinopsBase&lt;Derived&gt;;
        
</pre>

<p>
<h2 >EXAMPLE</h2>
    <pre >
#include &lt;iostream&gt;
#include &lt;bobcat/binopsbase&gt;

class Demo1: public FBB::BinopsBase&lt;Demo1&gt;
{
    friend FBB::BinopsBase&lt;Demo1&gt;;            // for insert/extract

    public:
        void swap(Demo1 &amp;other)
        {}

        Demo1 &amp;&amp;operator+=(Demo1 const &amp;rhs) &amp;&amp;
        {
            std::cout &lt;&lt; "adding two Demo1 objects\n";
            return std::move(*this);
        }

//  Explicit definitions take precedence over functions templates
//  instantiated from definitions in bobcat/binopsbase. 
//        Demo1 &amp;operator+=(Demo1 const &amp;rhs) &amp;
//        {
//            std::cout &lt;&lt; "adding (self-defined) two Demo1 objects\n";
//            return *this;
//        }

        Demo1 &amp;&amp;operator-=(Demo1 const &amp;rhs) &amp;&amp;
        {
            std::cout &lt;&lt; "subtracting two Demo1 objects\n";
            return std::move(*this);
        }

        Demo1 &amp;&amp;operator&lt;&lt;=(Demo1 const &amp;rhs) &amp;&amp;
        {
            std::cout &lt;&lt; "shiftleft on two Demo1 objects\n";
            return std::move(*this);
        }

        Demo1 &amp;&amp;operator&lt;&lt;=(size_t rhs) &amp;&amp;
        {
            std::cout &lt;&lt; "shiftleft Demo1 object size_t bits\n";
            return std::move(*this);
        }

        void insert(std::ostream &amp;out) const        // requires friend
        {
            out &lt;&lt; "inerting a Demo1 object\n";
        }

        void extract(std::istream &amp;in)              // requires friend
        {
            std::cout &lt;&lt; "extracting a Demo1 object\n";
        }
};

class Demo2: public FBB::BinopsBase&lt;Demo2&gt;
{
    public:
        void swap(Demo2 &amp;other)
        {}

        Demo2 &amp;&amp;operator+=(Demo2 const &amp;rhs) &amp;&amp;
        {
            std::cout &lt;&lt; "adding two Demo2 objects\n";
            return std::move(*this);
        }

        Demo2 &amp;operator+=(Demo2 const &amp;rhs) &amp;
        {
            std::cout &lt;&lt; "adding (self-defined) two Demo2 objects";
            return *this;
        }

        Demo2 &amp;&amp;operator^=(Demo2 const &amp;rhs) &amp;&amp;
        {
            std::cout &lt;&lt; "xor-ing two Demo2 objects\n";
            return std::move(*this);
        }

        Demo2 &amp;&amp;operator|=(Demo2 const &amp;rhs) &amp;&amp;
        {
            std::cout &lt;&lt; "or-ing two Demo2 objects\n";
            return std::move(*this);
        }

};

int main()
{
    Demo1 d1a, d1b;
    Demo1 d1c = d1a + d1b;
    d1a += d1b;
    d1c = Demo1{} + d1b;

    std::cout &lt;&lt; "Here we are " &lt;&lt; d1c &lt;&lt; '\n';
    std::cin &gt;&gt; d1c;

    d1a &lt;&lt;= d1a;
    d1a &lt;&lt;= 5;

    Demo2 d2a, d2b;
    Demo2 d2c = d2a + d2b;
    d2a ^= d2b;
    d2c = Demo2{} ^ d2b;

    d2c = d2c | d2b;
}






</pre>

<p>
<h2 >FILES</h2>
    <em >bobcat/binopsbase</em> - defines the binary operator function templates
<p>
<h2 >SEE ALSO</h2>
    <strong >bobcat/binops</strong>(3),
    <strong >bobcat</strong>(7)
<p>
<h2 >BUGS</h2>
    None Reported.
<p>

<h2 >DISTRIBUTION FILES</h2>
    <ul>
    <li> <em >bobcat_4.08.02-x.dsc</em>: detached signature;
    <li> <em >bobcat_4.08.02-x.tar.gz</em>: source archive;
    <li> <em >bobcat_4.08.02-x_i386.changes</em>: change log;
    <li> <em >libbobcat1_4.08.02-x_*.deb</em>: debian package holding the
            libraries;
    <li> <em >libbobcat1-dev_4.08.02-x_*.deb</em>: debian package holding the
            libraries, headers and manual pages;
    <li> <em >http://sourceforge.net/projects/bobcat</em>: public archive location;
    </ul>
<p>
<h2 >BOBCAT</h2>
    Bobcat is an acronym of `Brokken's Own Base Classes And Templates'.
<p>
<h2 >COPYRIGHT</h2>
    This is free software, distributed under the terms of the 
    GNU General Public License (GPL).
<p>
<h2 >AUTHOR</h2>
    Frank B. Brokken (<strong >f.b.brokken@rug.nl</strong>).
<p>
</body>
</html>