This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

template class limit?


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@bigfoot.com>
My website if your interested http://www.bigfoot.com/~khaley




--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]