 |
Boost.Hana
1.7.0
Your standard library for metaprogramming
|
|
template<typename T, std::size_t N>
struct std::array< T, N >
Adaptation of std::array
for Hana.
Modeled concepts
Comparable
std::array
s are compared as per std::equal
, except that two arrays with different sizes compare unequal instead of triggering an error and the result of the comparison is constexpr
if both arrays are constexpr
.
#include <array>
int main() { }
Orderable
std::array
s are ordered with the usual lexicographical ordering, except that two arrays with different size can be ordered instead of triggering an error and the result of the comparison is constexpr
if both arrays are constexpr
.
#include <array>
int main() { }
Foldable
Folding an array from the left is equivalent to calling std::accumulate
on it, except it can be constexpr
.
#include <array>
int main() {
return std::array<int,
sizeof...(i)>{{(i + 10)...}};
});
}
Iterable
Iterating over a std::array
is equivalent to iterating over it with a normal for
loop.
#include <array>
static_assert(hana::at_c<2>(a) == 2, "");
int main() { }
Defines boost::hana::less.
Defines boost::hana::equal.
Defines boost::hana::drop_front.
constexpr auto less
Returns a Logical representing whether x is less than y.
Definition: less.hpp:37
#define BOOST_HANA_CONSTANT_CHECK(...)
Equivalent to BOOST_HANA_CONSTANT_ASSERT, but not influenced by the BOOST_HANA_CONFIG_DISABLE_ASSERTI...
Definition: assert.hpp:239
Namespace containing everything in the library.
Definition: accessors.hpp:20
constexpr auto unpack
Invoke a function with the elements of a Foldable as arguments.
Definition: unpack.hpp:79
Defines macros to perform different kinds of assertions.
Adapts std::array for use with Hana.
constexpr auto drop_front
Drop the first n elements of an iterable, and return the rest.
Definition: drop_front.hpp:47
Defines boost::hana::not_equal.
Defines boost::hana::at and boost::hana::at_c.
#define BOOST_HANA_RUNTIME_CHECK(...)
Equivalent to BOOST_HANA_RUNTIME_ASSERT, but not influenced by the BOOST_HANA_CONFIG_DISABLE_ASSERTIO...
Definition: assert.hpp:209
constexpr auto not_equal
Returns a Logical representing whether x is not equal to y.
Definition: not_equal.hpp:54
Adaptation of std::array for Hana.
Definition: array.hpp:64
constexpr auto equal
Returns a Logical representing whether x is equal to y.
Definition: equal.hpp:64
Defines boost::hana::unpack.