2017-01-25 22:46:48 +00:00
|
|
|
/* OctaSTD extensions for std::array.
|
2015-04-21 16:57:20 +00:00
|
|
|
*
|
|
|
|
* This file is part of OctaSTD. See COPYING.md for futher information.
|
|
|
|
*/
|
|
|
|
|
2015-07-13 19:08:55 +00:00
|
|
|
#ifndef OSTD_ARRAY_HH
|
|
|
|
#define OSTD_ARRAY_HH
|
2015-04-21 16:57:20 +00:00
|
|
|
|
2017-01-25 22:46:48 +00:00
|
|
|
#include <array>
|
2015-04-21 16:57:20 +00:00
|
|
|
|
2015-07-13 19:08:55 +00:00
|
|
|
#include "ostd/range.hh"
|
2015-04-21 16:57:20 +00:00
|
|
|
|
2015-07-13 19:07:14 +00:00
|
|
|
namespace ostd {
|
2015-06-03 22:10:10 +00:00
|
|
|
|
2017-01-25 22:46:48 +00:00
|
|
|
template<typename T, size_t N>
|
2017-01-25 23:27:54 +00:00
|
|
|
struct ranged_traits<std::array<T, N>> {
|
|
|
|
static PointerRange<T> iter(std::array<T, N> &v) {
|
|
|
|
return PointerRange<T>{v.data(), N};
|
|
|
|
}
|
|
|
|
};
|
2015-07-11 15:07:52 +00:00
|
|
|
|
2017-01-25 22:46:48 +00:00
|
|
|
template<typename T, size_t N>
|
2017-01-25 23:27:54 +00:00
|
|
|
struct ranged_traits<std::array<T, N> const> {
|
|
|
|
static PointerRange<T const> iter(std::array<T, N> const &v) {
|
|
|
|
return PointerRange<T const>{v.data(), N};
|
|
|
|
}
|
|
|
|
};
|
2015-07-11 15:07:52 +00:00
|
|
|
|
2015-07-13 19:07:14 +00:00
|
|
|
} /* namespace ostd */
|
2015-04-21 16:57:20 +00:00
|
|
|
|
2016-02-07 21:17:15 +00:00
|
|
|
#endif
|