S
syntheticpp
Here a compiler bug of msvc 8 (14.00.50727.42):
fatal error C1060: compiler is out of heap space
Without the virtual inheritance it compiles fine.
GCC has no problems.
Code (tested with Loki 0.1.3):
#include <loki/AbstractFactory.h>
struct Enemy {};
struct Soldier : Enemy {};
struct Monster : Enemy {};
typedef Loki::AbstractFactory
<
AbstractEnemyFactory;
struct SillySoldier : Soldier {};
struct SillyMonster : virtual Monster {}; // <--
typedef Loki::ConcreteFactory
<
AbstractEnemyFactory,
Loki::OpNewFactoryUnit,
EasyLevelFactory;
int main()
{
AbstractEnemyFactory* factory(new EasyLevelFactory );
delete factory;
return 1;
}
fatal error C1060: compiler is out of heap space
Without the virtual inheritance it compiles fine.
GCC has no problems.
Code (tested with Loki 0.1.3):
#include <loki/AbstractFactory.h>
struct Enemy {};
struct Soldier : Enemy {};
struct Monster : Enemy {};
typedef Loki::AbstractFactory
<
AbstractEnemyFactory;
struct SillySoldier : Soldier {};
struct SillyMonster : virtual Monster {}; // <--
typedef Loki::ConcreteFactory
<
AbstractEnemyFactory,
Loki::OpNewFactoryUnit,
EasyLevelFactory;
int main()
{
AbstractEnemyFactory* factory(new EasyLevelFactory );
delete factory;
return 1;
}