Błąd przy kompilacji unordered_map

0

Witam, mam problem z fragmentem kodu:

#pragma once
#include "EntityBase.h"
#include <functional>
#include <map>


using EntityContainer = std::unordered_map<unsigned int, EntityBase*>;
using EntityFactory = std::unordered_map<EntityType, std::function<EntityBase*(void)>>;

Nie potrafię stwierdzić dlaczego nie widzi deklaracji funkcji skoro ma zincludowane obie klasy

title

0
#include <unordered_map>
0
DRK napisał(a):
#include <unordered_map>

Niestety to nic nie zmienia

1

Przecież krzyczy o EntityBase. Pokaż EntityBase.h.

0
twonek napisał(a):

Przecież krzyczy o EntityBase. Pokaż EntityBase.h.

title

1

W EntityManager.h masz

#include "EntityBase.h"

a w EntityBase.h

#include "EntityManager.h"

i wszystko się zapętla.

W EntityBase.h wywal #include "EntityManager.h" i dodaj

class EntityManager;    // forward declaration

No i czy na pewno potrzebujesz friend class EntityManager?

0
twonek napisał(a):

W EntityManager.h masz

#include "EntityBase.h"

a w EntityBase.h

#include "EntityManager.h"

i wszystko się zapętla.

W EntityBase.h wywal #include "EntityManager.h" i dodaj

class EntityManager;    // forward declaration

No i czy na pewno potrzebujesz friend class EntityManager?

Dziękuje za pomoc, program już się kompiluje.

1 użytkowników online, w tym zalogowanych: 0, gości: 1