delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/06/19/01:54:36

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-Id: <4.1.19990618224925.0093d910@mail.geocities.com>
X-Sender: k_haley AT mail DOT geocities DOT com
X-Mailer: QUALCOMM Windows Eudora Pro Version 4.1
Date: Fri, 18 Jun 1999 23:46:38 -0600
To: cygwin AT sourceware DOT cygnus DOT com
From: "K. Haley" <khaley AT bigfoot DOT com>
Subject: template class limit?
Mime-Version: 1.0

Is there a limit to the number of template classes that can be defined?
I'm trying to compile the OWL 6 libraries, but I keep getting an internal
compiler error while trying to instantiate something in bastring or
stl_alloc.  In tracking down this problem I took the basic hello world
program and included various OWL headers until I found one that caused this
error.  I then started copying the header section by section into the
program until the error occurred.  The error occurred when I included the
following class:

template <class R, class P1, class P2>
class TModuleProc2 : public TModuleProc {
  public:
    TModuleProc2(const TModule& module, LPCSTR id) : TModuleProc(module, id) {}

    R operator ()(P1 p1, P2 p2) {
      typedef R (far WINAPI* TProc)(P1 p1, P2 p2);
      return ((TProc)Proc)(p1, p2);
    }
};

This class is used to call a function in a dll that takes two arguments of
type P1 and P2, and has a return type of R.  There are similar classes that
0 to 13 arguments.  Their is also a variation that returns void.  If I
comment out the body of the operator or the entire function operator the
error disappears.  The same is true when I comment out a function in a
previous template class.  Commenting out a non template class has no
effect.  It looks like later template definitions are stepping on earlier ones.

I've tried the base b20.1 compiler, egcs 1.1.2, and the snapshots from Jan
15, June 3, and June 14 with the same results under win98.  Any help on
this would be appreciated.
---
Just another brain dead computer user.

Kenneth Haley <mailto:khaley AT bigfoot DOT com>
My website if your interested http://www.bigfoot.com/~khaley




--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019