Will the following code compile?

namespace {
  void Foo() { }
}

namespace {
  void Foo() { }
}
Explanation
No, it won't since the second unnamed namespace in the same compilation unit attempts to override the same function as the first one does.
C++
C++ Quiz
Start Quiz

or Read more about C++ Quiz

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback