1 /* This test script is part of GDB, the GNU debugger.
3 Copyright 1999, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
4 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
33 friend ostream
& operator<<(ostream
& outs
, A1 one
);
43 A1
operator+=(int value
);
44 A1
operator+(const A1
&);
45 A1
operator-(const A1
&);
46 A1
operator%(const A1
&);
47 int operator==(const A1
&);
48 int operator!=(const A1
&);
49 int operator&&(const A1
&);
50 int operator||(const A1
&);
53 A1
operator|(const A1
&);
54 A1
operator^(const A1
&);
55 A1
operator&(const A1
&);
56 int operator<(const A1
&);
57 int operator<=(const A1
&);
58 int operator>=(const A1
&);
59 int operator>(const A1
&);
60 A1
operator*(const A1
&);
61 A1
operator/(const A1
&);
62 A1
operator=(const A1
&);
76 A1
A1::operator+(const A1
& second
)
85 A1
A1::operator*(const A1
& second
)
88 product
.x
= this->x
* second
.x
;
89 product
.y
= this->y
* second
.y
;
94 A1
A1::operator-(const A1
& second
)
97 diff
.x
= x
- second
.x
;
98 diff
.y
= y
- second
.y
;
103 A1
A1::operator/(const A1
& second
)
106 div
.x
= x
/ second
.x
;
107 div
.y
= y
/ second
.y
;
112 A1
A1::operator%(const A1
& second
)
115 rem
.x
= x
% second
.x
;
116 rem
.y
= y
% second
.y
;
121 int A1::operator==(const A1
& second
)
123 int a
= (x
== second
.x
);
124 int b
= (y
== second
.y
);
129 int A1::operator!=(const A1
& second
)
131 int a
= (x
!= second
.x
);
132 int b
= (y
!= second
.y
);
137 int A1::operator&&(const A1
& second
)
139 return ( x
&& second
.x
);
142 int A1::operator||(const A1
& second
)
144 return ( x
|| second
.x
);
147 A1
A1::operator<<(int value
)
150 lshft
.x
= x
<< value
;
151 lshft
.y
= y
<< value
;
156 A1
A1::operator>>(int value
)
159 rshft
.x
= x
>> value
;
160 rshft
.y
= y
>> value
;
165 A1
A1::operator|(const A1
& second
)
168 abitor
.x
= x
| second
.x
;
169 abitor
.y
= y
| second
.y
;
174 A1
A1::operator^(const A1
& second
)
177 axor
.x
= x
^ second
.x
;
178 axor
.y
= y
^ second
.y
;
183 A1
A1::operator&(const A1
& second
)
186 abitand
.x
= x
& second
.x
;
187 abitand
.y
= y
& second
.y
;
192 int A1::operator<(const A1
& second
)
196 return (x
< second
.x
);
199 int A1::operator<=(const A1
& second
)
201 return (x
<= second
.x
);
204 int A1::operator>=(const A1
& second
)
206 return (x
>= second
.x
);
209 int A1::operator>(const A1
& second
)
211 return (x
> second
.x
);
214 int A1::operator!(void)
219 A1
A1::operator-(void)
228 A1
A1::operator+(void)
237 A1
A1::operator~(void)
246 A1
A1::operator++() // pre increment
253 A1
A1::operator++(int) // post increment
260 A1
A1::operator--() // pre decrement
267 A1
A1::operator--(int) // post decrement
275 A1
A1::operator=(const A1
& second
)
284 A1
A1::operator+=(int value
)
293 ostream
& operator<<(ostream
& outs
, A1 one
)
295 return (outs
<< endl
<< "x = " << one
.x
<< endl
<< "y = " << one
.y
<< endl
<< "-------" << endl
);
319 Member
& operator* ();
322 Member
& Container::operator* ()
335 marker1(); // marker1-returns-here
336 cout
<< one
; // marker1-returns-here
339 cout
<< "+ " << three
;
341 cout
<< "- " << three
;
343 cout
<<"* " << three
;
345 cout
<< "/ " << three
;
347 cout
<< "% " << three
;
349 cout
<< "| " <<three
;
351 cout
<< "^ " <<three
;
353 cout
<< "& "<< three
;
356 cout
<< "&& " << val
<< endl
<< "-----"<<endl
;
358 cout
<< "|| " << val
<< endl
<< "-----"<<endl
;
360 cout
<< " == " << val
<< endl
<< "-----"<<endl
;
362 cout
<< "!= " << val
<< endl
<< "-----"<<endl
;
364 cout
<< ">= " << val
<< endl
<< "-----"<<endl
;
366 cout
<< "<= " << val
<< endl
<< "-----"<<endl
;
368 cout
<< "< " << val
<< endl
<< "-----"<<endl
;
370 cout
<< "> " << val
<< endl
<< "-----"<<endl
;
373 cout
<< "lsh " << three
;
375 cout
<< "rsh " << three
;
378 cout
<< " = "<< three
;
380 cout
<< " += "<< three
;
383 cout
<< "! " << val
<< endl
<< "-----"<<endl
;
385 cout
<< "+ " << three
;
387 cout
<< "- " << three
;
389 cout
<< " ~" << three
;
391 cout
<< "postinc " << three
;
393 cout
<< "postdec " << three
;
396 cout
<< "predec " << three
;
398 cout
<< "preinc " << three
;
This page took 0.056022 seconds and 4 git commands to generate.