From d2a7df6540d899894de54e1a3193a9d5a133fbdb Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Tue, 13 Apr 2021 19:28:53 +0200 Subject: [PATCH] fix: clang compilation fixed --- example/kalman_filter/kalman.h | 8 ++++++++ example/kalman_filter/kalman_filter-example_5.cpp | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/example/kalman_filter/kalman.h b/example/kalman_filter/kalman.h index 439dc3a4..48406382 100644 --- a/example/kalman_filter/kalman.h +++ b/example/kalman_filter/kalman.h @@ -22,6 +22,7 @@ #pragma once +#include #include #include #include @@ -74,6 +75,13 @@ public: uncertainty_type uncertainty; }; +#if UNITS_COMP_CLANG == 12 + +template +estimation(state, U) -> estimation; + +#endif + // kalman gain template constexpr units::dimensionless kalman_gain(Q estimate_uncertainty, Q measurement_uncertainty) diff --git a/example/kalman_filter/kalman_filter-example_5.cpp b/example/kalman_filter/kalman_filter-example_5.cpp index b818f19a..cd99ddd6 100644 --- a/example/kalman_filter/kalman_filter-example_5.cpp +++ b/example/kalman_filter/kalman_filter-example_5.cpp @@ -63,11 +63,11 @@ int main() print_header(initial); estimation next = predict(initial); - for(int index = 1; const auto& m : measurements) { + for(int index = 1; const auto& measured : measurements) { const auto& previous = next; const auto gain = kalman_gain(previous.uncertainty, measurement_uncertainty); - const estimation current = update(previous, m, gain); + const estimation current = update(previous, measured, gain); next = predict(current); - print(index++, gain, m, current, next); + print(index++, gain, measured, current, next); } }