Answer the question
In order to leave comments, you need to log in
Why can I create a map with my class without overloading operator
there is a class
class Item {
private:
string name;
int price;
Category *category;
public:
Item( ... );
~Item();
//code
};
class Order {
private:
static int number;
Customer *const customer;
map<Item*, int> *items;
public:
Order( ... );
~Order();
//code
};
items = new map<Item*, int>;
items->insert(std::pair<Item*, int>(item, 1));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question