1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-21 21:17:49 +02:00

Compile fix - template specialization is defined before generic template.

This commit is contained in:
DjWarmonger 2013-11-30 07:52:08 +00:00
parent 8be4ca03c8
commit 2f698acf98
2 changed files with 18 additions and 18 deletions

View File

@ -5,7 +5,7 @@
#include "../../lib/CObjectHandler.h"
#include "../../lib/CCreatureHandler.h"
#include "../../lib/VCMI_Lib.h"
//#include "Goals.h"
//#include "Goals.cpp"
//#include "VCAI.h"
/*

View File

@ -74,6 +74,23 @@ std::string Goals::AbstractGoal::name() const //TODO: virtualize
}
}
//TODO: find out why the following are not generated automatically on MVS?
namespace Goals
{
template <>
void CGoal<Win>::accept (VCAI * ai)
{
ai->tryRealize(static_cast<Win&>(*this));
}
template <>
void CGoal<Build>::accept (VCAI * ai)
{
ai->tryRealize(static_cast<Build&>(*this));
}
}
//TSubgoal AbstractGoal::whatToDoToAchieve()
//{
// logAi->debugStream() << boost::format("Decomposing goal of type %s") % name();
@ -868,20 +885,3 @@ void CGoal<T>::accept (VCAI * ai)
ai->tryRealize(static_cast<T&>(*this)); //casting enforces template instantiation
}
//TODO: find out why the following are not generated automatically on MVS?
namespace Goals
{
template <>
void CGoal<Win>::accept (VCAI * ai)
{
ai->tryRealize(static_cast<Win&>(*this));
}
template <>
void CGoal<Build>::accept (VCAI * ai)
{
ai->tryRealize(static_cast<Build&>(*this));
}
}