I'm starting with C++ and I'm trying to expand std::map class via composition.
I want to use this class CardPackage to have a private map of ids and pointers to my EntityCards and implement three methods AddCard, GetCard and RemoveCard that will access the private map m.
The issue is that I have not been able to work with m methods (find and end) because I get the following error message:
expression must have a pointer type
I understand that m needs to be a pointer to be accessed by arrow notation (or dot) but I can't figure out to adapt the code to respect my requirements.
Header:
#include <EntityCard.h>
class CardPackage
{
public:
CardPackage();
~CardPackage();
void AddCard(EntityCard* card);
EntityCard* GetCard(int id);
bool RemoveCard(int id);
private:
    map<int, EntityCard*> m;
};
Source:
#include "CardPackage.h"
CardPackage::CardPackage()
{
}
CardPackage::~CardPackage()
{
}
   void CardPackage::AddCard(EntityCard *card)
   {
        m[card->ID] = card;
   }
EntityCard* CardPackage::GetCard(int id)
{
    if (id < 1) { return nullptr; }
    if(m->find(id) == m->end())
    {
        return (m[id]);
    }
    else
    {
        return nullptr;
    }
}
bool CardPackage::RemoveCard(int id)
{
    //TODO
    return false;
}
 
    