Ensure info() implementation across all SolverBase derived types

This commit is contained in:
Damiano Franzò
2025-05-02 09:56:48 +02:00
committed by Rasmus Munk Larsen
parent f3e7d64f3d
commit 6f1a143418
5 changed files with 52 additions and 0 deletions

View File

@@ -78,6 +78,14 @@ class SolverBase : public EigenBase<Derived> {
template <typename Derived_>
friend struct internal::solve_assertion;
ComputationInfo info() const {
// CRTP static dispatch: Calls the 'info()' method on the derived class.
// Derived must implement 'ComputationInfo info() const'.
// If not implemented, name lookup falls back to this base method, causing
// infinite recursion (detectable by -Winfinite-recursion).
return derived().info();
}
enum {
RowsAtCompileTime = internal::traits<Derived>::RowsAtCompileTime,
ColsAtCompileTime = internal::traits<Derived>::ColsAtCompileTime,