libostd/ostd/array.hh

32 lines
644 B
C++
Raw Normal View History

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