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
);
314 bool operator== (const Member
&m1
, const Member
&m2
)
324 Member
& operator* ();
327 Member
& Container::operator* ()
344 marker1(); // marker1-returns-here
345 cout
<< one
; // marker1-returns-here
348 cout
<< "+ " << three
;
350 cout
<< "- " << three
;
352 cout
<<"* " << three
;
354 cout
<< "/ " << three
;
356 cout
<< "% " << three
;
358 cout
<< "| " <<three
;
360 cout
<< "^ " <<three
;
362 cout
<< "& "<< three
;
365 cout
<< "&& " << val
<< endl
<< "-----"<<endl
;
367 cout
<< "|| " << val
<< endl
<< "-----"<<endl
;
369 cout
<< " == " << val
<< endl
<< "-----"<<endl
;
371 cout
<< "!= " << val
<< endl
<< "-----"<<endl
;
373 cout
<< ">= " << val
<< endl
<< "-----"<<endl
;
375 cout
<< "<= " << val
<< endl
<< "-----"<<endl
;
377 cout
<< "< " << val
<< endl
<< "-----"<<endl
;
379 cout
<< "> " << val
<< endl
<< "-----"<<endl
;
382 cout
<< "lsh " << three
;
384 cout
<< "rsh " << three
;
387 cout
<< " = "<< three
;
389 cout
<< " += "<< three
;
392 cout
<< "! " << val
<< endl
<< "-----"<<endl
;
394 cout
<< "+ " << three
;
396 cout
<< "- " << three
;
398 cout
<< " ~" << three
;
400 cout
<< "postinc " << three
;
402 cout
<< "postdec " << three
;
405 cout
<< "predec " << three
;
407 cout
<< "preinc " << three
;
This page took 0.037715 seconds and 4 git commands to generate.