problem solved, we really want public inheritance and it is only

automatic when the _child_ class is a struct.
This commit is contained in:
Benoit Jacob
2009-01-05 18:21:44 +00:00
parent 1b88042880
commit 8551505436
3 changed files with 15 additions and 15 deletions

View File

@@ -132,7 +132,7 @@ class Matrix
protected:
ei_matrix_storage<Scalar, MaxSizeAtCompileTime, RowsAtCompileTime, ColsAtCompileTime, Options> m_storage;
public: // FIXME should this be public? I'd say yes but I still don't understand then why at other places we've been having private new and delete operators.
public:
enum { NeedsToAlign = (Options&Matrix_AutoAlign) == Matrix_AutoAlign
&& SizeAtCompileTime!=Dynamic && ((sizeof(Scalar)*SizeAtCompileTime)%16)==0 };
typedef typename ei_meta_if<NeedsToAlign, ei_byte_forcing_aligned_malloc, char>::ret ByteAlignedAsNeeded;

View File

@@ -173,7 +173,7 @@ inline static int ei_alignmentOffset(const Scalar* ptr, int maxOffset)
* overloading the operator new to return aligned data when the vectorization is enabled.
* Here is a similar safe example:
* \code
* struct Foo : WithAlignedOperatorNew {
* struct Foo : public WithAlignedOperatorNew {
* char dummy;
* Vector4f some_vector;
* };
@@ -201,7 +201,7 @@ struct WithAlignedOperatorNew
template<typename T, int SizeAtCompileTime,
bool NeedsToAlign = (SizeAtCompileTime!=Dynamic) && ((sizeof(T)*SizeAtCompileTime)%16==0)>
struct ei_with_aligned_operator_new : WithAlignedOperatorNew {};
struct ei_with_aligned_operator_new : public WithAlignedOperatorNew {};
template<typename T, int SizeAtCompileTime>
struct ei_with_aligned_operator_new<T,SizeAtCompileTime,false> {};