1 /* This test script is part of GDB, the GNU debugger.
3 Copyright 1999, 2002-2012 Free Software Foundation, Inc.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
32 friend ostream
& operator<<(ostream
& outs
, A1 one
);
42 A1
operator+=(int value
);
43 A1
operator+(const A1
&);
44 A1
operator-(const A1
&);
45 A1
operator%(const A1
&);
46 int operator==(const A1
&);
47 int operator!=(const A1
&);
48 int operator&&(const A1
&);
49 int operator||(const A1
&);
52 A1
operator|(const A1
&);
53 A1
operator^(const A1
&);
54 A1
operator&(const A1
&);
55 int operator<(const A1
&);
56 int operator<=(const A1
&);
57 int operator>=(const A1
&);
58 int operator>(const A1
&);
59 A1
operator*(const A1
&);
60 A1
operator/(const A1
&);
61 A1
operator=(const A1
&);
75 A1
A1::operator+(const A1
& second
)
84 A1
A1::operator*(const A1
& second
)
87 product
.x
= this->x
* second
.x
;
88 product
.y
= this->y
* second
.y
;
93 A1
A1::operator-(const A1
& second
)
96 diff
.x
= x
- second
.x
;
97 diff
.y
= y
- second
.y
;
102 A1
A1::operator/(const A1
& second
)
105 div
.x
= x
/ second
.x
;
106 div
.y
= y
/ second
.y
;
111 A1
A1::operator%(const A1
& second
)
114 rem
.x
= x
% second
.x
;
115 rem
.y
= y
% second
.y
;
120 int A1::operator==(const A1
& second
)
122 int a
= (x
== second
.x
);
123 int b
= (y
== second
.y
);
128 int A1::operator!=(const A1
& second
)
130 int a
= (x
!= second
.x
);
131 int b
= (y
!= second
.y
);
136 int A1::operator&&(const A1
& second
)
138 return ( x
&& second
.x
);
141 int A1::operator||(const A1
& second
)
143 return ( x
|| second
.x
);
146 A1
A1::operator<<(int value
)
149 lshft
.x
= x
<< value
;
150 lshft
.y
= y
<< value
;
155 A1
A1::operator>>(int value
)
158 rshft
.x
= x
>> value
;
159 rshft
.y
= y
>> value
;
164 A1
A1::operator|(const A1
& second
)
167 abitor
.x
= x
| second
.x
;
168 abitor
.y
= y
| second
.y
;
173 A1
A1::operator^(const A1
& second
)
176 axor
.x
= x
^ second
.x
;
177 axor
.y
= y
^ second
.y
;
182 A1
A1::operator&(const A1
& second
)
185 abitand
.x
= x
& second
.x
;
186 abitand
.y
= y
& second
.y
;
191 int A1::operator<(const A1
& second
)
195 return (x
< second
.x
);
198 int A1::operator<=(const A1
& second
)
200 return (x
<= second
.x
);
203 int A1::operator>=(const A1
& second
)
205 return (x
>= second
.x
);
208 int A1::operator>(const A1
& second
)
210 return (x
> second
.x
);
213 int A1::operator!(void)
218 A1
A1::operator-(void)
227 A1
A1::operator+(void)
236 A1
A1::operator~(void)
245 A1
A1::operator++() // pre increment
252 A1
A1::operator++(int) // post increment
259 A1
A1::operator--() // pre decrement
266 A1
A1::operator--(int) // post decrement
274 A1
A1::operator=(const A1
& second
)
283 A1
A1::operator+=(int value
)
292 ostream
& operator<<(ostream
& outs
, A1 one
)
294 return (outs
<< endl
<< "x = " << one
.x
<< endl
<< "y = " << one
.y
<< endl
<< "-------" << endl
);
313 bool operator== (const Member
&m1
, const Member
&m2
)
323 Member
& operator* ();
326 Member
& Container::operator* ()
343 marker1(); // marker1-returns-here
344 cout
<< one
; // marker1-returns-here
347 cout
<< "+ " << three
;
349 cout
<< "- " << three
;
351 cout
<<"* " << three
;
353 cout
<< "/ " << three
;
355 cout
<< "% " << three
;
357 cout
<< "| " <<three
;
359 cout
<< "^ " <<three
;
361 cout
<< "& "<< three
;
364 cout
<< "&& " << val
<< endl
<< "-----"<<endl
;
366 cout
<< "|| " << val
<< endl
<< "-----"<<endl
;
368 cout
<< " == " << val
<< endl
<< "-----"<<endl
;
370 cout
<< "!= " << val
<< endl
<< "-----"<<endl
;
372 cout
<< ">= " << val
<< endl
<< "-----"<<endl
;
374 cout
<< "<= " << val
<< endl
<< "-----"<<endl
;
376 cout
<< "< " << val
<< endl
<< "-----"<<endl
;
378 cout
<< "> " << val
<< endl
<< "-----"<<endl
;
381 cout
<< "lsh " << three
;
383 cout
<< "rsh " << three
;
386 cout
<< " = "<< three
;
388 cout
<< " += "<< three
;
391 cout
<< "! " << val
<< endl
<< "-----"<<endl
;
393 cout
<< "+ " << three
;
395 cout
<< "- " << three
;
397 cout
<< " ~" << three
;
399 cout
<< "postinc " << three
;
401 cout
<< "postdec " << three
;
404 cout
<< "predec " << three
;
406 cout
<< "preinc " << three
;
This page took 0.039165 seconds and 4 git commands to generate.