diff options
| author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-17 12:09:58 +0000 |
|---|---|---|
| committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-17 12:09:58 +0000 |
| commit | 68ccd75c718e35f9140818ef3f5bf79ce4fb2d0f (patch) | |
| tree | 7cc8c0562fe9d7735677346600fbc8cc7c4d0b05 /libstdc++-v3/include/std/array | |
| parent | a4c4abc3d2395661511573493b2f600665458fda (diff) | |
| download | ppe42-gcc-68ccd75c718e35f9140818ef3f5bf79ce4fb2d0f.tar.gz ppe42-gcc-68ccd75c718e35f9140818ef3f5bf79ce4fb2d0f.zip | |
2012-11-17 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/55363
* include/std/array (tuple_size, tuple_element): Move out
NAMESPACE_CONTAINER.
* testsuite/23_containers/array/tuple_interface/get_neg.cc: Adjust
dg-error line numbers.
* testsuite/23_containers/array/tuple_interface/tuple_element_neg.cc:
Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193584 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/std/array')
| -rw-r--r-- | libstdc++-v3/include/std/array | 49 |
1 files changed, 28 insertions, 21 deletions
diff --git a/libstdc++-v3/include/std/array b/libstdc++-v3/include/std/array index 00d3123225c..a4ecf5a547c 100644 --- a/libstdc++-v3/include/std/array +++ b/libstdc++-v3/include/std/array @@ -263,27 +263,6 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER noexcept(noexcept(__one.swap(__two))) { __one.swap(__two); } - // Tuple interface to class template array. - - /// tuple_size - template<typename _Tp> - class tuple_size; - - template<typename _Tp, std::size_t _Nm> - struct tuple_size<array<_Tp, _Nm>> - : public integral_constant<std::size_t, _Nm> { }; - - /// tuple_element - template<std::size_t _Int, typename _Tp> - class tuple_element; - - template<std::size_t _Int, typename _Tp, std::size_t _Nm> - struct tuple_element<_Int, array<_Tp, _Nm>> - { - static_assert(_Int < _Nm, "index is out of bounds"); - typedef _Tp type; - }; - template<std::size_t _Int, typename _Tp, std::size_t _Nm> constexpr _Tp& get(array<_Tp, _Nm>& __arr) noexcept @@ -313,6 +292,34 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER _GLIBCXX_END_NAMESPACE_CONTAINER } // namespace std +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + + // Tuple interface to class template array. + + /// tuple_size + template<typename _Tp> + class tuple_size; + + template<typename _Tp, std::size_t _Nm> + struct tuple_size<_GLIBCXX_STD_C::array<_Tp, _Nm>> + : public integral_constant<std::size_t, _Nm> { }; + + /// tuple_element + template<std::size_t _Int, typename _Tp> + class tuple_element; + + template<std::size_t _Int, typename _Tp, std::size_t _Nm> + struct tuple_element<_Int, _GLIBCXX_STD_C::array<_Tp, _Nm>> + { + static_assert(_Int < _Nm, "index is out of bounds"); + typedef _Tp type; + }; + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace std + #ifdef _GLIBCXX_DEBUG # include <debug/array> #endif |

