Removed constexpr use to support VS2013

This commit is contained in:
Thomas "elfprince13" Dickerson 2017-01-10 23:20:48 -05:00
parent 1c2b096a72
commit d64e2a7019
4 changed files with 7 additions and 8 deletions

View file

@ -39,7 +39,7 @@
#include "console/engineStructs.h" #include "console/engineStructs.h"
#endif #endif
template<typename T> constexpr T nullAsType(){ return nullptr; } template<typename T> inline const T nullAsType(){ return nullptr; }
/// @file /// @file
/// Legacy TS-based console type definitions. /// Legacy TS-based console type definitions.

View file

@ -542,7 +542,7 @@ namespace engineAPI{
template<size_t ...I> struct Gens<0, I...>{ typedef Seq<I...> type; }; template<size_t ...I> struct Gens<0, I...>{ typedef Seq<I...> type; };
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType; typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
static constexpr S32 NUM_ARGS = sizeof...(ArgTs) + startArgc; static const S32 NUM_ARGS = sizeof...(ArgTs) + startArgc;
template<size_t index, size_t method_offset = 0, typename ...RealArgTs> template<size_t index, size_t method_offset = 0, typename ...RealArgTs>
static IthArgType<index> getRealArgValue(S32 argc, ConsoleValueRef *argv, const _EngineFunctionDefaultArguments< void(RealArgTs...) >& defaultArgs) static IthArgType<index> getRealArgValue(S32 argc, ConsoleValueRef *argv, const _EngineFunctionDefaultArguments< void(RealArgTs...) >& defaultArgs)
@ -599,7 +599,7 @@ public:
typedef typename Helper::FunctionType FunctionType; typedef typename Helper::FunctionType FunctionType;
typedef typename Helper::ReturnType ReturnType; typedef typename Helper::ReturnType ReturnType;
template<typename Frame> using MethodType = typename Helper::template MethodType<Frame>; template<typename Frame> using MethodType = typename Helper::template MethodType<Frame>;
static constexpr S32 NUM_ARGS = Helper::NUM_ARGS; static const S32 NUM_ARGS = Helper::NUM_ARGS;
static ReturnType thunk( S32 argc, ConsoleValueRef *argv, FunctionType fn, const _EngineFunctionDefaultArguments< void(ArgTs...) >& defaultArgs) static ReturnType thunk( S32 argc, ConsoleValueRef *argv, FunctionType fn, const _EngineFunctionDefaultArguments< void(ArgTs...) >& defaultArgs)
{ {
@ -622,7 +622,7 @@ public:
typedef typename Helper::FunctionType FunctionType; typedef typename Helper::FunctionType FunctionType;
typedef typename Helper::ReturnType ReturnType; typedef typename Helper::ReturnType ReturnType;
template<typename Frame> using MethodType = typename Helper::template MethodType<Frame>; template<typename Frame> using MethodType = typename Helper::template MethodType<Frame>;
static constexpr S32 NUM_ARGS = Helper::NUM_ARGS; static const S32 NUM_ARGS = Helper::NUM_ARGS;
static void thunk( S32 argc, ConsoleValueRef *argv, FunctionType fn, const _EngineFunctionDefaultArguments< void(ArgTs...) >& defaultArgs) static void thunk( S32 argc, ConsoleValueRef *argv, FunctionType fn, const _EngineFunctionDefaultArguments< void(ArgTs...) >& defaultArgs)
{ {
@ -1162,7 +1162,7 @@ struct _BaseEngineConsoleCallbackHelper
public: public:
/// Matches up to storeArgs. /// Matches up to storeArgs.
static constexpr U32 MAX_ARGUMENTS = 11; static const U32 MAX_ARGUMENTS = 11;
SimObject* mThis; SimObject* mThis;
S32 mInitialArgc; S32 mInitialArgc;

View file

@ -105,8 +105,7 @@ private:
template<typename ...TailTs, size_t ...I> template<typename ...TailTs, size_t ...I>
static void copyHelper(std::tuple<DefVST<ArgTs> ...> &args, std::tuple<DefVST<TailTs> ...> &defaultArgs, Seq<I...>) { static void copyHelper(std::tuple<DefVST<ArgTs> ...> &args, std::tuple<DefVST<TailTs> ...> &defaultArgs, Seq<I...>) {
constexpr size_t offset = (sizeof...(ArgTs) - sizeof...(TailTs)); std::tie(std::get<I + (sizeof...(ArgTs) - sizeof...(TailTs))>(args)...) = defaultArgs;
std::tie(std::get<I + offset>(args)...) = defaultArgs;
} }
template<typename ...TailTs> using MaybeSelfEnabled = typename std::enable_if<sizeof...(TailTs) <= sizeof...(ArgTs), decltype(mArgs)>::type; template<typename ...TailTs> using MaybeSelfEnabled = typename std::enable_if<sizeof...(TailTs) <= sizeof...(ArgTs), decltype(mArgs)>::type;

View file

@ -97,7 +97,7 @@ public:
{ {
eCommandType type; // Command type eCommandType type; // Command type
StringTableEntry name; // Command name StringTableEntry name; // Command name
static constexpr U32 MAX_ARGS = 10; static const U32 MAX_ARGS = 10;
String argv[MAX_ARGS]; // Command arguments String argv[MAX_ARGS]; // Command arguments
S32 argc; // Number of arguments S32 argc; // Number of arguments
Command() : type(CmdInvalid), name(0), argc(0) { } Command() : type(CmdInvalid), name(0), argc(0) { }