From: Mike Stump <mrs@kithrup.com>
To: egcs@cygnus.com
Subject: PATCH for namespace/template support
Date: Sat, 09 May 1998 03:34:00 -0000 [thread overview]
Message-ID: <199805090945.CAA17945@kithrup.com> (raw)
Here is a simple one. Martin, let us know if it is wrong/incomplete.
Sat May 9 02:31:07 1998 Mike Stump <mrs@wrs.com>
* tree.c (mapcar): Add OVERLOAD support.
Doing diffs in .:
*** ./cp/tree.c.~1~ Fri May 8 22:53:32 1998
--- ./cp/tree.c Sat May 9 02:30:55 1998
*************** mapcar (t, func)
*** 1590,1595 ****
--- 1590,1604 ----
return t;
}
+ case OVERLOAD:
+ {
+ tree chain = OVL_CHAIN (t);
+ t = copy_node (t);
+ OVL_FUNCTION (t) = mapcar (OVL_FUNCTION (t), func);
+ OVL_CHAIN (t) = mapcar (chain, func);
+ return t;
+ }
+
case TREE_VEC:
{
int len = TREE_VEC_LENGTH (t);
*** ./testsuite/g++.old-deja/g++.mike/ns15.C.~1~ Sat May 9 02:39:39 1998
--- ./testsuite/g++.old-deja/g++.mike/ns15.C Sat May 9 02:39:25 1998
***************
*** 0 ****
--- 1,31 ----
+ // Build don't link:
+
+ #include <stdio.h>
+ #include <stdlib.h>
+
+ #define MAX 256
+ #define MAXSTATE 1000000
+
+ struct R {
+ int count;
+ int state1;
+ int state2;
+ };
+
+ int cmp_d(const R* a, const R* b) {
+ return a->count > b->count;
+ }
+
+ namespace CXX {
+ template<class T, int i1, int i2>
+ inline void qsort (T b[i1][i2], int (*cmp)(const T*, const T*)) {
+ ::qsort ((void*)b, i1*i2, sizeof(T), (int (*)(const void *, const void *))cmp);
+ }
+ }
+
+ using namespace CXX;
+
+ void sort_machine() {
+ struct R d[MAX][MAX];
+ qsort<R,MAX> (d, cmp_d);
+ }
--------------
next reply other threads:[~1998-05-09 3:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-05-09 3:34 Mike Stump [this message]
1998-05-09 11:06 ` Martin von Loewis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199805090945.CAA17945@kithrup.com \
--to=mrs@kithrup.com \
--cc=egcs@cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).