From f0de6e0852d2d7d87d79f4382922670e17cac755 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Mon, 18 Dec 2017 10:56:07 -0800 Subject: [PATCH] [muparser] Remove struct TypeInfo The STL's facilities are totally sufficient here. --- .../include/muParserTemplateMagic.h | 53 ------------------- muparser-2.2.5/samples/example1/example1.cpp | 2 +- muparser-2.2.5/src/muParser.cpp | 3 +- 3 files changed, 3 insertions(+), 55 deletions(-) diff --git a/muparser-2.2.5/include/muParserTemplateMagic.h b/muparser-2.2.5/include/muParserTemplateMagic.h index 69a54c8d2..f87290f2a 100644 --- a/muparser-2.2.5/include/muParserTemplateMagic.h +++ b/muparser-2.2.5/include/muParserTemplateMagic.h @@ -4,59 +4,6 @@ #include namespace mu { -//----------------------------------------------------------------------------------------------- -// -// Compile time type detection -// -//----------------------------------------------------------------------------------------------- - -/** \brief A class singling out integer types at compile time using - template meta programming. -*/ -template -struct TypeInfo { - static bool IsInteger() { return false; } -}; - -template <> -struct TypeInfo { - static bool IsInteger() { return true; } -}; - -template <> -struct TypeInfo { - static bool IsInteger() { return true; } -}; - -template <> -struct TypeInfo { - static bool IsInteger() { return true; } -}; - -template <> -struct TypeInfo { - static bool IsInteger() { return true; } -}; - -template <> -struct TypeInfo { - static bool IsInteger() { return true; } -}; - -template <> -struct TypeInfo { - static bool IsInteger() { return true; } -}; - -template <> -struct TypeInfo { - static bool IsInteger() { return true; } -}; - -template <> -struct TypeInfo { - static bool IsInteger() { return true; } -}; //----------------------------------------------------------------------------------------------- // diff --git a/muparser-2.2.5/samples/example1/example1.cpp b/muparser-2.2.5/samples/example1/example1.cpp index c4733d1dc..398b7f980 100644 --- a/muparser-2.2.5/samples/example1/example1.cpp +++ b/muparser-2.2.5/samples/example1/example1.cpp @@ -158,7 +158,7 @@ ValueOrError SelfTest() { mu::console() << _T( "Running test suite:\n\n"); // Skip the self test if the value type is set to an integer type. - if (mu::TypeInfo::IsInteger()) { + if (std::numeric_limits::is_integer) { mu::console() << _T( " Test skipped: integer data type are not compatible with the unit test!\n\n"); } else { diff --git a/muparser-2.2.5/src/muParser.cpp b/muparser-2.2.5/src/muParser.cpp index 6a8a93219..35f909412 100644 --- a/muparser-2.2.5/src/muParser.cpp +++ b/muparser-2.2.5/src/muParser.cpp @@ -29,6 +29,7 @@ //--- Standard includes ------------------------------------------------------------------------ #include #include +#include #include /** \brief Pi (what else?). */ @@ -237,7 +238,7 @@ static void assertNoError(OptionalError oerr) { //--------------------------------------------------------------------------- /** \brief Initialize the default functions. */ void Parser::InitFun() { - if (mu::TypeInfo::IsInteger()) { + if (std::numeric_limits::is_integer) { // When setting MUP_BASETYPE to an integer type // Place functions for dealing with integer values here // ...