Mail Archives: djgpp/1997/11/11/13:15:26
From: | Charles Krug <charles AT pentek DOT com>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | More STL woes
|
Date: | Tue, 11 Nov 1997 11:03:42 -0500
|
Lines: | 45
|
Message-ID: | <346881DE.97AEE50F@pentek.com>
|
NNTP-Posting-Host: | mail.pentek.com
|
Mime-Version: | 1.0
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
I fed the following to gxx:
#include <stack.h>
int main()
{
queue<int> fred;
return 0;
}
And got the following error:
d:/djgpp/lang/cxx/stack.h:57: `int' is not an aggregate type
d:/djgpp/lang/cxx/stack.h:57: confused by earlier errors, bailing out
Any thoughts?
class queue (from stack.h):
template <class Container>
class queue {
friend bool operator==(const queue<Container>& x, const
queue<Container>& y);
friend bool operator<(const queue<Container>& x, const queue<Container>&
y);
public:
typedef Container::value_type value_type; // This is line 57
typedef Container::size_type size_type;
protected:
Container c;
public:
bool empty() const { return c.empty(); }
size_type size() const { return c.size(); }
value_type& front() { return c.front(); }
const value_type& front() const { return c.front(); }
value_type& back() { return c.back(); }
const value_type& back() const { return c.back(); }
void push(const value_type& x) { c.push_back(x); }
void pop() { c.pop_front(); }
};
--
Charles Krug, Jr.
- Raw text -