H
hpsoar
can anybody tell me what is wrong with the following class:
#include <iostream>
class GameObject {
public:
virtual ~GameObject() = 0;
virtual void print() = 0;
protected:
std::string name;
pair<int, int> position;
};
GameObject::~GameObject() {
std::cout << "Game object destructed!" << std::endl;
}
the error message is:
ISO C++ forbids declaration of `pair' with no type
when I add "using namespace std" before the class it get right
#include <iostream>
class GameObject {
public:
virtual ~GameObject() = 0;
virtual void print() = 0;
protected:
std::string name;
pair<int, int> position;
};
GameObject::~GameObject() {
std::cout << "Game object destructed!" << std::endl;
}
the error message is:
ISO C++ forbids declaration of `pair' with no type
when I add "using namespace std" before the class it get right