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

Compile fixes for MVS.

This commit is contained in:
DjWarmonger 2013-12-03 15:24:13 +00:00
parent 3d3f93275d
commit b3b523b768
3 changed files with 27 additions and 26 deletions

View File

@ -222,12 +222,12 @@ template<typename T, size_t N> char (&_ArrayCountObj(const T (&)[N]))[N];
// should be used for variables that becomes unused in release builds (e.g. only used for assert checks)
#define UNUSED(VAR) ((void)VAR)
/* ---------------------------------------------------------------------------- */
/* VCMI standard library */
/* ---------------------------------------------------------------------------- */
template<typename T>
std::ostream &operator<<(std::ostream &out, const boost::optional<T> &opt)
{
/* ---------------------------------------------------------------------------- */
/* VCMI standard library */
/* ---------------------------------------------------------------------------- */
template<typename T>
std::ostream &operator<<(std::ostream &out, const boost::optional<T> &opt)
{
if(opt)
return out << *opt;
else
@ -264,12 +264,12 @@ namespace vstd
template <typename V, typename Item, typename Item2>
bool contains(const std::map<Item,V> & c, const Item2 &i)
{
return c.find(i)!=c.end();
}
//returns true if unordered set c contains item i
template <typename Item>
bool contains(const std::unordered_set<Item> & c, const Item &i)
return c.find(i)!=c.end();
}
//returns true if unordered set c contains item i
template <typename Item>
bool contains(const std::unordered_set<Item> & c, const Item &i)
{
return c.find(i)!=c.end();
}
@ -463,13 +463,13 @@ namespace vstd
auto tmpItr = itr++;
if(pred(*tmpItr))
setContainer.erase(tmpItr);
}
}
//works for map and std::map, maybe something else
template<typename Key, typename Val, typename Predicate>
void erase_if(std::map<Key, Val> &container, Predicate pred)
{
}
}
//works for map and std::map, maybe something else
template<typename Key, typename Val, typename Predicate>
void erase_if(std::map<Key, Val> &container, Predicate pred)
{
auto itr = container.begin();
auto endItr = container.end();
while(itr != endItr)

View File

@ -24,6 +24,7 @@
#include "../lib/GameConstants.h"
#include "gui/CGuiHandler.h"
#include "gui/CIntObjectClasses.h"
#include "../lib/LogicalExpression.cpp"
using namespace boost::assign;

View File

@ -7,7 +7,7 @@ namespace LogicalExpressionDetail
{
/// class that defines required types for logical expressions
template<typename ContainedClass>
class DLL_LINKAGE ExpressionBase
class ExpressionBase
{
/// Possible logical operations, mostly needed to create different types for boost::variant
enum EOperations
@ -35,7 +35,7 @@ namespace LogicalExpressionDetail
/// Variant element, contains list of expressions to which operation "tag" should be applied
template<EOperations tag>
class DLL_LINKAGE Element
class Element
{
public:
Element() {}
@ -55,7 +55,7 @@ namespace LogicalExpressionDetail
/// Visitor to test result (true/false) of the expression
template <typename ContainedClass>
class DLL_LINKAGE TestVisitor : public boost::static_visitor<bool>
class TestVisitor : public boost::static_visitor<bool>
{
typedef ExpressionBase<ContainedClass> Base;
@ -97,7 +97,7 @@ namespace LogicalExpressionDetail
/// visitor that is trying to generates candidates that must be fulfilled
/// to complete this expression
template <typename ContainedClass>
class DLL_LINKAGE CandidatesVisitor : public boost::static_visitor<std::vector<ContainedClass> >
class CandidatesVisitor : public boost::static_visitor<std::vector<ContainedClass> >
{
typedef ExpressionBase<ContainedClass> Base;
typedef std::vector<typename Base::Value> TValueList;
@ -147,7 +147,7 @@ namespace LogicalExpressionDetail
/// Json parser for expressions
template <typename ContainedClass>
class DLL_LINKAGE Reader
class Reader
{
typedef ExpressionBase<ContainedClass> Base;
@ -189,7 +189,7 @@ namespace LogicalExpressionDetail
/// Prints expression in human-readable format
template <typename ContainedClass>
class DLL_LINKAGE Printer : public boost::static_visitor<std::string>
class Printer : public boost::static_visitor<std::string>
{
typedef ExpressionBase<ContainedClass> Base;
@ -254,7 +254,7 @@ namespace LogicalExpressionDetail
/// Class for evaluation of logical expressions generated in runtime
///
template<typename ContainedClass>
class DLL_LINKAGE LogicalExpression
class LogicalExpression
{
typedef LogicalExpressionDetail::ExpressionBase<ContainedClass> Base;
public: