提交 9b07504e 编写于 作者: N Niels

fix for #166

上级 3905406f
...@@ -386,6 +386,7 @@ I deeply appreciate the help of the following people. ...@@ -386,6 +386,7 @@ I deeply appreciate the help of the following people.
- [ZahlGraf](https://github.com/ZahlGraf) added a workaround that allows compilation using Android NDK. - [ZahlGraf](https://github.com/ZahlGraf) added a workaround that allows compilation using Android NDK.
- [whackashoe](https://github.com/whackashoe) replaced a function that was marked as unsafe by Visual Studio. - [whackashoe](https://github.com/whackashoe) replaced a function that was marked as unsafe by Visual Studio.
- [406345](https://github.com/406345) fixed two small warnings. - [406345](https://github.com/406345) fixed two small warnings.
- [Glen Fernandes](https://github.com/glenfe) noted a potential portability problem in the `has_mapped_type` function.
Thanks a lot for helping out! Thanks a lot for helping out!
......
...@@ -94,9 +94,9 @@ struct has_mapped_type ...@@ -94,9 +94,9 @@ struct has_mapped_type
{ {
private: private:
template<typename C> static char test(typename C::mapped_type*); template<typename C> static char test(typename C::mapped_type*);
template<typename C> static int test(...); template<typename C> static char (&test(...))[2];
public: public:
enum { value = sizeof(test<T>(0)) == sizeof(char) }; static constexpr bool value = sizeof(test<T>(0)) == 1;
}; };
/// "equality" comparison for floating point numbers /// "equality" comparison for floating point numbers
......
...@@ -94,9 +94,9 @@ struct has_mapped_type ...@@ -94,9 +94,9 @@ struct has_mapped_type
{ {
private: private:
template<typename C> static char test(typename C::mapped_type*); template<typename C> static char test(typename C::mapped_type*);
template<typename C> static int test(...); template<typename C> static char (&test(...))[2];
public: public:
enum { value = sizeof(test<T>(0)) == sizeof(char) }; static constexpr bool value = sizeof(test<T>(0)) == 1;
}; };
/// "equality" comparison for floating point numbers /// "equality" comparison for floating point numbers
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册