Skip to content

Commit

Permalink
[filter] deducing this
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancoisCarouge committed Oct 11, 2024
1 parent dc6a05f commit ae7d55b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
15 changes: 4 additions & 11 deletions include/fcarouge/internal/kalman.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,10 @@ inline constexpr kalman<Filter>::kalman(Arguments... arguments)
: filter(internal::filter<implementation>(arguments...)) {}

template <typename Filter>
[[nodiscard("The returned state estimate column vector X is unexpectedly "
"discarded.")]] inline constexpr auto
kalman<Filter>::x() const -> const state & {
return filter.x;
}

template <typename Filter>
[[nodiscard("The returned state estimate column vector X is unexpectedly "
"discarded.")]] inline constexpr auto
kalman<Filter>::x() -> state & {
return filter.x;
[[nodiscard(
"The returned state estimate column vector X is unexpectedly discarded.")]]
inline constexpr auto &&kalman<Filter>::x(this auto &&self) {
return std::forward<decltype(self)>(self).filter.x;
}

template <typename Filter>
Expand Down
4 changes: 2 additions & 2 deletions include/fcarouge/kalman.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ class kalman final : public internal::conditional_member_types<Filter> {
//!
//! @todo Collapse cv-ref qualifier-aware member functions per C++23 P0847 to
//! avoid duplication: `inline constexpr auto & x(this auto&& self)`.
inline constexpr auto x() const -> const state &;
inline constexpr auto x() -> state &;

inline constexpr auto &&x(this auto &&self);

//! @brief Sets the state estimate column vector X.
//!
Expand Down

0 comments on commit ae7d55b

Please sign in to comment.