|
From: | bug-lib-gplusplus-owner |
Subject: | bug-lib-gplusplus post from address@hidden requires approval |
Date: | Mon, 02 Jul 2007 05:14:58 -0400 |
As list administrator, your authorization is requested for the following mailing list posting: List: address@hidden From: address@hidden Subject: Bug report Reason: Post by non-member to a members-only list At your convenience, visit: http://lists.gnu.org/mailman/admindb/bug-lib-gplusplus to approve or deny the request.
--- Begin Message ---Subject: Bug report Dear sir/madam, Date: Mon, 2 Jul 2007 02:14:46 -0700 (PDT)
I'd like to report a bug I encountered some time ago (In SuSE linux 10.0, but the g++ was probably a bit old), I tested it again today with MinGW latest version (in Windows, of course) and I see the problem persists. So I decided I report the bug.
So, here's the bug:
If you have a class template of class, say, T, and have a variable inside that is a template variable of the same T. Now suppose you have a function inside the class template which needs a variable of type variable<T>::some_class. Then the variable would be unrecognized by g++ and produces errors.
Here is a sample code:
#include <iostream>
#include <list>
using namespace std;
template<class T>
class xl
{
public:
list<T> l;
void dump()
{
for (list<T>::iterator i = l.begin(); i != l.end(); ++i)
cout << ((i == l.begin())?"":" ") << *i;
}
};
int main()
{
xl<char *> x;
x.l.push_back("Bug!!");
x.dump();
cout << endl;
return 0;
}
Just changing the T inside the class template to char * for example, will solve the problem. So the error is not related to any part, except what I explained.
Thank you for your efforts,
Shahbaz Yousefi
Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.
--- End Message ---
--- Begin Message ---Subject: confirm 6769e899472c778a2b85e1e72d459ef0764c4c8b If you reply to this message, keeping the Subject: header intact, Mailman will discard the held message. Do this if the message is spam. If you reply to this message and include an Approved: header with the list password in it, the message will be approved for posting to the list. The Approved: header can also appear in the first line of the body of the reply.
--- End Message ---
[Prev in Thread] | Current Thread | [Next in Thread] |