1234567891011121314151617181920212223242526 |
- #include <numeric>
- #include <iostream>
- #include <iterator>
- #include "ra/test.hh"
- int main()
- {
- ra::TestRecorder tr;
- tr.section("iota Flat constexpr");
- {
- constexpr ra::Small<int, 7> a = { 0, 1, 2, 3, 4, 5, 6 };
- constexpr ra::Small<int, 7> v = map([&a](int i) { return a[i]*a[i]; }, ra::iota(7));
- tr.test_eq(v, sqr(a));
- }
- return tr.summary();
- }
|