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:
parent
8be4ca03c8
commit
2f698acf98
@ -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"
|
||||
|
||||
/*
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user