1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Fix gcc-14 build

This commit is contained in:
Ivan Savenko 2024-05-17 10:10:06 +00:00
parent dd7991b70f
commit cba49a9952
2 changed files with 12 additions and 9 deletions

View File

@ -18,10 +18,11 @@ class AIGateway;
namespace Goals
{
template<typename T> class DLL_EXPORT CGoal : public AbstractGoal
template<typename T>
class DLL_EXPORT CGoal : public AbstractGoal
{
public:
CGoal<T>(EGoals goal = INVALID) : AbstractGoal(goal)
CGoal(EGoals goal = INVALID) : AbstractGoal(goal)
{
isAbstract = true;
value = 0;
@ -32,7 +33,7 @@ namespace Goals
town = nullptr;
}
CGoal<T> * clone() const override
CGoal * clone() const override
{
return new T(static_cast<T const &>(*this)); //casting enforces template instantiation
}
@ -70,15 +71,16 @@ namespace Goals
}
};
template<typename T> class DLL_EXPORT ElementarGoal : public CGoal<T>, public ITask
template<typename T>
class DLL_EXPORT ElementarGoal : public CGoal<T>, public ITask
{
public:
ElementarGoal<T>(EGoals goal = INVALID) : CGoal<T>(goal), ITask()
ElementarGoal(EGoals goal = INVALID) : CGoal<T>(goal), ITask()
{
AbstractGoal::isAbstract = false;
}
ElementarGoal<T>(const ElementarGoal<T> & other) : CGoal<T>(other), ITask(other)
ElementarGoal(const ElementarGoal<T> & other) : CGoal<T>(other), ITask(other)
{
}

View File

@ -18,10 +18,11 @@ class VCAI;
namespace Goals
{
template<typename T> class DLL_EXPORT CGoal : public AbstractGoal
template<typename T>
class DLL_EXPORT CGoal : public AbstractGoal
{
public:
CGoal<T>(EGoals goal = INVALID) : AbstractGoal(goal)
CGoal(EGoals goal = INVALID) : AbstractGoal(goal)
{
priority = 0;
isElementar = false;
@ -56,7 +57,7 @@ namespace Goals
return f->evaluate(static_cast<T &>(*this)); //casting enforces template instantiation
}
CGoal<T> * clone() const override
CGoal * clone() const override
{
return new T(static_cast<T const &>(*this)); //casting enforces template instantiation
}