[SUMMARY] Possible bug in DEC C++/Anybody using STL with DEC C++?

From: Tonny Madsen <Tonny.Madsen_at_netman.dk>
Date: Thu, 2 Nov 1995 14:01:55 +0100 (MET)

Hi'

A couple of days ago, I have a problem with compilation of the STL
library with DEC C++ version 1.3. Several people sent the same advice:
upgrade to DEC C++ version 5.1 (despite the version number, there have
only been one release between the two version numbers). Thanks to the
following for the advice:

Selden E Ball Jr <SEB_at_LNS62.LNS.CORNELL.EDU>
Pat Lampert <lampert_at_alf.dec.com>
Lannie Loh <loh_at_tom.alf.dec.com>

[I still have problems compiling STL, but I haven't isolated a small
source fragment yet, that can illustrate the problem]

-- tonny

My original question was:

------------------------------------------------------------
I have a problem compiling the STL library (standard template
library) with DEC C++.

My configuration is:

Alpha server (several different types actual)
Digital UNIX v3.2a
DEC C++ (no version but setld identification CXXBASEA132)
STL distribution from HP (ftp://butler.hpl.hp.com/stl).

The problem seems to be that the compiler doesn't handle classes used
as template arguments correctly inside templates. A template argument
"<class aType>" is legal as aType in the template, but as
aType::subclass.

One example from STL is the definition of the class unary_negate in
.../function.h (approx line 130).

The following example illustrates the problem.

class a {
public:
  typedef int arg; // First typedef
};

class b {
public:
  typedef char *arg; // No error here, so
                                                        // the first typedef
                                                        // wasn't global.
};

a i;
a::arg aa(4); // Uses correct definition
b::arg bb("hej med dig"); // of arg

a::arg func1(int argument); // Legal for function result
void func2(a::arg argument); // and arguments too

template <class aType>
void func3(aType arg1); // Normalt template, aType
                                                        // considered alegal type.

template <class aType>
aType func4(a::arg arg2); // Yet a normalt template

template <class aType>
void func5(aType::arg argument); // Upps error: Missing ")".
                                                        // aType::arg not considered
                                                        // a legal type

template <class aType>
class c {
public:
  aType arg; // OK, aType is a legal type
};

template <class aType>
class d {
public:
  aType::arg arg; // Upps error: Invalid declaration.
};
------------------------------------------------------------
Received on Thu Nov 02 1995 - 15:06:08 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:46 NZDT