Boost logo

Boost :

From: helmut.zeisel_at_[hidden]
Date: 2001-07-25 12:11:29

There seems to be a bug w.r.t. the
empty base class optimization in GCC 3.0
which makes operators.hpp more or less unuseable:

"c++ mytest.cpp; a.out" compiled with GCC 3.0 / Linux crashes.
"c++ -DNONEMPTY mytest.cpp; a.out" works.


     class empty_base
     #ifdef NONEMPTY
       int i;

     template <class T, class B = empty_base>
     struct multipliable1 : B
          friend T operator*(T x, const T& y) { return x *= y; }

     class A : multipliable1<A >
       A(int n) {m_v.push_back(0);}

       A& operator*=(const A& other) {return *this;}
       std::vector<int> m_v;

     int main()
       A a(1);
       return 0;

Boost list run by bdawes at, gregod at, cpdaniel at, john at