3 #include <opals/fwd.hpp>
6 #include <initializer_list>
44 template<
class T, std::
size_t N>
45 class Array :
public std::array<T, N>
49 Array(std::initializer_list<T> init)
58 template <
typename T2>
61 std::copy(that.begin(), that.end(), this->begin());
65 template <
typename T2>
66 Array& operator=(
const T2(&that)[N])
68 std::copy(that, &that[N], this->begin());
72 template <
typename T2>
73 Array& operator=(
const std::array<T2, N>& that)
75 std::copy(that.begin(), that.end(), this->begin());
79 template <
typename T2>
80 Array& operator=(std::initializer_list<T2> that)
82 std::copy(that.begin(), that.begin() + std::min(this->size(), that.size()), this->begin());
88 template<
class T, std::
size_t N>
90 return static_cast<const std::array<T, N>&
>(l) ==
static_cast<const std::array<T, N>&
>(r);
94 template<
class T, std::
size_t N>
95 bool operator< (
const Array<T, N>& l,
const Array<T, N>& r) {
96 return static_cast<const std::array<T, N>&
>(l) <
static_cast<const std::array<T, N>&
>(r);
100 template<
class T, std::
size_t N>
101 bool operator!= (
const Array<T, N>& l,
const Array<T, N>& r) {
102 return static_cast<const std::array<T, N>&
>(l) !=
static_cast<const std::array<T, N>&
>(r);
106 template<
class T, std::
size_t N>
107 bool operator> (
const Array<T, N>& l,
const Array<T, N>& r) {
108 return static_cast<const std::array<T, N>&
>(l) >
static_cast<const std::array<T, N>&
>(r);
112 template<
class T, std::
size_t N>
113 bool operator<= (
const Array<T, N>& l,
const Array<T, N>& r) {
114 return static_cast<const std::array<T, N>&
>(l) <=
static_cast<const std::array<T, N>&
>(r);
118 template<
class T, std::
size_t N>
119 bool operator>= (
const Array<T, N>& l,
const Array<T, N>& r) {
120 return static_cast<const std::array<T, N>&
>(l) >=
static_cast<const std::array<T, N>&
>(r);
124 template<
class T, std::
size_t N>
125 void swap(Array<T, N>& l, Array<T, N>& r) {
126 swap(
static_cast<std::array<T, N>&
>(l),
static_cast<std::array<T, N>&
>(r) );