namespace A {
template <class T> struct foo {};
}
namespace B {
template <class T> int foo(const T& i) { return 0; }
}
int main(int, char* []) {
return 0;
}
I get the following error message:
[C++ Error] TemplInNamesp.cpp(10): E2479 Cannot have both a template
class and function named 'foo'
As the two templates are defined in different namespaces I believe the
above program is correct.
Cheers,
Nicola Musatti
Team Mongolian Wok
"Nicola Musatti" <obje...@divalsim.it> wrote in message
news:3BDD798D...@divalsim.it...
If that were not legal, then what problem would namespaces solve?
But it is legal. It's just not legal _without_ the two declarations
being in different namespaces. The point about namespaces is that those
two declarations (quite possibly from two different 3rd party
libraries), should not interfere with each other.
Alan Bellingham
--
Team Mongolian Wok
<url:http://www.borland.com/newsgroups/> Borland newsgroup descriptions
<url:http://www.borland.com/newsgroups/netiquette.html> netiquette
If that isn't what I said, then it's what I meant to say.
>If that isn't what I said, then it's what I meant to say.
Good. (It's just not how I read it.)
So, we're agreed? There's a bug?
> Greg Chicares <chic...@mindspring.com> wrote:
>
> >If that isn't what I said, then it's what I meant to say.
>
> Good. (It's just not how I read it.)
>
> So, we're agreed? There's a bug?
I think so too. I've already reported it.
--
Chris(TeamB);
We're agreed. There's a bug.