| 75 | |
| 76 | template<typename QuaternionType> |
| 77 | void check_stdlist_quaternion(const QuaternionType&) |
| 78 | { |
| 79 | typedef typename QuaternionType::Coefficients Coefficients; |
| 80 | QuaternionType x(Coefficients::Random()), y(Coefficients::Random()); |
| 81 | std::list<QuaternionType,Eigen::aligned_allocator<QuaternionType> > v(10), w(20, y); |
| 82 | v.front() = x; |
| 83 | w.front() = w.back(); |
| 84 | VERIFY_IS_APPROX(w.front(), w.back()); |
| 85 | v = w; |
| 86 | |
| 87 | typename std::list<QuaternionType,Eigen::aligned_allocator<QuaternionType> >::iterator vi = v.begin(); |
| 88 | typename std::list<QuaternionType,Eigen::aligned_allocator<QuaternionType> >::iterator wi = w.begin(); |
| 89 | for(int i = 0; i < 20; i++) |
| 90 | { |
| 91 | VERIFY_IS_APPROX(*vi, *wi); |
| 92 | ++vi; |
| 93 | ++wi; |
| 94 | } |
| 95 | |
| 96 | v.resize(21); |
| 97 | v.back() = x; |
| 98 | VERIFY_IS_APPROX(v.back(), x); |
| 99 | v.resize(22,y); |
| 100 | VERIFY_IS_APPROX(v.back(), y); |
| 101 | v.push_back(x); |
| 102 | VERIFY_IS_APPROX(v.back(), x); |
| 103 | } |
| 104 | |
| 105 | void test_stdlist() |
| 106 | { |