-
Notifications
You must be signed in to change notification settings - Fork 5
/
ra-7.cc
29 lines (22 loc) · 940 Bytes
/
ra-7.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// -*- mode: c++; coding: utf-8 -*-
// ra-ra/test - Regression test relative to const / nonconst.
// (c) Daniel Llorens - 2016
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License as published by the Free
// Software Foundation; either version 3 of the License, or (at your option) any
// later version.
#include <iostream>
#include <iterator>
#include "ra/test.hh"
#include "mpdebug.hh"
using std::cout, std::endl, std::flush, std::tuple, ra::TestRecorder;
using real = double;
int main()
{
TestRecorder tr(std::cout);
ra::Big<ra::Small<int, 2>, 0> b = ra::scalar(ra::Small<int, 2> {3, 4});
// this requires a const/nonconst overload in Scalar::Flat [ra39] because start(Scalar) just forwards.
([&b](auto const & c) { b = c; })(ra::scalar(ra::Small<int, 2> {1, 2}));
tr.test_eq(ra::start({1, 2}), b());
return tr.summary();
}