From 87ea6341f2edaf65a43e5ef531a9eac8adf22e44 Mon Sep 17 00:00:00 2001 From: HannesSommer Date: Fri, 21 Nov 2014 22:18:50 +0100 Subject: [PATCH] virtual inheritance for better readability and decoupling --- gtsam_unstable/nonlinear/CallRecord.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gtsam_unstable/nonlinear/CallRecord.h b/gtsam_unstable/nonlinear/CallRecord.h index 9d64384f2..6927a79be 100644 --- a/gtsam_unstable/nonlinear/CallRecord.h +++ b/gtsam_unstable/nonlinear/CallRecord.h @@ -96,7 +96,7 @@ struct ReverseADImplementor; // forward for CallRecord's friend declaration * It is implemented in the function-style ExpressionNode's nested Record class below. */ template -struct CallRecord: private internal::ReverseADInterface { inline void print(const std::string& indent) const { @@ -154,9 +154,10 @@ private: }; template -struct ReverseADImplementor : CallRecord { +struct ReverseADImplementor + : virtual internal::ReverseADInterface { private: - using CallRecord::_reverseAD; + using internal::ReverseADInterface::_reverseAD; const Derived & derived() const { return static_cast(*this); } @@ -177,7 +178,7 @@ private: */ template struct CallRecordImplementor: ReverseADImplementor { + MaxVirtualStaticRows, Cols>, CallRecord{ private: const Derived & derived() const { return static_cast(*this);