0

I have some base abstract class A like that:

class A
{
  public:
     virtual void foo() = 0;
};

I want to use following map:

 std::map<std::string, const A&> some_map;

But compiler tells that Code declares an instance of an abstract class or structure. It seems for me weird

EDIT: following type works fine:

std::map<std::string, const A*> some_map;
Alex Aparin
  • 4,393
  • 5
  • 25
  • 51

0 Answers0