0
#include <queue>
using namespace std;

namespace {
   class priority_queue;
}

priority_queue pq;

How can I distinguish between the two priority_queue names? I tried ::priority_queue to get the global one but to no avail.

neckutrek
  • 353
  • 2
  • 14

1 Answers1

3

It is simple, just change

using namespace std;

to

//using namespace std;

Now you have to type std::priority_queue for the standard one and priority_queue or ::priority_queue for the custom one.

Mestkon
  • 3,532
  • 7
  • 18