Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
32dd8ef8
Commit
32dd8ef8
authored
Jul 17, 1998
by
Jason Merrill
Committed by
Jason Merrill
Jul 16, 1998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tmap.cc: Use less<int>.
* tmap.cc: Use less<int>. * tlist.cc (main): Use remove_if. From-SVN: r21244
parent
2768c658
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
23 deletions
+10
-23
libstdc++/tests/ChangeLog
+5
-0
libstdc++/tests/tlist.cc
+3
-14
libstdc++/tests/tmap.cc
+2
-9
No files found.
libstdc++/tests/ChangeLog
View file @
32dd8ef8
1998-07-17 Jason Merrill <jason@yorick.cygnus.com>
* tmap.cc: Use less<int>.
* tlist.cc (main): Use remove_if.
1998-07-13 Manfred Hollstein <manfred@s-direktnet.de>
* Makefile.in (VERSION): Bump to 2.9.0.
...
...
libstdc++/tests/tlist.cc
View file @
32dd8ef8
/*
test/demo of generic lists
*/
// test/demo of generic lists
#include <assert.h>
...
...
@@ -8,8 +6,8 @@
else _assert(#ex, __FILE__,__LINE__); }
#include <iostream.h>
#include
"list.h"
#include
"algo.h"
#include
<list.h>
#include
<algo.h>
bool
int_compare
(
int
a
,
int
b
)
{
...
...
@@ -123,16 +121,7 @@ main()
for
(
it
=
a
.
begin
(),
bit
=
b
.
begin
();
it
!=
a
.
end
()
&&
bit
!=
b
.
end
();
)
g
.
insert
(
g
.
end
(),
*
it
++
+
*
bit
++
);
cout
<<
"
\n
list<int> g = combine(plus, a, b);
\n
"
;
print
(
g
);
#if 1
for
(
it
=
g
.
begin
();
it
!=
g
.
end
();
)
{
bit
=
it
++
;
if
(
is_odd
(
*
bit
))
g
.
erase
(
bit
);
}
#else
g
.
remove_if
(
is_odd
);
#endif
cout
<<
"
\n
g.del(is_odd);
\n
"
;
print
(
g
);
ff
.
erase
(
ff
.
begin
(),
ff
.
end
());
...
...
libstdc++/tests/tmap.cc
View file @
32dd8ef8
...
...
@@ -3,21 +3,14 @@
#include <iostream.h>
#include <function.h>
int
SIZE
;
#if 0
/* Crashes compiler */
#define int_less less<int>
#else
struct
int_less
{
bool
operator
()
(
int
x
,
int
y
)
const
{
return
x
<
y
;
}
};
struct
str_less
{
bool
operator
()
(
char
*
x
,
char
*
y
)
const
{
return
strcmp
(
x
,
y
)
<
0
;
}
};
#endif
#if 0
int SIZE;
void add(int x[], int y[], map<int,int, int_less>& a)
{
for (int i = 0; i < SIZE; ++i) a[x[i]] = y[i];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment