summaryrefslogtreecommitdiffstats
path: root/libcxx/include
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2015-12-09 22:03:06 +0000
committerEric Fiselier <eric@efcs.ca>2015-12-09 22:03:06 +0000
commitfff5ec035ba5de631ebc75c6f67d7471edef2e3a (patch)
tree2704098bb3153fbce0ddfc97c78035a7efb3aa8f /libcxx/include
parent5d96dc562935da64554bedef819ef2198bd711a6 (diff)
downloadbcm5719-llvm-fff5ec035ba5de631ebc75c6f67d7471edef2e3a.tar.gz
bcm5719-llvm-fff5ec035ba5de631ebc75c6f67d7471edef2e3a.zip
Use __make_integer_seq builtin for std::make_integer_sequence. Patch by K-ballo.
llvm-svn: 255162
Diffstat (limited to 'libcxx/include')
-rw-r--r--libcxx/include/utility14
1 files changed, 13 insertions, 1 deletions
diff --git a/libcxx/include/utility b/libcxx/include/utility
index d476c6b0848..a57e17b3687 100644
--- a/libcxx/include/utility
+++ b/libcxx/include/utility
@@ -680,6 +680,16 @@ struct _LIBCPP_TYPE_VIS_ONLY integer_sequence
template<size_t... _Ip>
using index_sequence = integer_sequence<size_t, _Ip...>;
+#if __has_builtin(__make_integer_seq) && !defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE)
+
+template <class _Tp, _Tp _Ep>
+struct __make_integer_sequence
+{
+ typedef __make_integer_seq<integer_sequence, _Tp, _Ep> type;
+};
+
+#else
+
namespace __detail {
template<typename _Tp, size_t ..._Extra> struct __repeat;
@@ -733,10 +743,12 @@ struct __make_integer_sequence
{
static_assert(is_integral<_Tp>::value,
"std::make_integer_sequence can only be instantiated with an integral type" );
- static_assert(0 <= _Ep, "std::make_integer_sequence input shall not be negative");
+ static_assert(0 <= _Ep, "std::make_integer_sequence must have a non-negative sequence length");
typedef __make_integer_sequence_unchecked<_Tp, _Ep> type;
};
+#endif
+
template<class _Tp, _Tp _Np>
using make_integer_sequence = typename __make_integer_sequence<_Tp, _Np>::type;
OpenPOWER on IntegriCloud