This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: internal compiler error with template template paramaters (fwd)
- To: egcs-bugs at egcs dot cygnus dot com
- Subject: Re: internal compiler error with template template paramaters (fwd)
- From: "Siemel B. Naran" <sbnaran at physics dot uiuc dot edu>
- Date: Fri, 25 Feb 2000 11:49:25 -0600 (CST)
--
----------------------------------
Siemel B. Naran (sbnaran@uiuc.edu)
----------------------------------
---------- Forwarded message ----------
Date: Fri, 25 Feb 2000 09:16:32 -0800 (PST)
From: daemon@cygnus.com
To: sbnaran@uiuc.edu
Subject: Re: internal compiler error with template template paramaters
Sorry, I am unable to deliver your mail note to egcs-bugs@cygnus.com,
that list name is no longer used. Please try resending your mail
note to the new list name: egcs-bugs@egcs.cygnus.com.
If you have any questions about this, send mail to sourcemaster@cygnus.com.
This is a machine-generated message.
Here is a copy of the note you sent.
-----------------------------------------------------------------------------
#include <string>
#include <vector>
template <template <class T> class Container>
inline
std::string combine(const Container<std::string>& c)
{
//#define Container std::vector
typedef typename Container<std::string>::const_iterator Iter;
// this line should be ok
// but egcs hates it
//#undef Container
Iter iter=c.begin();
const Iter end=c.end();
std::string out;
for ( ; iter!=end; ++iter) { out+=*iter; out+=' '; }
return out;
}
void test_combine()
{
cout << "\ntest_combine\n";
std::vector<std::string> c;
c.push_back("hello");
c.push_back("world");
cout << "c[0]=" << c[0] << '\n';
cout << "c[1]=" << c[1] << '\n';
const std::string result=combine(c);
cout << "result=" << result << '\n';
cout << endl;
}