Changeset bfa86e5 in mainline
- Timestamp:
- 2018-07-05T21:41:20Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c06328da
- Parents:
- 55cd829
- git-author:
- Dzejrou <dzejrou@…> (2018-04-07 15:00:23)
- git-committer:
- Dzejrou <dzejrou@…> (2018-07-05 21:41:20)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/cpp/include/impl/array.hpp
r55cd829 rbfa86e5 179 179 180 180 // TODO: tuple interface for array 23.3.2.9 181 /** 182 * 23.3.2.9, tuple interface for class template array: 183 */ 184 185 template<class> 186 struct tuple_size; 187 188 template<class T, size_t N> 189 struct tuple_size<array<T, N>> 190 : integral_constant<size_t, N> 191 { /* DUMMY BODY */ }; 192 193 template<size_t, class> 194 struct tuple_element; 195 196 template<size_t I, class T, size_t N> 197 struct tuple_element<I, array<T, N>> 198 : aux::type_is<T> 199 { /* DUMMY BODY */ }; 200 201 template<size_t I, class T, size_t N> 202 constexpr T& get(array<T, N>& arr) noexcept 203 { 204 static_assert(I < N, "index out of bounds"); 205 206 return arr[I]; 207 } 208 209 template<size_t I, class T, size_t N> 210 constexpr T&& get(array<T, N>&& arr) noexcept 211 { 212 return move(get<I>(arr)); 213 } 214 215 template<size_t I, class T, size_t N> 216 constexpr const T& get(const array<T, N>& arr) noexcept 217 { 218 static_assert(I < N, "index out of bounds"); 219 220 return arr[I]; 221 } 181 222 } 182 223
Note:
See TracChangeset
for help on using the changeset viewer.