]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Work around the following bug in Sun's Forte compiler, by simply
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 25 Mar 2002 16:13:44 +0000 (16:13 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 25 Mar 2002 16:13:44 +0000 (16:13 +0000)
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

deal.II/lac/include/lac/matrix_out.h

index ea4011757ba8021d3f6ce926c3492b41e9d16d07..546ae2f3d5e2e90704e8185cd9dff5e72efd63f7 100644 (file)
  * 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


Typeset in Trocchi and Trocchi Bold Sans Serif.