Date: Wed, 28 Aug 2019 19:19:54 +0300
May a name of an enumerator coincide with a name of a namespace in a using declaration.
That is whether this using declaration
using N::N;
is valid or not and why.
#include <iostream>
namespace N
{
enum { N = 10 };
void f()
{
std::cout << "N = " << N << '\n';
}
}
using N::N;
void f()
{
std::cout << "N = " << N << '\n';
}
int main()
{
N::f();
f();
return 0;
}
You can meet me at http://cpp.forum24.ru/ or www.stackoverflow.com or http://ru.stackoverflow.com
That is whether this using declaration
using N::N;
is valid or not and why.
#include <iostream>
namespace N
{
enum { N = 10 };
void f()
{
std::cout << "N = " << N << '\n';
}
}
using N::N;
void f()
{
std::cout << "N = " << N << '\n';
}
int main()
{
N::f();
f();
return 0;
}
You can meet me at http://cpp.forum24.ru/ or www.stackoverflow.com or http://ru.stackoverflow.com
Received on 2019-08-28 11:22:00