diff --git a/src/type_traits b/src/type_traits index fa1de40c..885cbfa7 100644 --- a/src/type_traits +++ b/src/type_traits @@ -28,61 +28,66 @@ #pragma GCC visibility push(default) namespace std{ - - struct _UCXXEXPORT __true_type{}; - struct _UCXXEXPORT __false_type{}; - - template class _UCXXEXPORT __is_integer{ - public: - typedef __false_type value; - }; - - template <> class _UCXXEXPORT __is_integer { - public: - typedef __true_type value; - }; - - template <> class _UCXXEXPORT __is_integer { - public: - typedef __true_type value; - }; - - template <> class _UCXXEXPORT __is_integer { - public: - typedef __true_type value; - }; - - template <> class _UCXXEXPORT __is_integer { - public: - typedef __true_type value; - }; - - template <> class _UCXXEXPORT __is_integer { - public: - typedef __true_type value; - }; - - template <> class _UCXXEXPORT __is_integer { - public: - typedef __true_type value; - }; - - template <> class _UCXXEXPORT __is_integer { - public: - typedef __true_type value; - }; - - template <> class _UCXXEXPORT __is_integer { - public: - typedef __true_type value; - }; - - template <> class _UCXXEXPORT __is_integer { - public: - typedef __true_type value; - }; - - + template + struct integral_constant + { + static constexpr _Tp value = __v; + typedef _Tp value_type; + typedef integral_constant<_Tp, __v> type; + constexpr operator value_type() const { return value; } + }; + + template + constexpr _Tp integral_constant<_Tp, __v>::value; + + typedef integral_constant true_type; + + typedef integral_constant false_type; + + template + class _UCXXEXPORT __is_integral_helper + : public false_type { }; + + template <> + class _UCXXEXPORT __is_integral_helper + : public true_type { }; + + template <> + class _UCXXEXPORT __is_integral_helper + : public true_type { }; + + template <> + class _UCXXEXPORT __is_integral_helper + : public true_type { }; + + template <> + class _UCXXEXPORT __is_integral_helper + : public true_type { }; + + template <> + class _UCXXEXPORT __is_integral_helper + : public true_type { }; + + template <> + class _UCXXEXPORT __is_integral_helper + : public true_type { }; + + template <> + class _UCXXEXPORT __is_integral_helper + : public true_type { }; + + template <> + class _UCXXEXPORT __is_integral_helper + : public true_type { }; + + template <> + class _UCXXEXPORT __is_integral_helper + : public true_type { }; + + template + struct is_integral + : public __is_integral_helper<_Tp>::type + { }; } diff --git a/src/vector b/src/vector index 1c113e37..7fd38e2c 100644 --- a/src/vector +++ b/src/vector @@ -292,13 +292,13 @@ namespace std{ } template - inline void _dispatch_insert(iterator position, InputIterator first, InputIterator last, __true_type) + inline void _dispatch_insert(iterator position, InputIterator first, InputIterator last, true_type) { _insert_fill(position, first, last); } template - inline void _dispatch_insert(iterator position, InputIterator first, InputIterator last, __false_type) + inline void _dispatch_insert(iterator position, InputIterator first, InputIterator last, false_type) { _insert_from_iterator(position, first, last); } @@ -308,7 +308,7 @@ namespace std{ } template inline void insert(iterator position, InputIterator first, InputIterator last){ - typedef typename __is_integer::value __some_type; + typedef typename is_integral::value __some_type; _dispatch_insert(position, first, last, __some_type()); }