diff --git a/src/scripting/vm/vm.h b/src/scripting/vm/vm.h index e451cb80c..4f6b23bc5 100644 --- a/src/scripting/vm/vm.h +++ b/src/scripting/vm/vm.h @@ -561,6 +561,19 @@ struct FieldDesc int BitValue; }; +namespace +{ + // Traits for the types we are interested in + template struct native_is_valid { static const bool value = false; }; + template struct native_is_valid { static const bool value = true; }; + template struct native_is_valid { static const bool value = true; }; + template<> struct native_is_valid { static const bool value = true; }; + template<> struct native_is_valid { static const bool value = true; }; + template<> struct native_is_valid { static const bool value = true; }; + template<> struct native_is_valid { static const bool value = true; }; + template<> struct native_is_valid { static const bool value = true; }; +} + // Compile time validation of direct native functions struct DirectNativeDesc { @@ -582,17 +595,7 @@ struct DirectNativeDesc #undef TP #undef VP - template void ValidateType() { static_assert(is_valid::value, "Argument type is not valid as a direct native parameter or return type"); } - - // Traits for the types we are interested in - template struct is_valid { static const bool value = false; }; - template struct is_valid { static const bool value = true; }; - template struct is_valid { static const bool value = true; }; - template<> struct is_valid { static const bool value = true; }; - template<> struct is_valid { static const bool value = true; }; - template<> struct is_valid { static const bool value = true; }; - template<> struct is_valid { static const bool value = true; }; - template<> struct is_valid { static const bool value = true; }; + template void ValidateType() { static_assert(native_is_valid::value, "Argument type is not valid as a direct native parameter or return type"); } operator void *() const { return Ptr; }