| 68 | { |
| 69 | template <typename TCalculator, typename TIterator> |
| 70 | m2::PointD ApplyPointOnSurfaceCalculator(TIterator begin, TIterator end, TCalculator && calc) |
| 71 | { |
| 72 | std::array<m2::PointD, 3> triangle; |
| 73 | while (begin != end) |
| 74 | { |
| 75 | for (auto i = 0; i < 3; ++i) |
| 76 | { |
| 77 | // Cannot use ASSERT_NOT_EQUAL, due to absence of an approbriate DebugPrint. |
| 78 | ASSERT(begin != end, ("Not enough points to calculate point on surface")); |
| 79 | triangle[i] = *begin++; |
| 80 | } |
| 81 | calc(triangle[0], triangle[1], triangle[2]); |
| 82 | } |
| 83 | return calc.GetResult(); |
| 84 | } |
| 85 | |
| 86 | template <typename TCalculator, typename TIterator> |
| 87 | auto ApplyCalculator(TIterator begin, TIterator end, TCalculator && calc) -> decltype(calc.GetResult()) |
no test coverage detected