🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer.misc
Article #175

Qsort: Member func's? Qsort source code?

#175
From: Keith Bennett
Date: Fri, 01 Dec 1995 00:00
30 lines
1870 bytes
I have an application with several classes containing static compare
functions whose addresses I would like to pass to qsort.  When I
brought this issue up before a year or two ago, I was using C/Set and
there was no way to pass the address of a member function (with
System linkage, I think?) to qsort(), who was expecting function of
Optlink linkage.

Now I am using Visual Age C++ and was wondering if there is a new way
around this problem.  I know I can create a nonmember friend
function, but doing so would require modifying about 50 files, and I
was looking for a less painful solution.  (I know there may not be
any.)

Personally, I wouldn't mind making these modifications, but my client
would prefer a method more awkward, but requiring changes to fewer
files.

Currently we're using our own function taking the same parameters as
qsort, but implementing a simpler but slower algorithm.  Perhaps we
should just find some qsort source code and drop it in there?  Any 
suggestions on where to find such a thing?

Thanks.
- Keith

-- 
--------------------------------------------------------------------------
Keith Bennett                             Bennett Business Solutions, Inc.
Silver Spring, MD USA                     OS/2 & DOS Software Development
kbennett@cpcug.org                        (301) 871-7696
Technical Details
Message-ID: <49noo1$bpk@cpcug.org>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11307a,819060a2f42c5257,start
X-Google-Attributes: gid11307a,public
X-Google-Thread: 10cd94,819060a2f42c5257,start
X-Google-Attributes: gid10cd94,public
From: kbennett@cpcug.org (Keith Bennett)
Subject: Qsort: Member func's?  Qsort source code?
Date: 1995/12/01
Message-ID: <49noo1$bpk@cpcug.org>
X-Deja-AN: 120583484
organization: Express Access Online Communications USA: 800-969-9090
newsgroups: comp.os.os2.programmer.misc,bit.listserv.os2-l