From: Matthias Maier Date: Sat, 12 Sep 2015 21:36:40 +0000 (-0500) Subject: Use a private member object instead of public inheritance X-Git-Tag: v8.4.0-rc2~433^2~6 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3bd3a396c3787fb08a9c2452e2fde8ee6465561;p=dealii.git Use a private member object instead of public inheritance --- 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_; };