Reorganized polyfills

This commit is contained in:
Benoit Blanchon
2018-05-17 13:46:23 +02:00
parent 4592f23260
commit 58cb793c96
62 changed files with 431 additions and 378 deletions

View File

@@ -30,13 +30,13 @@ struct CharPointerTraits {
static const bool has_append = false;
static const bool has_equals = true;
static const bool should_duplicate = !IsConst<TChar>::value;
static const bool should_duplicate = !is_const<TChar>::value;
};
// char*, unsigned char*, signed char*
// const char*, const unsigned char*, const signed char*
template <typename TChar>
struct StringTraits<TChar*, typename EnableIf<IsChar<TChar>::value>::type>
struct StringTraits<TChar*, typename enable_if<sizeof(TChar) == 1>::type>
: CharPointerTraits<TChar> {};
}
}
} // namespace Internals
} // namespace ArduinoJson

View File

@@ -6,11 +6,7 @@
#include <string.h>
#include "../Configuration.hpp"
#include "../TypeTraits/EnableIf.hpp"
#include "../TypeTraits/IsBaseOf.hpp"
#include "../TypeTraits/IsChar.hpp"
#include "../TypeTraits/IsConst.hpp"
#include "../TypeTraits/RemoveReference.hpp"
#include "../Polyfills/type_traits.hpp"
namespace ArduinoJson {
namespace Internals {
@@ -26,8 +22,8 @@ struct StringTraits<const TString, void> : StringTraits<TString> {};
template <typename TString>
struct StringTraits<TString&, void> : StringTraits<TString> {};
}
}
} // namespace Internals
} // namespace ArduinoJson
#include "CharPointer.hpp"
#include "FlashString.hpp"