From b3bd3a396c3787fb08a9c2452e2fde8ee6465561 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Sat, 12 Sep 2015 16:36:40 -0500 Subject: [PATCH] Use a private member object instead of public inheritance --- include/deal.II/base/tensor_accessors.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/include/deal.II/base/tensor_accessors.h b/include/deal.II/base/tensor_accessors.h index a80057dd37..f1f3e79336 100644 --- a/include/deal.II/base/tensor_accessors.h +++ b/include/deal.II/base/tensor_accessors.h @@ -484,10 +484,10 @@ namespace TensorAccessors // subsequently stored indices: template - class StoreIndex : public S + class StoreIndex { public: - StoreIndex(S s, int i) : S(s), i_(i) {} + StoreIndex(S s, int i) : s_(s), i_(i) {} typedef StoreIndex > value_type; @@ -502,10 +502,11 @@ namespace TensorAccessors inline typename ReferenceType::type apply(unsigned int j) const { - return S::apply(j)[i_]; + return s_.apply(j)[i_]; } private: + const S s_; const int i_; }; @@ -514,10 +515,10 @@ namespace TensorAccessors // information available to return the actual object. template - class StoreIndex<1, S> : public S + class StoreIndex<1, S> { public: - StoreIndex(S s, int i) : S(s), i_(i) {} + StoreIndex(S s, int i) : s_(s), i_(i) {} typedef typename ValueType::value_type return_type; typedef return_type value_type; @@ -528,6 +529,7 @@ namespace TensorAccessors } private: + const S s_; const int i_; }; -- 2.39.5