Problem with a map default argument initialization
Julie Deslongchamps
JDeslon@orthosoft.ca
Tue Feb 4 16:07:00 GMT 2003
Hi!
I have a compilation problem here. Please take a look at the code below :
#include <map>
#include<vector>
#include<string>
using namespace std;
map<string, string> bar();
typedef map<string, string> MyMap;
class Foo
{
public:
Foo(const MyMap &bar = MyMap());
Foo(const map<string, string> &bar=map<string, string>());
Foo(const vector<string> &bar = vector<string>());
};
In the second constructor Foo(const map<string, string> &bar=map<string,
string>());, the compiler says that there is a parse error before '>' token.
To have a workaround, I typedefed the map and everything works fine (as showed
in the first constructor). Am I missing something? Is there a bug with the
compiler? I use gcc version 3.2.
Thank you for you help,
Best regards,
Julie Deslongchamps
--
Julie Deslongchamps
Software Developer www.orthosoft.ca
tel: (514) 861-1837 X 272 JDeslon@orthosoft.ca
O R T H O s o f t Inc.
More information about the Gcc
mailing list