Hi there.
Given the following code, why is class B::A used at point //2 and not
class ::A ?
Does inheriting a class in a namespace put the names of that namespace into
the "name pool" used for unqualified lookup?
Where do I find that in the "Holy Standard" ?
Thanks,
Stefan
// -----SNIP-----
#include <iostream>
class A
{
public:
void print()
{
std::cout << "class ::A" << std::endl;
}
};
namespace B
{
class A
{
public:
void print()
{
std::cout << "class B::A" << std::endl;
};
};
}
template <typename Tclass C
{
public:
T object;
};
class D : public B::A //1
{
public:
void call_print()
{
C<Ac; //2
c.object.print();
};
};
int main()
{
D* test = new D;
test->call_print();
delete test;
return 0;
}
// -----SNAP-----
--
Stefan Naewe stefan dot naewe at atlas-elektronik dot com
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html