This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Problems with templates and gcc
- To: pfrancq at ulb dot ac dot be
- Subject: Re: Problems with templates and gcc
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Thu, 16 Mar 2000 21:38:17 +0100
- CC: gcc at gcc dot gnu dot org
- References: <00031610141601.32473@mecapp97.ulb.ac.be>
> The idea is to have a first template function with 2 arguments. A second
> function has the same name but with 1 argument and call the first function
> using his argument and another by default.
Thanks for your bug report. I had a number of problems reproducing it.
> The code works good if the functions are declared and defined in the
> class (this is the configuration activ in the file below).
[...]
> template<class U,bool b> T* Get(const U &u);
> {
> return(0);
> }
It does work good? For me, it gives the error
a.cc:9: parse error before `{'
a.cc:12: semicolon missing after declaration of `Dummy<T,O>'
which I think is a correct error message. If I remove the semicolons,
it compiles fine.
> template<class T,bool O> template<class U,bool b>
> T* Get(const U &u)
> {
> return(0);
> }
In this declaration, how is the compiler supposed to know that you
refer to a method of Dummy? You need to put the class template name in
here somewhere, although I'm not sure about the syntax - please ask in
one of the C++ groups.
Martin