| 1 | #include "test_utility.h" |
| 2 | |
| 3 | #include <cvd/image_ref.h> |
| 4 | |
| 5 | #include <iostream> |
| 6 | |
| 7 | using namespace std; |
| 8 | using namespace CVD; |
| 9 | |
| 10 | constexpr ImageRef foo(ImageRef i) |
| 11 | { |
| 12 | i += ImageRef(3, 3); |
| 13 | ImageRef j = i * 2; |
| 14 | return j <<= 1; |
| 15 | } |
| 16 | |
| 17 | template <int I> |
| 18 | struct Fun |
| 19 | { |
| 20 | }; |
| 21 | |
| 22 | int main() |
| 23 | { |
| 24 | constexpr ImageRef i { 1, 2 }; |
| 25 | cout << foo(i) << endl; |
| 26 | |
| 27 | Fun<i[0]> {}; |
| 28 | Fun<i.x> {}; |
| 29 | |
| 30 | CVD::Testing::assert_equal(ImageRef(16, 20), foo(i)); |
| 31 | } |