adding a private inheritance of B1. Since that base class only has
static members, that does not hurt anyway.
/* ------------------------------------------------- */
/* Problem 17 -- access control: compiler error */
/* Error: B1::dim is not accessible from B1::X<2>. */
/* Where: While specializing "B1::X<2>" */
/* Where: Specialized in non-template code. */
/* Note that "dim" should actually be placed with */
/* B1::X, rather than with B1. */
template <typename T> class V {};
struct B1 {
template <int dim> struct X {
int i[dim];
};
};
struct B2 : private B1 {};
struct D : public B2, private B1 {
~D () {};
typedef B1::X<2> X;
V<X> x;
};
D d;
git-svn-id: https://svn.dealii.org/trunk@5618
0785d39b-7218-0410-832d-
ea1e28bc413d
* the documentation of the members of the @ref{Options} class for a
* description of these flags.
*
+ *
+ * @sect3{Internals}
+ *
+ * To avoid a compiler error in Sun's Forte compiler, we derive
+ * privately from @ref{DataOutBase}. Since the base class
+ * @ref{DataOutInterface} does so as well, this does no harm, but
+ * calms the compiler which is suspecting an access control conflict
+ * otherwise. Testcase here:
+ * @begin{verbatim}
+ * template <typename T> class V {};
+ *
+ * struct B1 {
+ * template <int dim> struct X {
+ * int i[dim];
+ * };
+ * };
+ *
+ * struct B2 : private B1 {};
+ *
+ * struct D : public B2, private B1 {
+ * ~D () {};
+ * typedef B1::X<2> X;
+ * V<X> x;
+ * };
+ *
+ * D d;
+ * @end{verbatim}
+ *
+ *
* @author Wolfgang Bangerth, 2001
*/
-class MatrixOut : public DataOutInterface<2,2>
+class MatrixOut : public DataOutInterface<2,2>,
+ private DataOutBase
{
public:
/**
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams