diff options
| author | Eric Fiselier <eric@efcs.ca> | 2015-03-17 15:08:03 +0000 |
|---|---|---|
| committer | Eric Fiselier <eric@efcs.ca> | 2015-03-17 15:08:03 +0000 |
| commit | 57f00f2f9ce96f474beba7394be05be56fce720d (patch) | |
| tree | 92b216d6aa603cdaa4f83f4f7a4e2815ddbe7807 /libcxx/include/array | |
| parent | cb84eebb527a63b2775dbf4628f0112977d8cec9 (diff) | |
| download | bcm5719-llvm-57f00f2f9ce96f474beba7394be05be56fce720d.tar.gz bcm5719-llvm-57f00f2f9ce96f474beba7394be05be56fce720d.zip | |
[libcxx] Move tuple_size and tuple_element overloads for pair and array out of !defined(_LIBCPP_HAS_NO_VARIADICS) block.
Summary:
There is no reason to guard `tuple_size`, `tuple_element` and `get<I>(...)` for pair and array inside of `<__tuple>` so that they are only available when we have variadic templates.
This requires there be redundant declarations and definitions. It also makes it easy to get things wrong.
For example the following code should compile (and does in c++11).
```
#define _LIBCPP_HAS_NO_VARIADICS
#include <array>
int main()
{
static_assert((std::tuple_size<std::array<int, 10> volatile>::value == 10), "");
}
```
This patch lifts the non-variadic parts of `tuple_size`, `tuple_types`, and `get<I>(...)` to the top of `<__tuple>` where they don't require variadic templates. This patch also removes `<__tuple_03>` because there is no longer a need for it.
Reviewers: danalbert, K-ballo, mclow.lists
Reviewed By: mclow.lists
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D7774
llvm-svn: 232492
Diffstat (limited to 'libcxx/include/array')
| -rw-r--r-- | libcxx/include/array | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/libcxx/include/array b/libcxx/include/array index d37075da1a2..2e02a43ed52 100644 --- a/libcxx/include/array +++ b/libcxx/include/array @@ -288,10 +288,6 @@ template <class _Tp, size_t _Size> class _LIBCPP_TYPE_VIS_ONLY tuple_size<array<_Tp, _Size> > : public integral_constant<size_t, _Size> {}; -template <class _Tp, size_t _Size> -class _LIBCPP_TYPE_VIS_ONLY tuple_size<const array<_Tp, _Size> > - : public integral_constant<size_t, _Size> {}; - template <size_t _Ip, class _Tp, size_t _Size> class _LIBCPP_TYPE_VIS_ONLY tuple_element<_Ip, array<_Tp, _Size> > { @@ -300,13 +296,6 @@ public: }; template <size_t _Ip, class _Tp, size_t _Size> -class _LIBCPP_TYPE_VIS_ONLY tuple_element<_Ip, const array<_Tp, _Size> > -{ -public: - typedef const _Tp type; -}; - -template <size_t _Ip, class _Tp, size_t _Size> inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 _Tp& get(array<_Tp, _Size>& __a) _NOEXCEPT |

