mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-28 12:13:55 +08:00
[muparser] Remove struct TypeInfo
The STL's facilities are totally sufficient here.
This commit is contained in:
parent
364f58fcfa
commit
f0de6e0852
|
@ -4,59 +4,6 @@
|
|||
#include <cmath>
|
||||
|
||||
namespace mu {
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
//
|
||||
// Compile time type detection
|
||||
//
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
|
||||
/** \brief A class singling out integer types at compile time using
|
||||
template meta programming.
|
||||
*/
|
||||
template <typename T>
|
||||
struct TypeInfo {
|
||||
static bool IsInteger() { return false; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct TypeInfo<char> {
|
||||
static bool IsInteger() { return true; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct TypeInfo<short> {
|
||||
static bool IsInteger() { return true; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct TypeInfo<int> {
|
||||
static bool IsInteger() { return true; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct TypeInfo<long> {
|
||||
static bool IsInteger() { return true; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct TypeInfo<unsigned char> {
|
||||
static bool IsInteger() { return true; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct TypeInfo<unsigned short> {
|
||||
static bool IsInteger() { return true; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct TypeInfo<unsigned int> {
|
||||
static bool IsInteger() { return true; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct TypeInfo<unsigned long> {
|
||||
static bool IsInteger() { return true; }
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
//
|
||||
|
|
|
@ -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<mu::value_type>::IsInteger()) {
|
||||
if (std::numeric_limits<mu::value_type>::is_integer) {
|
||||
mu::console()
|
||||
<< _T( " Test skipped: integer data type are not compatible with the unit test!\n\n");
|
||||
} else {
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
//--- Standard includes ------------------------------------------------------------------------
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
#include <numeric>
|
||||
|
||||
/** \brief Pi (what else?). */
|
||||
|
@ -237,7 +238,7 @@ static void assertNoError(OptionalError oerr) {
|
|||
//---------------------------------------------------------------------------
|
||||
/** \brief Initialize the default functions. */
|
||||
void Parser::InitFun() {
|
||||
if (mu::TypeInfo<mu::value_type>::IsInteger()) {
|
||||
if (std::numeric_limits<mu::value_type>::is_integer) {
|
||||
// When setting MUP_BASETYPE to an integer type
|
||||
// Place functions for dealing with integer values here
|
||||
// ...
|
||||
|
|
Loading…
Reference in New Issue
Block a user